diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 02fb5d3..94b8300 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -69,4 +69,4 @@ VALIDATE_CPP: false VALIDATE_CSHARP: false VALIDATE_CLANG_FORMAT: false - FILTER_REGEX_EXCLUDE: .*/Web/index.js + FILTER_REGEX_EXCLUDE: '.*\/openapi\.json|.*\/Web\/index\.js' diff --git a/Immutable.uplugin b/Immutable.uplugin index 1cdded3..e88b8e9 100644 --- a/Immutable.uplugin +++ b/Immutable.uplugin @@ -25,6 +25,16 @@ "Name": "ImmutableEditor", "Type": "Editor", "LoadingPhase": "Default" + }, + { + "Name": "ImmutableOrderbook", + "Type": "Runtime", + "LoadingPhase": "Default" + }, + { + "Name": "ImmutablezkEVMAPI", + "Type": "Runtime", + "LoadingPhase": "Default" } ], "Plugins": [ diff --git a/Source/Experimental/ImmutableOrderbook/ImmutableOrderbook.Build.cs b/Source/Experimental/ImmutableOrderbook/ImmutableOrderbook.Build.cs new file mode 100644 index 0000000..022caf1 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/ImmutableOrderbook.Build.cs @@ -0,0 +1,31 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * 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; + } +} \ No newline at end of file diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIAction.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIAction.cpp new file mode 100644 index 0000000..85c6add --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIAction.cpp @@ -0,0 +1,111 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * 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 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& 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& JsonValue) +{ + const TSharedPtr* 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; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIBaseModel.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIBaseModel.cpp new file mode 100644 index 0000000..5590290 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIBaseModel.cpp @@ -0,0 +1,47 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * 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")); + } +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIBigNumberish.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIBigNumberish.cpp new file mode 100644 index 0000000..3a28223 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIBigNumberish.cpp @@ -0,0 +1,41 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * 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& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200Response.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200Response.cpp new file mode 100644 index 0000000..c2ef062 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200Response.cpp @@ -0,0 +1,46 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * 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& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200ResponseResult.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200ResponseResult.cpp new file mode 100644 index 0000000..0049e43 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200ResponseResult.cpp @@ -0,0 +1,56 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * 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& JsonValue) +{ + const TSharedPtr* 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; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200ResponseResultFailedCancellationsInner.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200ResponseResultFailedCancellationsInner.cpp new file mode 100644 index 0000000..8dbb810 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200ResponseResultFailedCancellationsInner.cpp @@ -0,0 +1,101 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancelOrders200ResponseResultFailedCancellationsInner.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APICancelOrders200ResponseResultFailedCancellationsInner::ReasonCodeEnum& Value) +{ + switch (Value) + { + case APICancelOrders200ResponseResultFailedCancellationsInner::ReasonCodeEnum::Filled: + return TEXT("FILLED"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APICancelOrders200ResponseResultFailedCancellationsInner::ReasonCodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APICancelOrders200ResponseResultFailedCancellationsInner::EnumToString(const APICancelOrders200ResponseResultFailedCancellationsInner::ReasonCodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APICancelOrders200ResponseResultFailedCancellationsInner::ReasonCodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("FILLED"), APICancelOrders200ResponseResultFailedCancellationsInner::ReasonCodeEnum::Filled }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APICancelOrders200ResponseResultFailedCancellationsInner::EnumFromString(const FString& EnumAsString, APICancelOrders200ResponseResultFailedCancellationsInner::ReasonCodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APICancelOrders200ResponseResultFailedCancellationsInner::ReasonCodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APICancelOrders200ResponseResultFailedCancellationsInner::ReasonCodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APICancelOrders200ResponseResultFailedCancellationsInner::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Order.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("order")); WriteJsonValue(Writer, Order.GetValue()); + } + if (ReasonCode.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("reason_code")); WriteJsonValue(Writer, ReasonCode.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APICancelOrders200ResponseResultFailedCancellationsInner::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order"), Order); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("reason_code"), ReasonCode); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICancelOrdersOnChain200Response.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrdersOnChain200Response.cpp new file mode 100644 index 0000000..aacc9a7 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrdersOnChain200Response.cpp @@ -0,0 +1,46 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancelOrdersOnChain200Response.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APICancelOrdersOnChain200Response::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (CancellationAction.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("cancellationAction")); WriteJsonValue(Writer, CancellationAction.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APICancelOrdersOnChain200Response::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("cancellationAction"), CancellationAction); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICancelOrdersOnChainRequest.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrdersOnChainRequest.cpp new file mode 100644 index 0000000..200c5a2 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrdersOnChainRequest.cpp @@ -0,0 +1,45 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancelOrdersOnChainRequest.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APICancelOrdersOnChainRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("orderIds")); WriteJsonValue(Writer, OrderIds); + Writer->WriteIdentifierPrefix(TEXT("accountAddress")); WriteJsonValue(Writer, AccountAddress); + Writer->WriteObjectEnd(); +} + +bool APICancelOrdersOnChainRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderIds"), OrderIds); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("accountAddress"), AccountAddress); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICancelOrdersRequest.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrdersRequest.cpp new file mode 100644 index 0000000..e6a8f3e --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICancelOrdersRequest.cpp @@ -0,0 +1,47 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancelOrdersRequest.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APICancelOrdersRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("orderIds")); WriteJsonValue(Writer, OrderIds); + Writer->WriteIdentifierPrefix(TEXT("accountAddress")); WriteJsonValue(Writer, AccountAddress); + Writer->WriteIdentifierPrefix(TEXT("signature")); WriteJsonValue(Writer, Signature); + Writer->WriteObjectEnd(); +} + +bool APICancelOrdersRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderIds"), OrderIds); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("accountAddress"), AccountAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signature"), Signature); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICancellationType.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICancellationType.cpp new file mode 100644 index 0000000..a6171dc --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICancellationType.cpp @@ -0,0 +1,89 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancellationType.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APICancellationType::Values& Value) +{ + switch (Value) + { + case APICancellationType::Values::OnChain: + return TEXT("ON_CHAIN"); + case APICancellationType::Values::OffChain: + return TEXT("OFF_CHAIN"); + case APICancellationType::Values::Underfunded: + return TEXT("UNDERFUNDED"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APICancellationType::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APICancellationType::EnumToString(const APICancellationType::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APICancellationType::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("ON_CHAIN"), APICancellationType::Values::OnChain }, + { TEXT("OFF_CHAIN"), APICancellationType::Values::OffChain }, + { TEXT("UNDERFUNDED"), APICancellationType::Values::Underfunded }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APICancellationType::EnumFromString(const FString& EnumAsString, APICancellationType::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APICancellationType::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APICancellationType::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APICancellationType::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APICancellationType::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICancelledOrderStatusCancellationType.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICancelledOrderStatusCancellationType.cpp new file mode 100644 index 0000000..cf2c35a --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICancelledOrderStatusCancellationType.cpp @@ -0,0 +1,89 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancelledOrderStatusCancellationType.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APICancelledOrderStatusCancellationType::Values& Value) +{ + switch (Value) + { + case APICancelledOrderStatusCancellationType::Values::OnChain: + return TEXT("ON_CHAIN"); + case APICancelledOrderStatusCancellationType::Values::OffChain: + return TEXT("OFF_CHAIN"); + case APICancelledOrderStatusCancellationType::Values::Underfunded: + return TEXT("UNDERFUNDED"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APICancelledOrderStatusCancellationType::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APICancelledOrderStatusCancellationType::EnumToString(const APICancelledOrderStatusCancellationType::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APICancelledOrderStatusCancellationType::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("ON_CHAIN"), APICancelledOrderStatusCancellationType::Values::OnChain }, + { TEXT("OFF_CHAIN"), APICancelledOrderStatusCancellationType::Values::OffChain }, + { TEXT("UNDERFUNDED"), APICancelledOrderStatusCancellationType::Values::Underfunded }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APICancelledOrderStatusCancellationType::EnumFromString(const FString& EnumAsString, APICancelledOrderStatusCancellationType::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APICancelledOrderStatusCancellationType::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APICancelledOrderStatusCancellationType::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APICancelledOrderStatusCancellationType::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APICancelledOrderStatusCancellationType::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICreateListing200Response.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICreateListing200Response.cpp new file mode 100644 index 0000000..a523ade --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICreateListing200Response.cpp @@ -0,0 +1,46 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICreateListing200Response.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APICreateListing200Response::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Result.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APICreateListing200Response::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APICreateListingRequest.cpp b/Source/Experimental/ImmutableOrderbook/Private/APICreateListingRequest.cpp new file mode 100644 index 0000000..7501087 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APICreateListingRequest.cpp @@ -0,0 +1,49 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICreateListingRequest.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APICreateListingRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("makerFees")); WriteJsonValue(Writer, MakerFees); + Writer->WriteIdentifierPrefix(TEXT("orderComponents")); WriteJsonValue(Writer, OrderComponents); + Writer->WriteIdentifierPrefix(TEXT("orderHash")); WriteJsonValue(Writer, OrderHash); + Writer->WriteIdentifierPrefix(TEXT("orderSignature")); WriteJsonValue(Writer, OrderSignature); + Writer->WriteObjectEnd(); +} + +bool APICreateListingRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("makerFees"), MakerFees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderComponents"), OrderComponents); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderHash"), OrderHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderSignature"), OrderSignature); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIERC1155Item.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIERC1155Item.cpp new file mode 100644 index 0000000..5d96378 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIERC1155Item.cpp @@ -0,0 +1,99 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIERC1155Item.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIERC1155Item::TypeEnum& Value) +{ + switch (Value) + { + case APIERC1155Item::TypeEnum::ERC1155: + return TEXT("ERC1155"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIERC1155Item::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIERC1155Item::EnumToString(const APIERC1155Item::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIERC1155Item::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC1155"), APIERC1155Item::TypeEnum::ERC1155 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIERC1155Item::EnumFromString(const FString& EnumAsString, APIERC1155Item::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIERC1155Item::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIERC1155Item::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIERC1155Item::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("contractAddress")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("tokenId")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteObjectEnd(); +} + +bool APIERC1155Item::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contractAddress"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("tokenId"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIERC20Item.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIERC20Item.cpp new file mode 100644 index 0000000..c6a4fa0 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIERC20Item.cpp @@ -0,0 +1,97 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIERC20Item.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIERC20Item::TypeEnum& Value) +{ + switch (Value) + { + case APIERC20Item::TypeEnum::ERC20: + return TEXT("ERC20"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIERC20Item::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIERC20Item::EnumToString(const APIERC20Item::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIERC20Item::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC20"), APIERC20Item::TypeEnum::ERC20 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIERC20Item::EnumFromString(const FString& EnumAsString, APIERC20Item::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIERC20Item::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIERC20Item::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIERC20Item::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("contractAddress")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteObjectEnd(); +} + +bool APIERC20Item::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contractAddress"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIERC721Item.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIERC721Item.cpp new file mode 100644 index 0000000..fde2c3b --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIERC721Item.cpp @@ -0,0 +1,97 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIERC721Item.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIERC721Item::TypeEnum& Value) +{ + switch (Value) + { + case APIERC721Item::TypeEnum::ERC721: + return TEXT("ERC721"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIERC721Item::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIERC721Item::EnumToString(const APIERC721Item::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIERC721Item::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC721"), APIERC721Item::TypeEnum::ERC721 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIERC721Item::EnumFromString(const FString& EnumAsString, APIERC721Item::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIERC721Item::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIERC721Item::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIERC721Item::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("contractAddress")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("tokenId")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteObjectEnd(); +} + +bool APIERC721Item::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contractAddress"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("tokenId"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIFee.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIFee.cpp new file mode 100644 index 0000000..a85d5ea --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIFee.cpp @@ -0,0 +1,56 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFee.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIFee::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Amount.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount.GetValue()); + } + if (RecipientAddress.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("recipientAddress")); WriteJsonValue(Writer, RecipientAddress.GetValue()); + } + if (Type.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIFee::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("recipientAddress"), RecipientAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIFeeType.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIFeeType.cpp new file mode 100644 index 0000000..a2bff99 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIFeeType.cpp @@ -0,0 +1,92 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFeeType.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIFeeType::Values& Value) +{ + switch (Value) + { + case APIFeeType::Values::MakerEcosystem: + return TEXT("MAKER_ECOSYSTEM"); + case APIFeeType::Values::TakerEcosystem: + return TEXT("TAKER_ECOSYSTEM"); + case APIFeeType::Values::Protocol: + return TEXT("PROTOCOL"); + case APIFeeType::Values::Royalty: + return TEXT("ROYALTY"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIFeeType::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIFeeType::EnumToString(const APIFeeType::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIFeeType::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("MAKER_ECOSYSTEM"), APIFeeType::Values::MakerEcosystem }, + { TEXT("TAKER_ECOSYSTEM"), APIFeeType::Values::TakerEcosystem }, + { TEXT("PROTOCOL"), APIFeeType::Values::Protocol }, + { TEXT("ROYALTY"), APIFeeType::Values::Royalty }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIFeeType::EnumFromString(const FString& EnumAsString, APIFeeType::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIFeeType::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIFeeType::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIFeeType::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIFeeType::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIFeeValue.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIFeeValue.cpp new file mode 100644 index 0000000..0162970 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIFeeValue.cpp @@ -0,0 +1,45 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFeeValue.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIFeeValue::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("recipientAddress")); WriteJsonValue(Writer, RecipientAddress); + Writer->WriteObjectEnd(); +} + +bool APIFeeValue::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("recipientAddress"), RecipientAddress); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIFulfillOrder200Response.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIFulfillOrder200Response.cpp new file mode 100644 index 0000000..d1fa391 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIFulfillOrder200Response.cpp @@ -0,0 +1,56 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFulfillOrder200Response.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIFulfillOrder200Response::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Actions.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("actions")); WriteJsonValue(Writer, Actions.GetValue()); + } + if (Expiration.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("expiration")); WriteJsonValue(Writer, Expiration.GetValue()); + } + if (Order.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("order")); WriteJsonValue(Writer, Order.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIFulfillOrder200Response::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("actions"), Actions); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("expiration"), Expiration); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order"), Order); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIFulfillOrderRequest.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIFulfillOrderRequest.cpp new file mode 100644 index 0000000..2c615f2 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIFulfillOrderRequest.cpp @@ -0,0 +1,52 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFulfillOrderRequest.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIFulfillOrderRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("listingId")); WriteJsonValue(Writer, ListingId); + Writer->WriteIdentifierPrefix(TEXT("takerAddress")); WriteJsonValue(Writer, TakerAddress); + Writer->WriteIdentifierPrefix(TEXT("takerFees")); WriteJsonValue(Writer, TakerFees); + if (AmountToFill.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("amountToFill")); WriteJsonValue(Writer, AmountToFill.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIFulfillOrderRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("listingId"), ListingId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("takerAddress"), TakerAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("takerFees"), TakerFees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amountToFill"), AmountToFill); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIFulfillOrderRequestTakerFeesInner.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIFulfillOrderRequestTakerFeesInner.cpp new file mode 100644 index 0000000..d4b0a14 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIFulfillOrderRequestTakerFeesInner.cpp @@ -0,0 +1,45 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFulfillOrderRequestTakerFeesInner.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIFulfillOrderRequestTakerFeesInner::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("recipientAddress")); WriteJsonValue(Writer, RecipientAddress); + Writer->WriteObjectEnd(); +} + +bool APIFulfillOrderRequestTakerFeesInner::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("recipientAddress"), RecipientAddress); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIHelpers.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIHelpers.cpp new file mode 100644 index 0000000..d7c578e --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIHelpers.cpp @@ -0,0 +1,233 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIHelpers.h" + +#include "ImmutableOrderbookModule.h" + +#include "Interfaces/IHttpRequest.h" +#include "PlatformHttp.h" +#include "Misc/FileHelper.h" +#include "Misc/Paths.h" + +namespace ImmutableOrderbook +{ + +HttpFileInput::HttpFileInput(const TCHAR* InFilePath) +{ + SetFilePath(InFilePath); +} + +HttpFileInput::HttpFileInput(const FString& InFilePath) +{ + SetFilePath(InFilePath); +} + +void HttpFileInput::SetFilePath(const TCHAR* InFilePath) +{ + FilePath = InFilePath; + if(ContentType.IsEmpty()) + { + ContentType = FPlatformHttp::GetMimeType(InFilePath); + } +} + +void HttpFileInput::SetFilePath(const FString& InFilePath) +{ + SetFilePath(*InFilePath); +} + +void HttpFileInput::SetContentType(const TCHAR* InContentType) +{ + ContentType = InContentType; +} + +FString HttpFileInput::GetFilename() const +{ + return FPaths::GetCleanFilename(FilePath); +} + +////////////////////////////////////////////////////////////////////////// + +const TCHAR* HttpMultipartFormData::Delimiter = TEXT("--"); +const TCHAR* HttpMultipartFormData::Newline = TEXT("\r\n"); + +void HttpMultipartFormData::SetBoundary(const TCHAR* InBoundary) +{ + checkf(Boundary.IsEmpty(), TEXT("Boundary must be set before usage")); + Boundary = InBoundary; +} + +const FString& HttpMultipartFormData::GetBoundary() const +{ + if (Boundary.IsEmpty()) + { + // Generate a random boundary with enough entropy, should avoid occurrences of the boundary in the data. + // Since the boundary is generated at every request, in case of failure, retries should succeed. + Boundary = FGuid::NewGuid().ToString(EGuidFormats::Short); + } + + return Boundary; +} + +void HttpMultipartFormData::SetupHttpRequest(const FHttpRequestRef& HttpRequest) +{ + if(HttpRequest->GetVerb() != TEXT("POST")) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Expected POST verb when using multipart form data")); + } + + // Append final boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Delimiter); + + HttpRequest->SetHeader("Content-Type", FString::Printf(TEXT("multipart/form-data; boundary=%s"), *GetBoundary())); + HttpRequest->SetContent(FormData); +} + +void HttpMultipartFormData::AddStringPart(const TCHAR* Name, const TCHAR* Data) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name = \"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: text/plain; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(Data); + AppendString(Newline); +} + +void HttpMultipartFormData::AddJsonPart(const TCHAR* Name, const FString& JsonString) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/json; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(*JsonString); + AppendString(Newline); +} + +void HttpMultipartFormData::AddBinaryPart(const TCHAR* Name, const TArray& ByteArray) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/octet-stream"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(ByteArray); + AppendString(Newline); +} + +void HttpMultipartFormData::AddFilePart(const TCHAR* Name, const HttpFileInput& File) +{ + TArray FileContents; + if (!FFileHelper::LoadFileToArray(FileContents, *File.GetFilePath())) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Failed to load file (%s)"), *File.GetFilePath()); + return; + } + + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\"; filename=\"%s\""), Name, *File.GetFilename())); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: %s"), *File.GetContentType())); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(FileContents); + AppendString(Newline); +} + +void HttpMultipartFormData::AppendString(const TCHAR* Str) +{ + FTCHARToUTF8 utf8Str(Str); + FormData.Append((uint8*)utf8Str.Get(), utf8Str.Length()); +} + +////////////////////////////////////////////////////////////////////////// + +bool ParseDateTime(const FString& DateTimeString, FDateTime& OutDateTime) +{ + // Iso8601 Format: DateTime: YYYY-mm-ddTHH:MM:SS(.sss)(Z|+hh:mm|+hhmm|-hh:mm|-hhmm) + { + // We cannot call directly FDateTime::ParseIso8601 because it does not allow for precision beyond the millisecond, but DateTimeString might have more digits + int32 DotIndex; + FString StringToParse = DateTimeString; + if (DateTimeString.FindChar('.', DotIndex)) + { + int32 TimeZoneIndex; + if (DateTimeString.FindChar('Z', TimeZoneIndex) || DateTimeString.FindChar('+', TimeZoneIndex) || DateTimeString.FindChar('-', TimeZoneIndex)) + { + // The string contains a time zone designator starting at TimeZoneIndex + if (TimeZoneIndex > DotIndex + 4) + { + // Trim to millisecond + StringToParse = DateTimeString.Left(DotIndex + 4) + DateTimeString.RightChop(TimeZoneIndex); + } + } + else + { + // the string does not contain a time zone designator, trim it to the millisecond + StringToParse = DateTimeString.Left(DotIndex + 4); + } + } + + if (FDateTime::ParseIso8601(*StringToParse, OutDateTime)) + return true; + } + + if (FDateTime::ParseHttpDate(DateTimeString, OutDateTime)) + return true; + + return FDateTime::Parse(DateTimeString, OutDateTime); +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIItemType.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIItemType.cpp new file mode 100644 index 0000000..4c9360e --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIItemType.cpp @@ -0,0 +1,33 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIItemType.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ +// -- DIVERGE +void APIItemType::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteValue(Value); +} + +bool APIItemType::FromJson(const TSharedPtr& JsonValue) +{ + return JsonValue->TryGetNumber(Value); +} +// -- DIVERGE +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APINativeItem.cpp b/Source/Experimental/ImmutableOrderbook/Private/APINativeItem.cpp new file mode 100644 index 0000000..60850d9 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APINativeItem.cpp @@ -0,0 +1,95 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINativeItem.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APINativeItem::TypeEnum& Value) +{ + switch (Value) + { + case APINativeItem::TypeEnum::Native: + return TEXT("NATIVE"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APINativeItem::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APINativeItem::EnumToString(const APINativeItem::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APINativeItem::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("NATIVE"), APINativeItem::TypeEnum::Native }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APINativeItem::EnumFromString(const FString& EnumAsString, APINativeItem::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APINativeItem::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APINativeItem::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APINativeItem::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteObjectEnd(); +} + +bool APINativeItem::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrder.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrder.cpp new file mode 100644 index 0000000..42c1b70 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrder.cpp @@ -0,0 +1,152 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrder.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIOrder::TypeEnum& Value) +{ + switch (Value) + { + case APIOrder::TypeEnum::Listing: + return TEXT("LISTING"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIOrder::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrder::EnumToString(const APIOrder::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrder::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("LISTING"), APIOrder::TypeEnum::Listing }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrder::EnumFromString(const FString& EnumAsString, APIOrder::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrder::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrder::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrder::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (AccountAddress.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("accountAddress")); WriteJsonValue(Writer, AccountAddress.GetValue()); + } + if (Buy.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("buy")); WriteJsonValue(Writer, Buy.GetValue()); + } + if (Chain.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain.GetValue()); + } + if (CreatedAt.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("createdAt")); WriteJsonValue(Writer, CreatedAt.GetValue()); + } + if (EndAt.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("endAt")); WriteJsonValue(Writer, EndAt.GetValue()); + } + if (Fees.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("fees")); WriteJsonValue(Writer, Fees.GetValue()); + } + if (FillStatus.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("fillStatus")); WriteJsonValue(Writer, FillStatus.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id); + Writer->WriteIdentifierPrefix(TEXT("orderHash")); WriteJsonValue(Writer, OrderHash); + if (ProtocolData.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("protocolData")); WriteJsonValue(Writer, ProtocolData.GetValue()); + } + if (Salt.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("salt")); WriteJsonValue(Writer, Salt.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("sell")); WriteJsonValue(Writer, Sell); + Writer->WriteIdentifierPrefix(TEXT("signature")); WriteJsonValue(Writer, Signature); + Writer->WriteIdentifierPrefix(TEXT("startAt")); WriteJsonValue(Writer, StartAt); + Writer->WriteIdentifierPrefix(TEXT("status")); WriteJsonValue(Writer, Status); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("updatedAt")); WriteJsonValue(Writer, UpdatedAt); + Writer->WriteObjectEnd(); +} + +bool APIOrder::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("accountAddress"), AccountAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("buy"), Buy); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("createdAt"), CreatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("endAt"), EndAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fees"), Fees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fillStatus"), FillStatus); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderHash"), OrderHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("protocolData"), ProtocolData); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("salt"), Salt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sell"), Sell); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signature"), Signature); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("startAt"), StartAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("status"), Status); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updatedAt"), UpdatedAt); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderChain.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderChain.cpp new file mode 100644 index 0000000..8f50163 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderChain.cpp @@ -0,0 +1,51 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderChain.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIOrderChain::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderChain::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderComponents.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderComponents.cpp new file mode 100644 index 0000000..e88e3ae --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderComponents.cpp @@ -0,0 +1,65 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderComponents.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIOrderComponents::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("conduitKey")); WriteJsonValue(Writer, ConduitKey); + Writer->WriteIdentifierPrefix(TEXT("consideration")); WriteJsonValue(Writer, Consideration); + Writer->WriteIdentifierPrefix(TEXT("endTime")); WriteJsonValue(Writer, EndTime); + Writer->WriteIdentifierPrefix(TEXT("offer")); WriteJsonValue(Writer, Offer); + Writer->WriteIdentifierPrefix(TEXT("offerer")); WriteJsonValue(Writer, Offerer); + Writer->WriteIdentifierPrefix(TEXT("orderType")); WriteJsonValue(Writer, OrderType); + Writer->WriteIdentifierPrefix(TEXT("salt")); WriteJsonValue(Writer, Salt); + Writer->WriteIdentifierPrefix(TEXT("startTime")); WriteJsonValue(Writer, StartTime); + Writer->WriteIdentifierPrefix(TEXT("totalOriginalConsiderationItems")); WriteJsonValue(Writer, TotalOriginalConsiderationItems); + Writer->WriteIdentifierPrefix(TEXT("zone")); WriteJsonValue(Writer, Zone); + Writer->WriteIdentifierPrefix(TEXT("zoneHash")); WriteJsonValue(Writer, ZoneHash); + Writer->WriteIdentifierPrefix(TEXT("counter")); WriteJsonValue(Writer, Counter); + Writer->WriteObjectEnd(); +} + +bool APIOrderComponents::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("conduitKey"), ConduitKey); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("consideration"), Consideration); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("endTime"), EndTime); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("offer"), Offer); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("offerer"), Offerer); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderType"), OrderType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("salt"), Salt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("startTime"), StartTime); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("totalOriginalConsiderationItems"), TotalOriginalConsiderationItems); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("zone"), Zone); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("zoneHash"), ZoneHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("counter"), Counter); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderComponentsConsiderationInner.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderComponentsConsiderationInner.cpp new file mode 100644 index 0000000..3f218f7 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderComponentsConsiderationInner.cpp @@ -0,0 +1,53 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderComponentsConsiderationInner.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIOrderComponentsConsiderationInner::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("endAmount")); WriteJsonValue(Writer, EndAmount); + Writer->WriteIdentifierPrefix(TEXT("identifierOrCriteria")); WriteJsonValue(Writer, IdentifierOrCriteria); + Writer->WriteIdentifierPrefix(TEXT("itemType")); WriteJsonValue(Writer, ItemType); + Writer->WriteIdentifierPrefix(TEXT("recipient")); WriteJsonValue(Writer, Recipient); + Writer->WriteIdentifierPrefix(TEXT("startAmount")); WriteJsonValue(Writer, StartAmount); + Writer->WriteIdentifierPrefix(TEXT("token")); WriteJsonValue(Writer, Token); + Writer->WriteObjectEnd(); +} + +bool APIOrderComponentsConsiderationInner::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("endAmount"), EndAmount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("identifierOrCriteria"), IdentifierOrCriteria); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("itemType"), ItemType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("recipient"), Recipient); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("startAmount"), StartAmount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token"), Token); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderComponentsOfferInner.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderComponentsOfferInner.cpp new file mode 100644 index 0000000..bbfde3b --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderComponentsOfferInner.cpp @@ -0,0 +1,51 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderComponentsOfferInner.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIOrderComponentsOfferInner::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("endAmount")); WriteJsonValue(Writer, EndAmount); + Writer->WriteIdentifierPrefix(TEXT("identifierOrCriteria")); WriteJsonValue(Writer, IdentifierOrCriteria); + Writer->WriteIdentifierPrefix(TEXT("itemType")); WriteJsonValue(Writer, ItemType); + Writer->WriteIdentifierPrefix(TEXT("startAmount")); WriteJsonValue(Writer, StartAmount); + Writer->WriteIdentifierPrefix(TEXT("token")); WriteJsonValue(Writer, Token); + Writer->WriteObjectEnd(); +} + +bool APIOrderComponentsOfferInner::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("endAmount"), EndAmount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("identifierOrCriteria"), IdentifierOrCriteria); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("itemType"), ItemType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("startAmount"), StartAmount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token"), Token); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderFillStatus.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderFillStatus.cpp new file mode 100644 index 0000000..7892e38 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderFillStatus.cpp @@ -0,0 +1,51 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderFillStatus.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIOrderFillStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Denominator.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("denominator")); WriteJsonValue(Writer, Denominator.GetValue()); + } + if (Numerator.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("numerator")); WriteJsonValue(Writer, Numerator.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderFillStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("denominator"), Denominator); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("numerator"), Numerator); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderProtocolData.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderProtocolData.cpp new file mode 100644 index 0000000..965d0d3 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderProtocolData.cpp @@ -0,0 +1,119 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderProtocolData.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIOrderProtocolData::OrderTypeEnum& Value) +{ + switch (Value) + { + case APIOrderProtocolData::OrderTypeEnum::FullRestricted: + return TEXT("FULL_RESTRICTED"); + case APIOrderProtocolData::OrderTypeEnum::PartialRestricted: + return TEXT("PARTIAL_RESTRICTED"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIOrderProtocolData::OrderTypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderProtocolData::EnumToString(const APIOrderProtocolData::OrderTypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderProtocolData::OrderTypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("FULL_RESTRICTED"), APIOrderProtocolData::OrderTypeEnum::FullRestricted }, + { TEXT("PARTIAL_RESTRICTED"), APIOrderProtocolData::OrderTypeEnum::PartialRestricted }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderProtocolData::EnumFromString(const FString& EnumAsString, APIOrderProtocolData::OrderTypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderProtocolData::OrderTypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderProtocolData::OrderTypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderProtocolData::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Counter.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("counter")); WriteJsonValue(Writer, Counter.GetValue()); + } + if (OrderType.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("orderType")); WriteJsonValue(Writer, OrderType.GetValue()); + } + if (SeaportAddress.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("seaportAddress")); WriteJsonValue(Writer, SeaportAddress.GetValue()); + } + if (SeaportVersion.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("seaportVersion")); WriteJsonValue(Writer, SeaportVersion.GetValue()); + } + if (ZoneAddress.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("zoneAddress")); WriteJsonValue(Writer, ZoneAddress.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderProtocolData::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("counter"), Counter); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderType"), OrderType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("seaportAddress"), SeaportAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("seaportVersion"), SeaportVersion); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("zoneAddress"), ZoneAddress); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatus.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatus.cpp new file mode 100644 index 0000000..7c48faf --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatus.cpp @@ -0,0 +1,126 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderStatus.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIOrderStatus::NameEnum& Value) +{ + switch (Value) + { + case APIOrderStatus::NameEnum::Pending: + return TEXT("PENDING"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIOrderStatus::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatus::EnumToString(const APIOrderStatus::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatus::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("PENDING"), APIOrderStatus::NameEnum::Pending }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatus::EnumFromString(const FString& EnumAsString, APIOrderStatus::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatus::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatus::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (CancellationType.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("cancellation_type")); WriteJsonValue(Writer, CancellationType.GetValue()); + } + if (Pending.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("pending")); WriteJsonValue(Writer, Pending.GetValue()); + } + if (SufficientApprovals.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("sufficient_approvals")); WriteJsonValue(Writer, SufficientApprovals.GetValue()); + } + if (SufficientBalances.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("sufficient_balances")); WriteJsonValue(Writer, SufficientBalances.GetValue()); + } + if (Evaluated.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("evaluated")); WriteJsonValue(Writer, Evaluated.GetValue()); + } + if (Started.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("started")); WriteJsonValue(Writer, Started.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("cancellation_type"), CancellationType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("pending"), Pending); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sufficient_approvals"), SufficientApprovals); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sufficient_balances"), SufficientBalances); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("evaluated"), Evaluated); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("started"), Started); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf.cpp new file mode 100644 index 0000000..7c1f39a --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf.cpp @@ -0,0 +1,96 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderStatusOneOf.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIOrderStatusOneOf::NameEnum& Value) +{ + switch (Value) + { + case APIOrderStatusOneOf::NameEnum::Active: + return TEXT("ACTIVE"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIOrderStatusOneOf::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatusOneOf::EnumToString(const APIOrderStatusOneOf::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatusOneOf::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ACTIVE"), APIOrderStatusOneOf::NameEnum::Active }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatusOneOf::EnumFromString(const FString& EnumAsString, APIOrderStatusOneOf::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatusOneOf::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatusOneOf::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderStatusOneOf::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderStatusOneOf::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf1.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf1.cpp new file mode 100644 index 0000000..39cbfab --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf1.cpp @@ -0,0 +1,106 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderStatusOneOf1.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIOrderStatusOneOf1::NameEnum& Value) +{ + switch (Value) + { + case APIOrderStatusOneOf1::NameEnum::Cancelled: + return TEXT("CANCELLED"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIOrderStatusOneOf1::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatusOneOf1::EnumToString(const APIOrderStatusOneOf1::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatusOneOf1::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("CANCELLED"), APIOrderStatusOneOf1::NameEnum::Cancelled }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatusOneOf1::EnumFromString(const FString& EnumAsString, APIOrderStatusOneOf1::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatusOneOf1::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatusOneOf1::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderStatusOneOf1::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (CancellationType.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("cancellation_type")); WriteJsonValue(Writer, CancellationType.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Pending.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("pending")); WriteJsonValue(Writer, Pending.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderStatusOneOf1::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("cancellation_type"), CancellationType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("pending"), Pending); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf2.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf2.cpp new file mode 100644 index 0000000..54fd08f --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf2.cpp @@ -0,0 +1,96 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderStatusOneOf2.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIOrderStatusOneOf2::NameEnum& Value) +{ + switch (Value) + { + case APIOrderStatusOneOf2::NameEnum::Expired: + return TEXT("EXPIRED"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIOrderStatusOneOf2::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatusOneOf2::EnumToString(const APIOrderStatusOneOf2::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatusOneOf2::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("EXPIRED"), APIOrderStatusOneOf2::NameEnum::Expired }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatusOneOf2::EnumFromString(const FString& EnumAsString, APIOrderStatusOneOf2::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatusOneOf2::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatusOneOf2::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderStatusOneOf2::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderStatusOneOf2::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf3.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf3.cpp new file mode 100644 index 0000000..338222d --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf3.cpp @@ -0,0 +1,96 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderStatusOneOf3.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIOrderStatusOneOf3::NameEnum& Value) +{ + switch (Value) + { + case APIOrderStatusOneOf3::NameEnum::Filled: + return TEXT("FILLED"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIOrderStatusOneOf3::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatusOneOf3::EnumToString(const APIOrderStatusOneOf3::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatusOneOf3::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("FILLED"), APIOrderStatusOneOf3::NameEnum::Filled }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatusOneOf3::EnumFromString(const FString& EnumAsString, APIOrderStatusOneOf3::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatusOneOf3::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatusOneOf3::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderStatusOneOf3::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderStatusOneOf3::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf4.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf4.cpp new file mode 100644 index 0000000..cba707a --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf4.cpp @@ -0,0 +1,106 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderStatusOneOf4.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIOrderStatusOneOf4::NameEnum& Value) +{ + switch (Value) + { + case APIOrderStatusOneOf4::NameEnum::Inactive: + return TEXT("INACTIVE"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIOrderStatusOneOf4::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatusOneOf4::EnumToString(const APIOrderStatusOneOf4::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatusOneOf4::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("INACTIVE"), APIOrderStatusOneOf4::NameEnum::Inactive }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatusOneOf4::EnumFromString(const FString& EnumAsString, APIOrderStatusOneOf4::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatusOneOf4::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatusOneOf4::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderStatusOneOf4::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (SufficientApprovals.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("sufficient_approvals")); WriteJsonValue(Writer, SufficientApprovals.GetValue()); + } + if (SufficientBalances.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("sufficient_balances")); WriteJsonValue(Writer, SufficientBalances.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderStatusOneOf4::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sufficient_approvals"), SufficientApprovals); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sufficient_balances"), SufficientBalances); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf5.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf5.cpp new file mode 100644 index 0000000..c2a2dd7 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderStatusOneOf5.cpp @@ -0,0 +1,106 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderStatusOneOf5.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIOrderStatusOneOf5::NameEnum& Value) +{ + switch (Value) + { + case APIOrderStatusOneOf5::NameEnum::Pending: + return TEXT("PENDING"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIOrderStatusOneOf5::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatusOneOf5::EnumToString(const APIOrderStatusOneOf5::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatusOneOf5::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("PENDING"), APIOrderStatusOneOf5::NameEnum::Pending }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatusOneOf5::EnumFromString(const FString& EnumAsString, APIOrderStatusOneOf5::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatusOneOf5::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatusOneOf5::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderStatusOneOf5::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Evaluated.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("evaluated")); WriteJsonValue(Writer, Evaluated.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Started.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("started")); WriteJsonValue(Writer, Started.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOrderStatusOneOf5::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("evaluated"), Evaluated); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("started"), Started); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderType.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderType.cpp new file mode 100644 index 0000000..6131eef --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderType.cpp @@ -0,0 +1,33 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderType.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ +// -- DIVERGE +void APIOrderType::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteValue(Value); +} + +bool APIOrderType::FromJson(const TSharedPtr& JsonValue) +{ + return JsonValue->TryGetNumber(Value); +} +// -- DIVERGE +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderbookApi.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderbookApi.cpp new file mode 100644 index 0000000..76f0465 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderbookApi.cpp @@ -0,0 +1,325 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderbookApi.h" + +#include "APIOrderbookApiOperations.h" +#include "ImmutableOrderbookModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutableOrderbook +{ + +APIOrderbookApi::APIOrderbookApi() +: Url(TEXT("https://api.immutable.com")) +{ +} + +APIOrderbookApi::~APIOrderbookApi() {} + +void APIOrderbookApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APIOrderbookApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APIOrderbookApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APIOrderbookApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("APIOrderbookApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APIOrderbookApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APIOrderbookApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APIOrderbookApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APIOrderbookApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APIOrderbookApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutableOrderbook, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APIOrderbookApi::CancelOrders(const CancelOrdersRequest& Request, const FCancelOrdersDelegate& Delegate /*= FCancelOrdersDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrderbookApi::OnCancelOrdersResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrderbookApi::OnCancelOrdersResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelOrdersDelegate Delegate) const +{ + CancelOrdersResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrderbookApi::CancelOrdersOnChain(const CancelOrdersOnChainRequest& Request, const FCancelOrdersOnChainDelegate& Delegate /*= FCancelOrdersOnChainDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrderbookApi::OnCancelOrdersOnChainResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrderbookApi::OnCancelOrdersOnChainResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelOrdersOnChainDelegate Delegate) const +{ + CancelOrdersOnChainResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrderbookApi::CreateListing(const CreateListingRequest& Request, const FCreateListingDelegate& Delegate /*= FCreateListingDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrderbookApi::OnCreateListingResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrderbookApi::OnCreateListingResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateListingDelegate Delegate) const +{ + CreateListingResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrderbookApi::FulfillOrder(const FulfillOrderRequest& Request, const FFulfillOrderDelegate& Delegate /*= FFulfillOrderDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrderbookApi::OnFulfillOrderResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrderbookApi::OnFulfillOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFulfillOrderDelegate Delegate) const +{ + FulfillOrderResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrderbookApi::PrepareListing(const PrepareListingRequest& Request, const FPrepareListingDelegate& Delegate /*= FPrepareListingDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrderbookApi::OnPrepareListingResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrderbookApi::OnPrepareListingResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPrepareListingDelegate Delegate) const +{ + PrepareListingResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrderbookApi::PrepareOrderCancellations(const PrepareOrderCancellationsRequest& Request, const FPrepareOrderCancellationsDelegate& Delegate /*= FPrepareOrderCancellationsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrderbookApi::OnPrepareOrderCancellationsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrderbookApi::OnPrepareOrderCancellationsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPrepareOrderCancellationsDelegate Delegate) const +{ + PrepareOrderCancellationsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrderbookApi::TokenBalance(const TokenBalanceRequest& Request, const FTokenBalanceDelegate& Delegate /*= FTokenBalanceDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrderbookApi::OnTokenBalanceResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrderbookApi::OnTokenBalanceResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FTokenBalanceDelegate Delegate) const +{ + TokenBalanceResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIOrderbookApiOperations.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIOrderbookApiOperations.cpp new file mode 100644 index 0000000..e1cc919 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIOrderbookApiOperations.cpp @@ -0,0 +1,417 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderbookApiOperations.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutableOrderbook +{ + +FString APIOrderbookApi::CancelOrdersRequest::ComputePath() const +{ + FString Path(TEXT("/v1/ts-sdk/orderbook/cancelOrders")); + return Path; +} + +void APIOrderbookApi::CancelOrdersRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory>::Create(&JsonBody); + + if (APICancelOrdersRequest.IsSet()) + { + WriteJsonValue(Writer, APICancelOrdersRequest.GetValue()); + } + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APICancelOrdersRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APICancelOrdersRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrderbookApi::CancelOrdersResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("Response schema for the cancelOrder endpoint")); + break; + } +} + +bool APIOrderbookApi::CancelOrdersResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrderbookApi::CancelOrdersOnChainRequest::ComputePath() const +{ + FString Path(TEXT("/v1/ts-sdk/orderbook/cancelOrdersOnChain")); + return Path; +} + +void APIOrderbookApi::CancelOrdersOnChainRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory>::Create(&JsonBody); + + if (APICancelOrdersOnChainRequest.IsSet()) + { + WriteJsonValue(Writer, APICancelOrdersOnChainRequest.GetValue()); + } + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APICancelOrdersOnChainRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APICancelOrdersOnChainRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrderbookApi::CancelOrdersOnChainResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("Response schema for the cancelOrder endpoint")); + break; + } +} + +bool APIOrderbookApi::CancelOrdersOnChainResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrderbookApi::CreateListingRequest::ComputePath() const +{ + FString Path(TEXT("/v1/ts-sdk/orderbook/createListing")); + return Path; +} + +void APIOrderbookApi::CreateListingRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory>::Create(&JsonBody); + + if (APICreateListingRequest.IsSet()) + { + WriteJsonValue(Writer, APICreateListingRequest.GetValue()); + } + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APICreateListingRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APICreateListingRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrderbookApi::CreateListingResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("The response schema for the create listing endpoint")); + break; + } +} + +bool APIOrderbookApi::CreateListingResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrderbookApi::FulfillOrderRequest::ComputePath() const +{ + FString Path(TEXT("/v1/ts-sdk/orderbook/fulfillOrder")); + return Path; +} + +void APIOrderbookApi::FulfillOrderRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory>::Create(&JsonBody); + + if (APIFulfillOrderRequest.IsSet()) + { + WriteJsonValue(Writer, APIFulfillOrderRequest.GetValue()); + } + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APIFulfillOrderRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APIFulfillOrderRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrderbookApi::FulfillOrderResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("Response schema for the fulfillOrder endpoint")); + break; + } +} + +bool APIOrderbookApi::FulfillOrderResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrderbookApi::PrepareListingRequest::ComputePath() const +{ + FString Path(TEXT("/v1/ts-sdk/orderbook/prepareListing")); + return Path; +} + +void APIOrderbookApi::PrepareListingRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory>::Create(&JsonBody); + + if (APIPrepareListingRequest.IsSet()) + { + WriteJsonValue(Writer, APIPrepareListingRequest.GetValue()); + } + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APIPrepareListingRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APIPrepareListingRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrderbookApi::PrepareListingResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("Response schema for the prepareListing endpoint")); + break; + } +} + +bool APIOrderbookApi::PrepareListingResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrderbookApi::PrepareOrderCancellationsRequest::ComputePath() const +{ + FString Path(TEXT("/v1/ts-sdk/orderbook/prepareOrderCancellations")); + return Path; +} + +void APIOrderbookApi::PrepareOrderCancellationsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory>::Create(&JsonBody); + + if (APIPrepareOrderCancellationsRequest.IsSet()) + { + WriteJsonValue(Writer, APIPrepareOrderCancellationsRequest.GetValue()); + } + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APIPrepareOrderCancellationsRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Body parameter (APIPrepareOrderCancellationsRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutableOrderbook, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrderbookApi::PrepareOrderCancellationsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("Response schema for the prepareOrderCancellations endpoint")); + break; + } +} + +bool APIOrderbookApi::PrepareOrderCancellationsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrderbookApi::TokenBalanceRequest::ComputePath() const +{ + FString Path(TEXT("/v1/ts-sdk/token/balance")); + TArray QueryParams; + QueryParams.Add(FString(TEXT("wallet_address=")) + ToUrlString(WalletAddress)); + QueryParams.Add(FString(TEXT("contract_address=")) + ToUrlString(ContractAddress)); + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIOrderbookApi::TokenBalanceRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIOrderbookApi::TokenBalanceResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("The response body returned from get balance endpoint")); + break; + } +} + +bool APIOrderbookApi::TokenBalanceResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListing200Response.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListing200Response.cpp new file mode 100644 index 0000000..08436fc --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListing200Response.cpp @@ -0,0 +1,47 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPrepareListing200Response.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIPrepareListing200Response::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("actions")); WriteJsonValue(Writer, Actions); + Writer->WriteIdentifierPrefix(TEXT("orderComponents")); WriteJsonValue(Writer, OrderComponents); + Writer->WriteIdentifierPrefix(TEXT("orderHash")); WriteJsonValue(Writer, OrderHash); + Writer->WriteObjectEnd(); +} + +bool APIPrepareListing200Response::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("actions"), Actions); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderComponents"), OrderComponents); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderHash"), OrderHash); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListingRequest.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListingRequest.cpp new file mode 100644 index 0000000..1054276 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListingRequest.cpp @@ -0,0 +1,52 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPrepareListingRequest.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIPrepareListingRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("buy")); WriteJsonValue(Writer, Buy); + Writer->WriteIdentifierPrefix(TEXT("makerAddress")); WriteJsonValue(Writer, MakerAddress); + if (OrderExpiry.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("orderExpiry")); WriteJsonValue(Writer, OrderExpiry.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("sell")); WriteJsonValue(Writer, Sell); + Writer->WriteObjectEnd(); +} + +bool APIPrepareListingRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("buy"), Buy); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("makerAddress"), MakerAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderExpiry"), OrderExpiry); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sell"), Sell); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListingRequestBuy.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListingRequestBuy.cpp new file mode 100644 index 0000000..bf69462 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListingRequestBuy.cpp @@ -0,0 +1,100 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPrepareListingRequestBuy.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIPrepareListingRequestBuy::TypeEnum& Value) +{ + switch (Value) + { + case APIPrepareListingRequestBuy::TypeEnum::ERC20: + return TEXT("ERC20"); + case APIPrepareListingRequestBuy::TypeEnum::Native: + return TEXT("NATIVE"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIPrepareListingRequestBuy::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIPrepareListingRequestBuy::EnumToString(const APIPrepareListingRequestBuy::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIPrepareListingRequestBuy::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC20"), APIPrepareListingRequestBuy::TypeEnum::ERC20 }, + { TEXT("NATIVE"), APIPrepareListingRequestBuy::TypeEnum::Native }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIPrepareListingRequestBuy::EnumFromString(const FString& EnumAsString, APIPrepareListingRequestBuy::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIPrepareListingRequestBuy::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIPrepareListingRequestBuy::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIPrepareListingRequestBuy::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("contractAddress")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteObjectEnd(); +} + +bool APIPrepareListingRequestBuy::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contractAddress"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListingRequestSell.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListingRequestSell.cpp new file mode 100644 index 0000000..6ab789e --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareListingRequestSell.cpp @@ -0,0 +1,107 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPrepareListingRequestSell.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APIPrepareListingRequestSell::TypeEnum& Value) +{ + switch (Value) + { + case APIPrepareListingRequestSell::TypeEnum::ERC1155: + return TEXT("ERC1155"); + case APIPrepareListingRequestSell::TypeEnum::ERC721: + return TEXT("ERC721"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIPrepareListingRequestSell::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIPrepareListingRequestSell::EnumToString(const APIPrepareListingRequestSell::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIPrepareListingRequestSell::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC1155"), APIPrepareListingRequestSell::TypeEnum::ERC1155 }, + { TEXT("ERC721"), APIPrepareListingRequestSell::TypeEnum::ERC721 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIPrepareListingRequestSell::EnumFromString(const FString& EnumAsString, APIPrepareListingRequestSell::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIPrepareListingRequestSell::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIPrepareListingRequestSell::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIPrepareListingRequestSell::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + // -- DIVERGE + if (Amount.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount.GetValue()); + } + // -- DIVERGE + Writer->WriteIdentifierPrefix(TEXT("contractAddress")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("tokenId")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteObjectEnd(); +} + +bool APIPrepareListingRequestSell::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contractAddress"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("tokenId"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIPrepareOrderCancellations200Response.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareOrderCancellations200Response.cpp new file mode 100644 index 0000000..ff1a296 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareOrderCancellations200Response.cpp @@ -0,0 +1,46 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPrepareOrderCancellations200Response.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIPrepareOrderCancellations200Response::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (SignableAction.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("signableAction")); WriteJsonValue(Writer, SignableAction.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIPrepareOrderCancellations200Response::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signableAction"), SignableAction); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIPrepareOrderCancellationsRequest.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareOrderCancellationsRequest.cpp new file mode 100644 index 0000000..3a8daac --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIPrepareOrderCancellationsRequest.cpp @@ -0,0 +1,43 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPrepareOrderCancellationsRequest.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIPrepareOrderCancellationsRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("orderIds")); WriteJsonValue(Writer, OrderIds); + Writer->WriteObjectEnd(); +} + +bool APIPrepareOrderCancellationsRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orderIds"), OrderIds); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APIRecordStringTypedDataFieldValueInner.cpp b/Source/Experimental/ImmutableOrderbook/Private/APIRecordStringTypedDataFieldValueInner.cpp new file mode 100644 index 0000000..9415f23 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APIRecordStringTypedDataFieldValueInner.cpp @@ -0,0 +1,45 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIRecordStringTypedDataFieldValueInner.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APIRecordStringTypedDataFieldValueInner::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteObjectEnd(); +} + +bool APIRecordStringTypedDataFieldValueInner::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APISignableAction.cpp b/Source/Experimental/ImmutableOrderbook/Private/APISignableAction.cpp new file mode 100644 index 0000000..78ec77e --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APISignableAction.cpp @@ -0,0 +1,103 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISignableAction.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APISignableAction::TypeEnum& Value) +{ + switch (Value) + { + case APISignableAction::TypeEnum::Signable: + return TEXT("SIGNABLE"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APISignableAction::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APISignableAction::EnumToString(const APISignableAction::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APISignableAction::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("SIGNABLE"), APISignableAction::TypeEnum::Signable }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APISignableAction::EnumFromString(const FString& EnumAsString, APISignableAction::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APISignableAction::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APISignableAction::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APISignableAction::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Message.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message.GetValue()); + } + if (Purpose.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("purpose")); WriteJsonValue(Writer, Purpose.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteObjectEnd(); +} + +bool APISignableAction::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("purpose"), Purpose); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APISignableActionMessage.cpp b/Source/Experimental/ImmutableOrderbook/Private/APISignableActionMessage.cpp new file mode 100644 index 0000000..c9b4d89 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APISignableActionMessage.cpp @@ -0,0 +1,61 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISignableActionMessage.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APISignableActionMessage::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Domain.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("domain")); WriteJsonValue(Writer, Domain.GetValue()); + } + if (Types.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("types")); WriteJsonValue(Writer, Types.GetValue()); + } + if (Message.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message.GetValue()); + } + if (PrimaryType.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("primaryType")); WriteJsonValue(Writer, PrimaryType.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APISignableActionMessage::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("domain"), Domain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("types"), Types); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("primaryType"), PrimaryType); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APISignablePurpose.cpp b/Source/Experimental/ImmutableOrderbook/Private/APISignablePurpose.cpp new file mode 100644 index 0000000..fd5aae9 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APISignablePurpose.cpp @@ -0,0 +1,86 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISignablePurpose.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APISignablePurpose::Values& Value) +{ + switch (Value) + { + case APISignablePurpose::Values::CreateListing: + return TEXT("CREATE_LISTING"); + case APISignablePurpose::Values::OffChainCancellation: + return TEXT("OFF_CHAIN_CANCELLATION"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APISignablePurpose::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APISignablePurpose::EnumToString(const APISignablePurpose::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APISignablePurpose::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("CREATE_LISTING"), APISignablePurpose::Values::CreateListing }, + { TEXT("OFF_CHAIN_CANCELLATION"), APISignablePurpose::Values::OffChainCancellation }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APISignablePurpose::EnumFromString(const FString& EnumAsString, APISignablePurpose::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APISignablePurpose::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APISignablePurpose::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APISignablePurpose::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APISignablePurpose::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APITokenBalance200Response.cpp b/Source/Experimental/ImmutableOrderbook/Private/APITokenBalance200Response.cpp new file mode 100644 index 0000000..388a0b6 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APITokenBalance200Response.cpp @@ -0,0 +1,43 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITokenBalance200Response.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APITokenBalance200Response::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("quantity")); WriteJsonValue(Writer, Quantity); + Writer->WriteObjectEnd(); +} + +bool APITokenBalance200Response::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("quantity"), Quantity); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APITransactionAction.cpp b/Source/Experimental/ImmutableOrderbook/Private/APITransactionAction.cpp new file mode 100644 index 0000000..c5c996c --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APITransactionAction.cpp @@ -0,0 +1,103 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITransactionAction.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APITransactionAction::TypeEnum& Value) +{ + switch (Value) + { + case APITransactionAction::TypeEnum::Transaction: + return TEXT("TRANSACTION"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APITransactionAction::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APITransactionAction::EnumToString(const APITransactionAction::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APITransactionAction::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("TRANSACTION"), APITransactionAction::TypeEnum::Transaction }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APITransactionAction::EnumFromString(const FString& EnumAsString, APITransactionAction::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APITransactionAction::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APITransactionAction::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APITransactionAction::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); + Writer->WriteObjectEnd(); +} + +bool APITransactionAction::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* 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); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APITransactionActionPopulatedTransactions.cpp b/Source/Experimental/ImmutableOrderbook/Private/APITransactionActionPopulatedTransactions.cpp new file mode 100644 index 0000000..0b557cb --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APITransactionActionPopulatedTransactions.cpp @@ -0,0 +1,111 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITransactionActionPopulatedTransactions.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APITransactionActionPopulatedTransactions::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (To.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("to")); WriteJsonValue(Writer, To.GetValue()); + } + if (From.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("from")); WriteJsonValue(Writer, From.GetValue()); + } + if (Nonce.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("nonce")); WriteJsonValue(Writer, Nonce.GetValue()); + } + if (GasLimit.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("gasLimit")); WriteJsonValue(Writer, GasLimit.GetValue()); + } + if (GasPrice.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("gasPrice")); WriteJsonValue(Writer, GasPrice.GetValue()); + } + if (Data.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("data")); WriteJsonValue(Writer, Data.GetValue()); + } + if (Value.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("value")); WriteJsonValue(Writer, Value.GetValue()); + } + if (ChainId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("chainId")); WriteJsonValue(Writer, ChainId.GetValue()); + } + if (Type.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type.GetValue()); + } + if (AccessList.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("accessList")); WriteJsonValue(Writer, AccessList.GetValue()); + } + if (MaxFeePerGas.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("maxFeePerGas")); WriteJsonValue(Writer, MaxFeePerGas.GetValue()); + } + if (MaxPriorityFeePerGas.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("maxPriorityFeePerGas")); WriteJsonValue(Writer, MaxPriorityFeePerGas.GetValue()); + } + if (CustomData.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("customData")); WriteJsonValue(Writer, CustomData.GetValue()); + } + if (CcipReadEnabled.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("ccipReadEnabled")); WriteJsonValue(Writer, CcipReadEnabled.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APITransactionActionPopulatedTransactions::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("to"), To); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("from"), From); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("nonce"), Nonce); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("gasLimit"), GasLimit); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("gasPrice"), GasPrice); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("data"), Data); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("value"), Value); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chainId"), ChainId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("accessList"), AccessList); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("maxFeePerGas"), MaxFeePerGas); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("maxPriorityFeePerGas"), MaxPriorityFeePerGas); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("customData"), CustomData); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("ccipReadEnabled"), CcipReadEnabled); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APITransactionActionPopulatedTransactionsAccessListInner.cpp b/Source/Experimental/ImmutableOrderbook/Private/APITransactionActionPopulatedTransactionsAccessListInner.cpp new file mode 100644 index 0000000..e61189a --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APITransactionActionPopulatedTransactionsAccessListInner.cpp @@ -0,0 +1,51 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITransactionActionPopulatedTransactionsAccessListInner.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APITransactionActionPopulatedTransactionsAccessListInner::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Address.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("address")); WriteJsonValue(Writer, Address.GetValue()); + } + if (StorageKeys.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("storageKeys")); WriteJsonValue(Writer, StorageKeys.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APITransactionActionPopulatedTransactionsAccessListInner::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("address"), Address); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("storageKeys"), StorageKeys); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APITransactionPurpose.cpp b/Source/Experimental/ImmutableOrderbook/Private/APITransactionPurpose.cpp new file mode 100644 index 0000000..a9623d4 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APITransactionPurpose.cpp @@ -0,0 +1,89 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITransactionPurpose.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +inline FString ToString(const APITransactionPurpose::Values& Value) +{ + switch (Value) + { + case APITransactionPurpose::Values::Approval: + return TEXT("APPROVAL"); + case APITransactionPurpose::Values::FulfillOrder: + return TEXT("FULFILL_ORDER"); + case APITransactionPurpose::Values::Cancel: + return TEXT("CANCEL"); + } + + UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APITransactionPurpose::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APITransactionPurpose::EnumToString(const APITransactionPurpose::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APITransactionPurpose::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("APPROVAL"), APITransactionPurpose::Values::Approval }, + { TEXT("FULFILL_ORDER"), APITransactionPurpose::Values::FulfillOrder }, + { TEXT("CANCEL"), APITransactionPurpose::Values::Cancel }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APITransactionPurpose::EnumFromString(const FString& EnumAsString, APITransactionPurpose::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APITransactionPurpose::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APITransactionPurpose::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APITransactionPurpose::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APITransactionPurpose::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/APITypedDataDomain.cpp b/Source/Experimental/ImmutableOrderbook/Private/APITypedDataDomain.cpp new file mode 100644 index 0000000..8947f41 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/APITypedDataDomain.cpp @@ -0,0 +1,66 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITypedDataDomain.h" + +#include "ImmutableOrderbookModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutableOrderbook +{ + +void APITypedDataDomain::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (ChainId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("chainId")); WriteJsonValue(Writer, ChainId.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Salt.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("salt")); WriteJsonValue(Writer, Salt.GetValue()); + } + if (VerifyingContract.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("verifyingContract")); WriteJsonValue(Writer, VerifyingContract.GetValue()); + } + if (Version.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("version")); WriteJsonValue(Writer, Version.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APITypedDataDomain::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chainId"), ChainId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("salt"), Salt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("verifyingContract"), VerifyingContract); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("version"), Version); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/ImmutableOrderbookModule.cpp b/Source/Experimental/ImmutableOrderbook/Private/ImmutableOrderbookModule.cpp new file mode 100644 index 0000000..120793f --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/ImmutableOrderbookModule.cpp @@ -0,0 +1,24 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "ImmutableOrderbookModule.h" + +IMPLEMENT_MODULE(ImmutableOrderbookModule, ImmutableOrderbook); +DEFINE_LOG_CATEGORY(LogImmutableOrderbook); + +void ImmutableOrderbookModule::StartupModule() +{ +} + +void ImmutableOrderbookModule::ShutdownModule() +{ +} diff --git a/Source/Experimental/ImmutableOrderbook/Private/ImmutableOrderbookModule.h b/Source/Experimental/ImmutableOrderbook/Private/ImmutableOrderbookModule.h new file mode 100644 index 0000000..6a1f69c --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Private/ImmutableOrderbookModule.h @@ -0,0 +1,26 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "Modules/ModuleInterface.h" +#include "Modules/ModuleManager.h" +#include "Logging/LogMacros.h" + +DECLARE_LOG_CATEGORY_EXTERN(LogImmutableOrderbook, Log, All); + +class IMMUTABLEORDERBOOK_API ImmutableOrderbookModule : public IModuleInterface +{ +public: + void StartupModule() final; + void ShutdownModule() final; +}; diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIAction.h b/Source/Experimental/ImmutableOrderbook/Public/APIAction.h new file mode 100644 index 0000000..f7935ec --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIAction.h @@ -0,0 +1,51 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APISignableAction.h" +#include "APISignableActionMessage.h" +#include "APISignablePurpose.h" +#include "APITransactionAction.h" +#include "APITransactionActionPopulatedTransactions.h" + +namespace ImmutableOrderbook +{ + +/* + * APIAction + * + * + */ +class IMMUTABLEORDERBOOK_API APIAction : public Model +{ +public: + virtual ~APIAction() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional PopulatedTransactions; + TOptional Purpose; + enum class TypeEnum + { + Transaction, + Signable, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; + TOptional Message; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIBaseModel.h b/Source/Experimental/ImmutableOrderbook/Public/APIBaseModel.h new file mode 100644 index 0000000..4afd425 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIBaseModel.h @@ -0,0 +1,108 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" +#include "Serialization/JsonWriter.h" +#include "Dom/JsonObject.h" +#include "HttpRetrySystem.h" +#include "Containers/Ticker.h" +#include "Policies/CondensedJsonPrintPolicy.h" +#include "Runtime/Launch/Resources/Version.h" + +namespace ImmutableOrderbook +{ + +typedef TSharedRef>> JsonWriter; +using namespace FHttpRetrySystem; + +struct IMMUTABLEORDERBOOK_API HttpRetryManager + : public FManager +#if ENGINE_MAJOR_VERSION <= 4 + , public FTickerObjectBase +#else + , public FTSTickerObjectBase +#endif +{ + using FManager::FManager; + + bool Tick(float DeltaTime) final; +}; + +struct IMMUTABLEORDERBOOK_API HttpRetryParams +{ + HttpRetryParams( + const FRetryLimitCountSetting& InRetryLimitCountOverride = FRetryLimitCountSetting(), + const FRetryTimeoutRelativeSecondsSetting& InRetryTimeoutRelativeSecondsOverride = FRetryTimeoutRelativeSecondsSetting(), + const FRetryResponseCodes& InRetryResponseCodes = FRetryResponseCodes(), + const FRetryVerbs& InRetryVerbs = FRetryVerbs(), + const FRetryDomainsPtr& InRetryDomains = FRetryDomainsPtr() + ); + + FRetryLimitCountSetting RetryLimitCountOverride; + FRetryTimeoutRelativeSecondsSetting RetryTimeoutRelativeSecondsOverride; + FRetryResponseCodes RetryResponseCodes; + FRetryVerbs RetryVerbs; + FRetryDomainsPtr RetryDomains; +}; + +class IMMUTABLEORDERBOOK_API Model +{ +public: + virtual ~Model() {} + virtual void WriteJson(JsonWriter& Writer) const = 0; + virtual bool FromJson(const TSharedPtr& JsonValue) = 0; +}; + +class IMMUTABLEORDERBOOK_API Request +{ +public: + virtual ~Request() {} + virtual void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const = 0; + virtual FString ComputePath() const = 0; + + /* Enables retry and optionally sets a retry policy for this request */ + void SetShouldRetry(const HttpRetryParams& Params = HttpRetryParams()) { RetryParams = Params; } + const TOptional& GetRetryParams() const { return RetryParams; } + +private: + TOptional RetryParams; +}; + +class IMMUTABLEORDERBOOK_API Response +{ +public: + virtual ~Response() {} + virtual bool FromJson(const TSharedPtr& JsonValue) = 0; + + void SetSuccessful(bool InSuccessful) { Successful = InSuccessful; } + bool IsSuccessful() const { return Successful; } + + virtual void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode); + EHttpResponseCodes::Type GetHttpResponseCode() const { return ResponseCode; } + + void SetResponseString(const FString& InResponseString) { ResponseString = InResponseString; } + const FString& GetResponseString() const { return ResponseString; } + + void SetHttpResponse(const FHttpResponsePtr& InHttpResponse) { HttpResponse = InHttpResponse; } + const FHttpResponsePtr& GetHttpResponse() const { return HttpResponse; } + +private: + bool Successful; + EHttpResponseCodes::Type ResponseCode; + FString ResponseString; + FHttpResponsePtr HttpResponse; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIBigNumberish.h b/Source/Experimental/ImmutableOrderbook/Public/APIBigNumberish.h new file mode 100644 index 0000000..7b8b7ba --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIBigNumberish.h @@ -0,0 +1,34 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIBigNumberish + * + * Any type that can be used where a big number is needed. + */ +class IMMUTABLEORDERBOOK_API APIBigNumberish : public Model +{ +public: + virtual ~APIBigNumberish() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICancelOrders200Response.h b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrders200Response.h new file mode 100644 index 0000000..29ea2b3 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrders200Response.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICancelOrders200ResponseResult.h" + +namespace ImmutableOrderbook +{ + +/* + * APICancelOrders200Response + * + * Response schema for the cancelOrder endpoint + */ +class IMMUTABLEORDERBOOK_API APICancelOrders200Response : public Model +{ +public: + virtual ~APICancelOrders200Response() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Result; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICancelOrders200ResponseResult.h b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrders200ResponseResult.h new file mode 100644 index 0000000..7a6f337 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrders200ResponseResult.h @@ -0,0 +1,41 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICancelOrders200ResponseResultFailedCancellationsInner.h" + +namespace ImmutableOrderbook +{ + +/* + * APICancelOrders200ResponseResult + * + * + */ +class IMMUTABLEORDERBOOK_API APICancelOrders200ResponseResult : public Model +{ +public: + virtual ~APICancelOrders200ResponseResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Orders which failed to be cancelled */ + TOptional> FailedCancellations; + /* Orders which are marked for cancellation but the cancellation cannot be guaranteed */ + TOptional> PendingCancellations; + /* Orders which were successfully cancelled */ + TOptional> SuccessfulCancellations; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICancelOrders200ResponseResultFailedCancellationsInner.h b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrders200ResponseResultFailedCancellationsInner.h new file mode 100644 index 0000000..7ee6ae5 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrders200ResponseResultFailedCancellationsInner.h @@ -0,0 +1,45 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APICancelOrders200ResponseResultFailedCancellationsInner + * + * + */ +class IMMUTABLEORDERBOOK_API APICancelOrders200ResponseResultFailedCancellationsInner : public Model +{ +public: + virtual ~APICancelOrders200ResponseResultFailedCancellationsInner() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* ID of the order which failed to be cancelled */ + TOptional Order; + enum class ReasonCodeEnum + { + Filled, + }; + + static FString EnumToString(const ReasonCodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, ReasonCodeEnum& EnumValue); + /* Reason code indicating why the order failed to be cancelled */ + TOptional ReasonCode; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICancelOrdersOnChain200Response.h b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrdersOnChain200Response.h new file mode 100644 index 0000000..69dc15f --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrdersOnChain200Response.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APITransactionAction.h" + +namespace ImmutableOrderbook +{ + +/* + * APICancelOrdersOnChain200Response + * + * Response schema for the cancelOrder endpoint + */ +class IMMUTABLEORDERBOOK_API APICancelOrdersOnChain200Response : public Model +{ +public: + virtual ~APICancelOrdersOnChain200Response() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional CancellationAction; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICancelOrdersOnChainRequest.h b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrdersOnChainRequest.h new file mode 100644 index 0000000..80f1bbf --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrdersOnChainRequest.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APICancelOrdersOnChainRequest + * + * + */ +class IMMUTABLEORDERBOOK_API APICancelOrdersOnChainRequest : public Model +{ +public: + virtual ~APICancelOrdersOnChainRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TArray OrderIds; + FString AccountAddress; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICancelOrdersRequest.h b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrdersRequest.h new file mode 100644 index 0000000..67d37e4 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICancelOrdersRequest.h @@ -0,0 +1,37 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APICancelOrdersRequest + * + * + */ +class IMMUTABLEORDERBOOK_API APICancelOrdersRequest : public Model +{ +public: + virtual ~APICancelOrdersRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TArray OrderIds; + FString AccountAddress; + FString Signature; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICancellationType.h b/Source/Experimental/ImmutableOrderbook/Public/APICancellationType.h new file mode 100644 index 0000000..91de079 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICancellationType.h @@ -0,0 +1,45 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APICancellationType + * + * Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account + */ +class IMMUTABLEORDERBOOK_API APICancellationType : public Model +{ +public: + virtual ~APICancellationType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + OnChain, + OffChain, + Underfunded, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICancelledOrderStatusCancellationType.h b/Source/Experimental/ImmutableOrderbook/Public/APICancelledOrderStatusCancellationType.h new file mode 100644 index 0000000..d507408 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICancelledOrderStatusCancellationType.h @@ -0,0 +1,45 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APICancelledOrderStatusCancellationType + * + * Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account + */ +class IMMUTABLEORDERBOOK_API APICancelledOrderStatusCancellationType : public Model +{ +public: + virtual ~APICancelledOrderStatusCancellationType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + OnChain, + OffChain, + Underfunded, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICreateListing200Response.h b/Source/Experimental/ImmutableOrderbook/Public/APICreateListing200Response.h new file mode 100644 index 0000000..11431eb --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICreateListing200Response.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrder.h" + +namespace ImmutableOrderbook +{ + +/* + * APICreateListing200Response + * + * The response schema for the create listing endpoint + */ +class IMMUTABLEORDERBOOK_API APICreateListing200Response : public Model +{ +public: + virtual ~APICreateListing200Response() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Result; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APICreateListingRequest.h b/Source/Experimental/ImmutableOrderbook/Public/APICreateListingRequest.h new file mode 100644 index 0000000..40f1cf5 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APICreateListingRequest.h @@ -0,0 +1,40 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIFeeValue.h" +#include "APIOrderComponents.h" + +namespace ImmutableOrderbook +{ + +/* + * APICreateListingRequest + * + * + */ +class IMMUTABLEORDERBOOK_API APICreateListingRequest : public Model +{ +public: + virtual ~APICreateListingRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TArray MakerFees; + APIOrderComponents OrderComponents; + FString OrderHash; + FString OrderSignature; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIERC1155Item.h b/Source/Experimental/ImmutableOrderbook/Public/APIERC1155Item.h new file mode 100644 index 0000000..ffb0508 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIERC1155Item.h @@ -0,0 +1,45 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIERC1155Item + * + * + */ +class IMMUTABLEORDERBOOK_API APIERC1155Item : public Model +{ +public: + virtual ~APIERC1155Item() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString Amount; + FString ContractAddress; + FString TokenId; + enum class TypeEnum + { + ERC1155, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIERC20Item.h b/Source/Experimental/ImmutableOrderbook/Public/APIERC20Item.h new file mode 100644 index 0000000..cb542bd --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIERC20Item.h @@ -0,0 +1,44 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIERC20Item + * + * + */ +class IMMUTABLEORDERBOOK_API APIERC20Item : public Model +{ +public: + virtual ~APIERC20Item() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString Amount; + FString ContractAddress; + enum class TypeEnum + { + ERC20, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIERC721Item.h b/Source/Experimental/ImmutableOrderbook/Public/APIERC721Item.h new file mode 100644 index 0000000..9b83620 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIERC721Item.h @@ -0,0 +1,44 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIERC721Item + * + * + */ +class IMMUTABLEORDERBOOK_API APIERC721Item : public Model +{ +public: + virtual ~APIERC721Item() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString ContractAddress; + FString TokenId; + enum class TypeEnum + { + ERC721, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIFee.h b/Source/Experimental/ImmutableOrderbook/Public/APIFee.h new file mode 100644 index 0000000..ffb0054 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIFee.h @@ -0,0 +1,38 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIFeeType.h" + +namespace ImmutableOrderbook +{ + +/* + * APIFee + * + * + */ +class IMMUTABLEORDERBOOK_API APIFee : public Model +{ +public: + virtual ~APIFee() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Amount; + TOptional RecipientAddress; + TOptional Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIFeeType.h b/Source/Experimental/ImmutableOrderbook/Public/APIFeeType.h new file mode 100644 index 0000000..a4f1741 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIFeeType.h @@ -0,0 +1,46 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIFeeType + * + * + */ +class IMMUTABLEORDERBOOK_API APIFeeType : public Model +{ +public: + virtual ~APIFeeType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + MakerEcosystem, + TakerEcosystem, + Protocol, + Royalty, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIFeeValue.h b/Source/Experimental/ImmutableOrderbook/Public/APIFeeValue.h new file mode 100644 index 0000000..e24eb3a --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIFeeValue.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIFeeValue + * + * + */ +class IMMUTABLEORDERBOOK_API APIFeeValue : public Model +{ +public: + virtual ~APIFeeValue() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString Amount; + FString RecipientAddress; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIFulfillOrder200Response.h b/Source/Experimental/ImmutableOrderbook/Public/APIFulfillOrder200Response.h new file mode 100644 index 0000000..548b66f --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIFulfillOrder200Response.h @@ -0,0 +1,40 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrder.h" +#include "APITransactionAction.h" + +namespace ImmutableOrderbook +{ + +/* + * APIFulfillOrder200Response + * + * Response schema for the fulfillOrder endpoint + */ +class IMMUTABLEORDERBOOK_API APIFulfillOrder200Response : public Model +{ +public: + virtual ~APIFulfillOrder200Response() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional> Actions; + /* User MUST submit the fulfillment transaction before the expiration Submitting after the expiration will result in a on chain revert */ + TOptional Expiration; + TOptional Order; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIFulfillOrderRequest.h b/Source/Experimental/ImmutableOrderbook/Public/APIFulfillOrderRequest.h new file mode 100644 index 0000000..4cc15d8 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIFulfillOrderRequest.h @@ -0,0 +1,43 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIFulfillOrderRequestTakerFeesInner.h" + +namespace ImmutableOrderbook +{ + +/* + * APIFulfillOrderRequest + * + * + */ +class IMMUTABLEORDERBOOK_API APIFulfillOrderRequest : public Model +{ +public: + virtual ~APIFulfillOrderRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* listingId */ + FString ListingId; + /* takerAddress */ + FString TakerAddress; + /* takerFees */ + TArray TakerFees; + /* amountToFill */ + TOptional AmountToFill; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIFulfillOrderRequestTakerFeesInner.h b/Source/Experimental/ImmutableOrderbook/Public/APIFulfillOrderRequestTakerFeesInner.h new file mode 100644 index 0000000..f3fe8b8 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIFulfillOrderRequestTakerFeesInner.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIFulfillOrderRequestTakerFeesInner + * + * + */ +class IMMUTABLEORDERBOOK_API APIFulfillOrderRequestTakerFeesInner : public Model +{ +public: + virtual ~APIFulfillOrderRequestTakerFeesInner() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString Amount; + FString RecipientAddress; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIHelpers.h b/Source/Experimental/ImmutableOrderbook/Public/APIHelpers.h new file mode 100644 index 0000000..3332592 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIHelpers.h @@ -0,0 +1,477 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +#include "Serialization/JsonSerializer.h" +#include "Dom/JsonObject.h" +#include "Misc/Base64.h" +#include "PlatformHttp.h" + +class IHttpRequest; + +namespace ImmutableOrderbook +{ + +typedef TSharedRef>> JsonWriter; + +////////////////////////////////////////////////////////////////////////// + +class IMMUTABLEORDERBOOK_API HttpFileInput +{ +public: + explicit HttpFileInput(const TCHAR* InFilePath); + explicit HttpFileInput(const FString& InFilePath); + + // This will automatically set the content type if not already set + void SetFilePath(const TCHAR* InFilePath); + void SetFilePath(const FString& InFilePath); + + // Optional if it can be deduced from the FilePath + void SetContentType(const TCHAR* ContentType); + + HttpFileInput& operator=(const HttpFileInput& Other) = default; + HttpFileInput& operator=(const FString& InFilePath) { SetFilePath(*InFilePath); return*this; } + HttpFileInput& operator=(const TCHAR* InFilePath) { SetFilePath(InFilePath); return*this; } + + const FString& GetFilePath() const { return FilePath; } + const FString& GetContentType() const { return ContentType; } + + // Returns the filename with extension + FString GetFilename() const; + +private: + FString FilePath; + FString ContentType; +}; + +////////////////////////////////////////////////////////////////////////// + +class HttpMultipartFormData +{ +public: + void SetBoundary(const TCHAR* InBoundary); + void SetupHttpRequest(const FHttpRequestRef& HttpRequest); + + void AddStringPart(const TCHAR* Name, const TCHAR* Data); + void AddJsonPart(const TCHAR* Name, const FString& JsonString); + void AddBinaryPart(const TCHAR* Name, const TArray& ByteArray); + void AddFilePart(const TCHAR* Name, const HttpFileInput& File); + +private: + void AppendString(const TCHAR* Str); + const FString& GetBoundary() const; + + mutable FString Boundary; + TArray FormData; + + static const TCHAR* Delimiter; + static const TCHAR* Newline; +}; + +////////////////////////////////////////////////////////////////////////// + +// Decodes Base64Url encoded strings, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +bool Base64UrlDecode(const FString& Base64String, T& Value) +{ + FString TmpCopy(Base64String); + TmpCopy.ReplaceInline(TEXT("-"), TEXT("+")); + TmpCopy.ReplaceInline(TEXT("_"), TEXT("/")); + + return FBase64::Decode(TmpCopy, Value); +} + +// Encodes strings in Base64Url, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +FString Base64UrlEncode(const T& Value) +{ + FString Base64String = FBase64::Encode(Value); + Base64String.ReplaceInline(TEXT("+"), TEXT("-")); + Base64String.ReplaceInline(TEXT("/"), TEXT("_")); + return Base64String; +} + +template +inline auto ToString(const T& Value) + -> typename std::enable_if::value, FString>::type +{ + return ::LexToString(Value); +} + +template +inline auto ToString(const T& EnumModelValue) + -> typename std::enable_if::value, FString>::type +{ + return T::EnumToString(EnumModelValue.Value); +} + +inline FString ToString(const Model& Value) +{ + FString String; + JsonWriter Writer = TJsonWriterFactory>::Create(&String); + Value.WriteJson(Writer); + Writer->Close(); + return String; +} + +inline FString ToString(const FDateTime& Value) +{ + return Value.ToIso8601(); +} + +inline FString ToString(const FGuid& Value) +{ + return Value.ToString(EGuidFormats::DigitsWithHyphens); +} + +inline FString ToString(const TArray& Value) +{ + return FBase64::Encode(Value); +} + +template +inline FString ToUrlString(const T& Value) +{ + return FPlatformHttp::UrlEncode(ToString(Value)); +} + +inline FString ToUrlString(const TArray& Value) +{ + return Base64UrlEncode(Value); +} + +template +inline FString CollectionToUrlString(const TArray& Collection, const TCHAR* Separator) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += ToUrlString(Collection[0]); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("{0}{1}"), { Separator, *ToUrlString(Collection[i]) }); + } + return Output; +} + +template +inline FString CollectionToUrlString_csv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(",")); +} + +template +inline FString CollectionToUrlString_ssv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(" ")); +} + +template +inline FString CollectionToUrlString_tsv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("\t")); +} + +template +inline FString CollectionToUrlString_pipes(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("|")); +} + +template +inline FString CollectionToUrlString_multi(const TArray& Collection, const TCHAR* BaseName) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += FString::Format(TEXT("{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[0]) }); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("&{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[i]) }); + } + return Output; +} + + +template +inline FString CollectionToUrlString_multi(const TSet& Collection, const TCHAR* BaseName) +{ + FString Output; + if (Collection.Num() == 0) + { + return Output; + } + + int32 Index = 0; + for (typename TSet::TConstIterator Iter = Collection.CreateConstIterator(); Iter; ++Iter) + { + if (Index == 0) + { + Output += FString::Format(TEXT("{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(*Iter) }); + Index++; + continue; + } + Output += FString::Format(TEXT("&{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(*Iter) }); + } + return Output; +} + +////////////////////////////////////////////////////////////////////////// + +inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr& Value) +{ + if (Value.IsValid()) + { + FJsonSerializer::Serialize(Value.ToSharedRef(), "", Writer, false); + } + else + { + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); + } +} + +inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr& Value) +{ + if (Value.IsValid()) + { + FJsonSerializer::Serialize(Value.ToSharedRef(), Writer, false); + } + else + { + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); + } +} + +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteValue(FBase64::Encode(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value) +{ + Writer->WriteValue(Value.ToIso8601()); +} + +inline void WriteJsonValue(JsonWriter& Writer, const FGuid& Value) +{ + Writer->WriteValue(Value.ToString(EGuidFormats::DigitsWithHyphens)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const Model& Value) +{ + Value.WriteJson(Writer); +} + +template::value, int>::type = 0> +inline void WriteJsonValue(JsonWriter& Writer, const T& Value) +{ + Writer->WriteValue(Value); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteArrayStart(); + for (const auto& Element : Value) + { + WriteJsonValue(Writer, Element); + } + Writer->WriteArrayEnd(); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TMap& Value) +{ + Writer->WriteObjectStart(); + for (const auto& It : Value) + { + Writer->WriteIdentifierPrefix(It.Key); + WriteJsonValue(Writer, It.Value); + } + Writer->WriteObjectEnd(); +} + +////////////////////////////////////////////////////////////////////////// + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FString& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +IMMUTABLEORDERBOOK_API bool ParseDateTime(const FString& DateTimeString, FDateTime& OutDateTime); + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FDateTime& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + return ParseDateTime(TmpValue, Value); + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FGuid& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + return FGuid::Parse(TmpValue, Value); + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, bool& Value) +{ + bool TmpValue; + if (JsonValue->TryGetBool(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSharedPtr& JsonObjectValue) +{ + JsonObjectValue = JsonValue; + return true; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSharedPtr& JsonObjectValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + JsonObjectValue = *Object; + return true; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + FBase64::Decode(TmpValue, Value); + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, Model& Value) +{ + return Value.FromJson(JsonValue); +} + +template::value, int>::type = 0> +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, T& Value) +{ + T TmpValue; + if (JsonValue->TryGetNumber(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& ArrayValue) +{ + const TArray>* JsonArray; + if (JsonValue->TryGetArray(JsonArray)) + { + bool ParseSuccess = true; + const int32 Count = JsonArray->Num(); + ArrayValue.Reset(Count); + for (int i = 0; i < Count; i++) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue((*JsonArray)[i], TmpValue); + ArrayValue.Emplace(MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TMap& MapValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + MapValue.Reset(); + bool ParseSuccess = true; + for (const auto& It : (*Object)->Values) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue(It.Value, TmpValue); + MapValue.Emplace(It.Key, MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, T& Value) +{ + const TSharedPtr JsonValue = JsonObject->TryGetField(Key); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + return TryGetJsonValue(JsonValue, Value); + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, TOptional& OptionalValue) +{ + const TSharedPtr JsonValue = JsonObject->TryGetField(Key); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + T Value; + if (TryGetJsonValue(JsonValue, Value)) + { + OptionalValue = Value; + return true; + } + else + return false; + } + // Absence of optional value is not a parsing error. + // Nullable is handled like optional. + return true; +} + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIItemType.h b/Source/Experimental/ImmutableOrderbook/Public/APIItemType.h new file mode 100644 index 0000000..c1b9b31 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIItemType.h @@ -0,0 +1,37 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIItemType + * + * + */ +class IMMUTABLEORDERBOOK_API APIItemType : public Model +{ +public: + virtual ~APIItemType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + // -- DIVERGE + uint8 Value; + // -- DIVERGE +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APINativeItem.h b/Source/Experimental/ImmutableOrderbook/Public/APINativeItem.h new file mode 100644 index 0000000..2580e10 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APINativeItem.h @@ -0,0 +1,43 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APINativeItem + * + * + */ +class IMMUTABLEORDERBOOK_API APINativeItem : public Model +{ +public: + virtual ~APINativeItem() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString Amount; + enum class TypeEnum + { + Native, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrder.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrder.h new file mode 100644 index 0000000..2fa0e79 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrder.h @@ -0,0 +1,67 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIFee.h" +#include "APIOrderChain.h" +#include "APIOrderFillStatus.h" +#include "APIOrderProtocolData.h" +#include "APIOrderStatus.h" +#include "APIPrepareListingRequestBuy.h" +#include "APIPrepareListingRequestSell.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrder + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrder : public Model +{ +public: + virtual ~APIOrder() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional AccountAddress; + TOptional> Buy; + TOptional Chain; + TOptional CreatedAt; + /* Time after which the Order is expired */ + TOptional EndAt; + TOptional> Fees; + TOptional FillStatus; + FString Id; + FString OrderHash; + TOptional ProtocolData; + TOptional Salt; + TArray Sell; + FString Signature; + /* Time after which the Order is considered active */ + FString StartAt; + APIOrderStatus Status; + enum class TypeEnum + { + Listing, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; + FString UpdatedAt; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderChain.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderChain.h new file mode 100644 index 0000000..98031bb --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderChain.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderChain + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderChain : public Model +{ +public: + virtual ~APIOrderChain() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional Name; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderComponents.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderComponents.h new file mode 100644 index 0000000..5d6713e --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderComponents.h @@ -0,0 +1,49 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrderComponentsConsiderationInner.h" +#include "APIOrderComponentsOfferInner.h" +#include "APIOrderType.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderComponents + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderComponents : public Model +{ +public: + virtual ~APIOrderComponents() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString ConduitKey; + TArray Consideration; + FString EndTime; + TArray Offer; + FString Offerer; + APIOrderType OrderType; + FString Salt; + FString StartTime; + FString TotalOriginalConsiderationItems; + FString Zone; + FString ZoneHash; + FString Counter; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderComponentsConsiderationInner.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderComponentsConsiderationInner.h new file mode 100644 index 0000000..effd6de --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderComponentsConsiderationInner.h @@ -0,0 +1,41 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIItemType.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderComponentsConsiderationInner + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderComponentsConsiderationInner : public Model +{ +public: + virtual ~APIOrderComponentsConsiderationInner() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString EndAmount; + FString IdentifierOrCriteria; + APIItemType ItemType; + FString Recipient; + FString StartAmount; + FString Token; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderComponentsOfferInner.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderComponentsOfferInner.h new file mode 100644 index 0000000..5b295bb --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderComponentsOfferInner.h @@ -0,0 +1,40 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIItemType.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderComponentsOfferInner + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderComponentsOfferInner : public Model +{ +public: + virtual ~APIOrderComponentsOfferInner() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString EndAmount; + FString IdentifierOrCriteria; + APIItemType ItemType; + FString StartAmount; + FString Token; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderFillStatus.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderFillStatus.h new file mode 100644 index 0000000..3baf736 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderFillStatus.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderFillStatus + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderFillStatus : public Model +{ +public: + virtual ~APIOrderFillStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Denominator; + TOptional Numerator; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderProtocolData.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderProtocolData.h new file mode 100644 index 0000000..44c8cca --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderProtocolData.h @@ -0,0 +1,47 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderProtocolData + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderProtocolData : public Model +{ +public: + virtual ~APIOrderProtocolData() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Counter; + enum class OrderTypeEnum + { + FullRestricted, + PartialRestricted, + }; + + static FString EnumToString(const OrderTypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, OrderTypeEnum& EnumValue); + TOptional OrderType; + TOptional SeaportAddress; + TOptional SeaportVersion; + TOptional ZoneAddress; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatus.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatus.h new file mode 100644 index 0000000..f4d7fdb --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatus.h @@ -0,0 +1,61 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICancellationType.h" +#include "APIOrderStatusOneOf.h" +#include "APIOrderStatusOneOf1.h" +#include "APIOrderStatusOneOf2.h" +#include "APIOrderStatusOneOf3.h" +#include "APIOrderStatusOneOf4.h" +#include "APIOrderStatusOneOf5.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderStatus + * + * The Order status + */ +class IMMUTABLEORDERBOOK_API APIOrderStatus : public Model +{ +public: + virtual ~APIOrderStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Pending, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* The order status that indicates the order is yet to be active due to various reasons. */ + TOptional Name; + TOptional CancellationType; + /* Whether the cancellation of the order is pending */ + TOptional Pending; + /* Whether the order offerer has sufficient approvals */ + TOptional SufficientApprovals; + /* Whether the order offerer still has sufficient balance to complete the order */ + TOptional SufficientBalances; + /* Whether the order has been evaluated after its creation */ + TOptional Evaluated; + /* Whether the order has reached its specified start time */ + TOptional Started; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf.h new file mode 100644 index 0000000..e9c6ffb --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf.h @@ -0,0 +1,43 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderStatusOneOf + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderStatusOneOf : public Model +{ +public: + virtual ~APIOrderStatusOneOf() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Active, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* The order status that indicates an order can be fulfilled. */ + TOptional Name; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf1.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf1.h new file mode 100644 index 0000000..bfc48dd --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf1.h @@ -0,0 +1,47 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICancellationType.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderStatusOneOf1 + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderStatusOneOf1 : public Model +{ +public: + virtual ~APIOrderStatusOneOf1() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional CancellationType; + enum class NameEnum + { + Cancelled, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* The order status indicating a order is has been cancelled or about to be cancelled. */ + TOptional Name; + /* Whether the cancellation of the order is pending */ + TOptional Pending; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf2.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf2.h new file mode 100644 index 0000000..10e0af1 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf2.h @@ -0,0 +1,43 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderStatusOneOf2 + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderStatusOneOf2 : public Model +{ +public: + virtual ~APIOrderStatusOneOf2() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Expired, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* A terminal order status indicating that an order cannot be fulfilled due to expiry. */ + TOptional Name; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf3.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf3.h new file mode 100644 index 0000000..f217852 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf3.h @@ -0,0 +1,43 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderStatusOneOf3 + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderStatusOneOf3 : public Model +{ +public: + virtual ~APIOrderStatusOneOf3() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Filled, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* A terminal order status indicating that an order has been fulfilled. */ + TOptional Name; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf4.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf4.h new file mode 100644 index 0000000..18a0787 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf4.h @@ -0,0 +1,47 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderStatusOneOf4 + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderStatusOneOf4 : public Model +{ +public: + virtual ~APIOrderStatusOneOf4() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Inactive, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* The order status that indicates an order cannot be fulfilled. */ + TOptional Name; + /* Whether the order offerer has sufficient approvals */ + TOptional SufficientApprovals; + /* Whether the order offerer still has sufficient balance to complete the order */ + TOptional SufficientBalances; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf5.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf5.h new file mode 100644 index 0000000..36fe272 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderStatusOneOf5.h @@ -0,0 +1,47 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderStatusOneOf5 + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderStatusOneOf5 : public Model +{ +public: + virtual ~APIOrderStatusOneOf5() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Whether the order has been evaluated after its creation */ + TOptional Evaluated; + enum class NameEnum + { + Pending, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* The order status that indicates the order is yet to be active due to various reasons. */ + TOptional Name; + /* Whether the order has reached its specified start time */ + TOptional Started; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderType.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderType.h new file mode 100644 index 0000000..ae81111 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderType.h @@ -0,0 +1,37 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIOrderType + * + * + */ +class IMMUTABLEORDERBOOK_API APIOrderType : public Model +{ +public: + virtual ~APIOrderType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + // -- DIVERGE + uint8 Value; + // -- DIVERGE +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderbookApi.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderbookApi.h new file mode 100644 index 0000000..27f0660 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderbookApi.h @@ -0,0 +1,91 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +class IMMUTABLEORDERBOOK_API APIOrderbookApi +{ +public: + APIOrderbookApi(); + ~APIOrderbookApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class CancelOrdersRequest; + class CancelOrdersResponse; + class CancelOrdersOnChainRequest; + class CancelOrdersOnChainResponse; + class CreateListingRequest; + class CreateListingResponse; + class FulfillOrderRequest; + class FulfillOrderResponse; + class PrepareListingRequest; + class PrepareListingResponse; + class PrepareOrderCancellationsRequest; + class PrepareOrderCancellationsResponse; + class TokenBalanceRequest; + class TokenBalanceResponse; + + DECLARE_DELEGATE_OneParam(FCancelOrdersDelegate, const CancelOrdersResponse&); + DECLARE_DELEGATE_OneParam(FCancelOrdersOnChainDelegate, const CancelOrdersOnChainResponse&); + DECLARE_DELEGATE_OneParam(FCreateListingDelegate, const CreateListingResponse&); + DECLARE_DELEGATE_OneParam(FFulfillOrderDelegate, const FulfillOrderResponse&); + DECLARE_DELEGATE_OneParam(FPrepareListingDelegate, const PrepareListingResponse&); + DECLARE_DELEGATE_OneParam(FPrepareOrderCancellationsDelegate, const PrepareOrderCancellationsResponse&); + DECLARE_DELEGATE_OneParam(FTokenBalanceDelegate, const TokenBalanceResponse&); + + FHttpRequestPtr CancelOrders(const CancelOrdersRequest& Request, const FCancelOrdersDelegate& Delegate = FCancelOrdersDelegate()) const; + FHttpRequestPtr CancelOrdersOnChain(const CancelOrdersOnChainRequest& Request, const FCancelOrdersOnChainDelegate& Delegate = FCancelOrdersOnChainDelegate()) const; + FHttpRequestPtr CreateListing(const CreateListingRequest& Request, const FCreateListingDelegate& Delegate = FCreateListingDelegate()) const; + FHttpRequestPtr FulfillOrder(const FulfillOrderRequest& Request, const FFulfillOrderDelegate& Delegate = FFulfillOrderDelegate()) const; + FHttpRequestPtr PrepareListing(const PrepareListingRequest& Request, const FPrepareListingDelegate& Delegate = FPrepareListingDelegate()) const; + FHttpRequestPtr PrepareOrderCancellations(const PrepareOrderCancellationsRequest& Request, const FPrepareOrderCancellationsDelegate& Delegate = FPrepareOrderCancellationsDelegate()) const; + FHttpRequestPtr TokenBalance(const TokenBalanceRequest& Request, const FTokenBalanceDelegate& Delegate = FTokenBalanceDelegate()) const; + +private: + void OnCancelOrdersResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelOrdersDelegate Delegate) const; + void OnCancelOrdersOnChainResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelOrdersOnChainDelegate Delegate) const; + void OnCreateListingResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateListingDelegate Delegate) const; + void OnFulfillOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFulfillOrderDelegate Delegate) const; + void OnPrepareListingResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPrepareListingDelegate Delegate) const; + void OnPrepareOrderCancellationsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPrepareOrderCancellationsDelegate Delegate) const; + void OnTokenBalanceResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FTokenBalanceDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIOrderbookApiOperations.h b/Source/Experimental/ImmutableOrderbook/Public/APIOrderbookApiOperations.h new file mode 100644 index 0000000..78a22fc --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIOrderbookApiOperations.h @@ -0,0 +1,197 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrderbookApi.h" + +#include "APICancelOrders200Response.h" +#include "APICancelOrdersOnChain200Response.h" +#include "APICancelOrdersOnChainRequest.h" +#include "APICancelOrdersRequest.h" +#include "APICreateListing200Response.h" +#include "APICreateListingRequest.h" +#include "APIFulfillOrder200Response.h" +#include "APIFulfillOrderRequest.h" +#include "APIPrepareListing200Response.h" +#include "APIPrepareListingRequest.h" +#include "APIPrepareOrderCancellations200Response.h" +#include "APIPrepareOrderCancellationsRequest.h" +#include "APITokenBalance200Response.h" + +namespace ImmutableOrderbook +{ + +/* + +*/ +class IMMUTABLEORDERBOOK_API APIOrderbookApi::CancelOrdersRequest : public Request +{ +public: + virtual ~CancelOrdersRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + TOptional APICancelOrdersRequest; +}; + +class IMMUTABLEORDERBOOK_API APIOrderbookApi::CancelOrdersResponse : public Response +{ +public: + virtual ~CancelOrdersResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APICancelOrders200Response Content; +}; + +/* + +*/ +class IMMUTABLEORDERBOOK_API APIOrderbookApi::CancelOrdersOnChainRequest : public Request +{ +public: + virtual ~CancelOrdersOnChainRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + TOptional APICancelOrdersOnChainRequest; +}; + +class IMMUTABLEORDERBOOK_API APIOrderbookApi::CancelOrdersOnChainResponse : public Response +{ +public: + virtual ~CancelOrdersOnChainResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APICancelOrdersOnChain200Response Content; +}; + +/* + +*/ +class IMMUTABLEORDERBOOK_API APIOrderbookApi::CreateListingRequest : public Request +{ +public: + virtual ~CreateListingRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + TOptional APICreateListingRequest; +}; + +class IMMUTABLEORDERBOOK_API APIOrderbookApi::CreateListingResponse : public Response +{ +public: + virtual ~CreateListingResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APICreateListing200Response Content; +}; + +/* + +*/ +class IMMUTABLEORDERBOOK_API APIOrderbookApi::FulfillOrderRequest : public Request +{ +public: + virtual ~FulfillOrderRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + TOptional APIFulfillOrderRequest; +}; + +class IMMUTABLEORDERBOOK_API APIOrderbookApi::FulfillOrderResponse : public Response +{ +public: + virtual ~FulfillOrderResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIFulfillOrder200Response Content; +}; + +/* + +*/ +class IMMUTABLEORDERBOOK_API APIOrderbookApi::PrepareListingRequest : public Request +{ +public: + virtual ~PrepareListingRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + TOptional APIPrepareListingRequest; +}; + +class IMMUTABLEORDERBOOK_API APIOrderbookApi::PrepareListingResponse : public Response +{ +public: + virtual ~PrepareListingResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIPrepareListing200Response Content; +}; + +/* + +*/ +class IMMUTABLEORDERBOOK_API APIOrderbookApi::PrepareOrderCancellationsRequest : public Request +{ +public: + virtual ~PrepareOrderCancellationsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + TOptional APIPrepareOrderCancellationsRequest; +}; + +class IMMUTABLEORDERBOOK_API APIOrderbookApi::PrepareOrderCancellationsResponse : public Response +{ +public: + virtual ~PrepareOrderCancellationsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIPrepareOrderCancellations200Response Content; +}; + +/* + +*/ +class IMMUTABLEORDERBOOK_API APIOrderbookApi::TokenBalanceRequest : public Request +{ +public: + virtual ~TokenBalanceRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString WalletAddress; + FString ContractAddress; +}; + +class IMMUTABLEORDERBOOK_API APIOrderbookApi::TokenBalanceResponse : public Response +{ +public: + virtual ~TokenBalanceResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APITokenBalance200Response Content; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListing200Response.h b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListing200Response.h new file mode 100644 index 0000000..65b41d0 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListing200Response.h @@ -0,0 +1,39 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIAction.h" +#include "APIOrderComponents.h" + +namespace ImmutableOrderbook +{ + +/* + * APIPrepareListing200Response + * + * Response schema for the prepareListing endpoint + */ +class IMMUTABLEORDERBOOK_API APIPrepareListing200Response : public Model +{ +public: + virtual ~APIPrepareListing200Response() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TArray Actions; + APIOrderComponents OrderComponents; + FString OrderHash; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListingRequest.h b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListingRequest.h new file mode 100644 index 0000000..be3925e --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListingRequest.h @@ -0,0 +1,40 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIPrepareListingRequestBuy.h" +#include "APIPrepareListingRequestSell.h" + +namespace ImmutableOrderbook +{ + +/* + * APIPrepareListingRequest + * + * + */ +class IMMUTABLEORDERBOOK_API APIPrepareListingRequest : public Model +{ +public: + virtual ~APIPrepareListingRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIPrepareListingRequestBuy Buy; + FString MakerAddress; + TOptional OrderExpiry; + APIPrepareListingRequestSell Sell; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListingRequestBuy.h b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListingRequestBuy.h new file mode 100644 index 0000000..5af5138 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListingRequestBuy.h @@ -0,0 +1,47 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIERC20Item.h" +#include "APINativeItem.h" + +namespace ImmutableOrderbook +{ + +/* + * APIPrepareListingRequestBuy + * + * + */ +class IMMUTABLEORDERBOOK_API APIPrepareListingRequestBuy : public Model +{ +public: + virtual ~APIPrepareListingRequestBuy() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString Amount; + FString ContractAddress; + enum class TypeEnum + { + ERC20, + Native, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListingRequestSell.h b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListingRequestSell.h new file mode 100644 index 0000000..f1b0def --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareListingRequestSell.h @@ -0,0 +1,50 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIERC1155Item.h" +#include "APIERC721Item.h" + +namespace ImmutableOrderbook +{ + +/* + * APIPrepareListingRequestSell + * + * + */ +class IMMUTABLEORDERBOOK_API APIPrepareListingRequestSell : public Model +{ +public: + virtual ~APIPrepareListingRequestSell() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + // -- DIVERGE + TOptional Amount; + // -- DIVERGE + FString ContractAddress; + FString TokenId; + enum class TypeEnum + { + ERC1155, + ERC721, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIPrepareOrderCancellations200Response.h b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareOrderCancellations200Response.h new file mode 100644 index 0000000..fd274cb --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareOrderCancellations200Response.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APISignableAction.h" + +namespace ImmutableOrderbook +{ + +/* + * APIPrepareOrderCancellations200Response + * + * Response schema for the prepareOrderCancellations endpoint + */ +class IMMUTABLEORDERBOOK_API APIPrepareOrderCancellations200Response : public Model +{ +public: + virtual ~APIPrepareOrderCancellations200Response() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional SignableAction; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIPrepareOrderCancellationsRequest.h b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareOrderCancellationsRequest.h new file mode 100644 index 0000000..69fbe22 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIPrepareOrderCancellationsRequest.h @@ -0,0 +1,35 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIPrepareOrderCancellationsRequest + * + * + */ +class IMMUTABLEORDERBOOK_API APIPrepareOrderCancellationsRequest : public Model +{ +public: + virtual ~APIPrepareOrderCancellationsRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TArray OrderIds; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APIRecordStringTypedDataFieldValueInner.h b/Source/Experimental/ImmutableOrderbook/Public/APIRecordStringTypedDataFieldValueInner.h new file mode 100644 index 0000000..73495e2 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APIRecordStringTypedDataFieldValueInner.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APIRecordStringTypedDataFieldValueInner + * + * + */ +class IMMUTABLEORDERBOOK_API APIRecordStringTypedDataFieldValueInner : public Model +{ +public: + virtual ~APIRecordStringTypedDataFieldValueInner() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString Name; + FString Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APISignableAction.h b/Source/Experimental/ImmutableOrderbook/Public/APISignableAction.h new file mode 100644 index 0000000..bac693a --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APISignableAction.h @@ -0,0 +1,46 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APISignableActionMessage.h" +#include "APISignablePurpose.h" + +namespace ImmutableOrderbook +{ + +/* + * APISignableAction + * + * + */ +class IMMUTABLEORDERBOOK_API APISignableAction : public Model +{ +public: + virtual ~APISignableAction() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Message; + TOptional Purpose; + enum class TypeEnum + { + Signable, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APISignableActionMessage.h b/Source/Experimental/ImmutableOrderbook/Public/APISignableActionMessage.h new file mode 100644 index 0000000..cd73ef7 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APISignableActionMessage.h @@ -0,0 +1,40 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIRecordStringTypedDataFieldValueInner.h" +#include "APITypedDataDomain.h" + +namespace ImmutableOrderbook +{ + +/* + * APISignableActionMessage + * + * + */ +class IMMUTABLEORDERBOOK_API APISignableActionMessage : public Model +{ +public: + virtual ~APISignableActionMessage() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Domain; + TOptional>> Types; + TOptional>> Message; + TOptional PrimaryType; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APISignablePurpose.h b/Source/Experimental/ImmutableOrderbook/Public/APISignablePurpose.h new file mode 100644 index 0000000..7bd973f --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APISignablePurpose.h @@ -0,0 +1,44 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APISignablePurpose + * + * + */ +class IMMUTABLEORDERBOOK_API APISignablePurpose : public Model +{ +public: + virtual ~APISignablePurpose() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + CreateListing, + OffChainCancellation, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APITokenBalance200Response.h b/Source/Experimental/ImmutableOrderbook/Public/APITokenBalance200Response.h new file mode 100644 index 0000000..37b761c --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APITokenBalance200Response.h @@ -0,0 +1,35 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APITokenBalance200Response + * + * The response body returned from get balance endpoint + */ +class IMMUTABLEORDERBOOK_API APITokenBalance200Response : public Model +{ +public: + virtual ~APITokenBalance200Response() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString Quantity; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APITransactionAction.h b/Source/Experimental/ImmutableOrderbook/Public/APITransactionAction.h new file mode 100644 index 0000000..863350e --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APITransactionAction.h @@ -0,0 +1,46 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APITransactionActionPopulatedTransactions.h" +#include "APITransactionPurpose.h" + +namespace ImmutableOrderbook +{ + +/* + * APITransactionAction + * + * + */ +class IMMUTABLEORDERBOOK_API APITransactionAction : public Model +{ +public: + virtual ~APITransactionAction() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional PopulatedTransactions; + TOptional Purpose; + enum class TypeEnum + { + Transaction, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + TypeEnum Type; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APITransactionActionPopulatedTransactions.h b/Source/Experimental/ImmutableOrderbook/Public/APITransactionActionPopulatedTransactions.h new file mode 100644 index 0000000..d993a42 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APITransactionActionPopulatedTransactions.h @@ -0,0 +1,49 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APITransactionActionPopulatedTransactionsAccessListInner.h" + +namespace ImmutableOrderbook +{ + +/* + * APITransactionActionPopulatedTransactions + * + * + */ +class IMMUTABLEORDERBOOK_API APITransactionActionPopulatedTransactions : public Model +{ +public: + virtual ~APITransactionActionPopulatedTransactions() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional To; + TOptional From; + TOptional Nonce; + TOptional GasLimit; + TOptional GasPrice; + TOptional Data; + TOptional Value; + TOptional ChainId; + TOptional Type; + TOptional> AccessList; + TOptional MaxFeePerGas; + TOptional MaxPriorityFeePerGas; + TOptional>> CustomData; + TOptional CcipReadEnabled; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APITransactionActionPopulatedTransactionsAccessListInner.h b/Source/Experimental/ImmutableOrderbook/Public/APITransactionActionPopulatedTransactionsAccessListInner.h new file mode 100644 index 0000000..810cf8f --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APITransactionActionPopulatedTransactionsAccessListInner.h @@ -0,0 +1,36 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APITransactionActionPopulatedTransactionsAccessListInner + * + * + */ +class IMMUTABLEORDERBOOK_API APITransactionActionPopulatedTransactionsAccessListInner : public Model +{ +public: + virtual ~APITransactionActionPopulatedTransactionsAccessListInner() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Address; + TOptional> StorageKeys; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APITransactionPurpose.h b/Source/Experimental/ImmutableOrderbook/Public/APITransactionPurpose.h new file mode 100644 index 0000000..b92310a --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APITransactionPurpose.h @@ -0,0 +1,45 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APITransactionPurpose + * + * + */ +class IMMUTABLEORDERBOOK_API APITransactionPurpose : public Model +{ +public: + virtual ~APITransactionPurpose() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + Approval, + FulfillOrder, + Cancel, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/Public/APITypedDataDomain.h b/Source/Experimental/ImmutableOrderbook/Public/APITypedDataDomain.h new file mode 100644 index 0000000..c04c856 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/Public/APITypedDataDomain.h @@ -0,0 +1,39 @@ +/** + * TS SDK API + * running ts sdk as an api + * + * OpenAPI spec version: 1.0.0 + * Contact: contact@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutableOrderbook +{ + +/* + * APITypedDataDomain + * + * + */ +class IMMUTABLEORDERBOOK_API APITypedDataDomain : public Model +{ +public: + virtual ~APITypedDataDomain() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional ChainId; + TOptional Name; + TOptional Salt; + TOptional VerifyingContract; + TOptional Version; +}; + +} diff --git a/Source/Experimental/ImmutableOrderbook/README.md b/Source/Experimental/ImmutableOrderbook/README.md new file mode 100644 index 0000000..5879fec --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/README.md @@ -0,0 +1,8 @@ +# Usage + +TO generate OpenAPI locally: + + ``` + openapi-generator-cli generate -i openapi.json -g cpp-ue4 -o . --additional-properties=modelNamePrefix="API",cppNamespace=ImmutableOrderbook,unrealModuleName=ImmutableOrderbook + + ``` \ No newline at end of file diff --git a/Source/Experimental/ImmutableOrderbook/openapi.json b/Source/Experimental/ImmutableOrderbook/openapi.json new file mode 100644 index 0000000..7743df9 --- /dev/null +++ b/Source/Experimental/ImmutableOrderbook/openapi.json @@ -0,0 +1,999 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "TS SDK API", + "description": "running ts sdk as an api", + "contact": { + "name": "Support", + "url": "https://immutable.com", + "email": "contact@immutable.com" + }, + "version": "1.0.0" + }, + "servers": [{ + "url": "https://api.immutable.com", + "description": "Production Server" + }, { + "url": "https://api.sandbox.immutable.com", + "description": "Sandbox Server" + }], + "tags": [{ + "name": "ts sdk api" + }], + "components": { + "schemas": { + "ERC1155Item": { + "properties": { + "amount": { + "type": "string" + }, + "contractAddress": { + "type": "string" + }, + "tokenId": { + "type": "string" + }, + "type": { + "enum": ["ERC1155"], + "type": "string" + } + }, + "required": ["amount", "contractAddress", "tokenId", "type"], + "type": "object" + }, + "ERC20Item": { + "properties": { + "amount": { + "type": "string" + }, + "contractAddress": { + "type": "string" + }, + "type": { + "enum": ["ERC20"], + "type": "string" + } + }, + "required": ["amount", "contractAddress", "type"], + "type": "object" + }, + "ERC721Item": { + "properties": { + "contractAddress": { + "type": "string" + }, + "tokenId": { + "type": "string" + }, + "type": { + "enum": ["ERC721"], + "type": "string" + } + }, + "required": ["contractAddress", "tokenId", "type"], + "type": "object" + }, + "NativeItem": { + "properties": { + "amount": { + "type": "string" + }, + "type": { + "enum": ["NATIVE"], + "type": "string" + } + }, + "required": ["amount", "type"], + "type": "object" + }, + "Action": { + "oneOf": [{ + "$ref": "#/components/schemas/TransactionAction" + }, { + "$ref": "#/components/schemas/SignableAction" + }] + }, + "BigNumber": { + "type": "string" + }, + "BytesLike": { + "type": "string" + }, + "ItemType": { + "enum": [0, 1, 2, 3, 4, 5], + "type": "number" + }, + "OrderComponents": { + "properties": { + "conduitKey": { + "type": "string" + }, + "consideration": { + "items": { + "properties": { + "endAmount": { + "type": "string" + }, + "identifierOrCriteria": { + "type": "string" + }, + "itemType": { + "$ref": "#/components/schemas/ItemType" + }, + "recipient": { + "type": "string" + }, + "startAmount": { + "type": "string" + }, + "token": { + "type": "string" + } + }, + "required": ["identifierOrCriteria", "itemType", "token", "startAmount", "endAmount", "recipient"], + "type": "object" + }, + "type": "array" + }, + "endTime": { + "type": "string" + }, + "offer": { + "items": { + "properties": { + "endAmount": { + "type": "string" + }, + "identifierOrCriteria": { + "type": "string" + }, + "itemType": { + "$ref": "#/components/schemas/ItemType" + }, + "startAmount": { + "type": "string" + }, + "token": { + "type": "string" + } + }, + "required": ["identifierOrCriteria", "itemType", "token", "startAmount", "endAmount"], + "type": "object" + }, + "type": "array" + }, + "offerer": { + "type": "string" + }, + "orderType": { + "$ref": "#/components/schemas/OrderType" + }, + "salt": { + "type": "string" + }, + "startTime": { + "type": "string" + }, + "totalOriginalConsiderationItems": { + "type": "string" + }, + "zone": { + "type": "string" + }, + "zoneHash": { + "type": "string" + }, + "counter": { + "type": "string" + } + }, + "type": "object", + "required": ["conduitKey", "consideration", "endTime", "offer", "offerer", "orderType", "salt", "startTime", "zone", "zoneHash", "counter", "totalOriginalConsiderationItems"] + }, + "OrderType": { + "enum": [0, 1, 2, 3], + "type": "number" + }, + "RecordStringTypedDataField": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": ["type", "name"] + } + } + }, + "RecordStringAny": { + "type": "object", + "additionalProperties": true + }, + "SignableAction": { + "properties": { + "message": { + "properties": { + "domain": { + "$ref": "#/components/schemas/TypedDataDomain" + }, + "types": { + "$ref": "#/components/schemas/RecordStringTypedDataField" + }, + "message": { + "$ref": "#/components/schemas/RecordStringAny" + }, + "primaryType": { + "type": "string" + } + }, + "type": "object" + }, + "purpose": { + "$ref": "#/components/schemas/SignablePurpose" + }, + "type": { + "enum": ["SIGNABLE"], + "type": "string" + } + }, + "type": "object", + "required": ["type"] + }, + "SignablePurpose": { + "enum": ["CREATE_LISTING", "OFF_CHAIN_CANCELLATION"], + "type": "string" + }, + "TransactionAction": { + "properties": { + "populatedTransactions": { + "type": "object", + "properties": { + "to": { + "type": "string" + }, + "from": { + "type": "string" + }, + "nonce": { + "type": "number" + }, + "gasLimit": { + "$ref": "#/components/schemas/BigNumber" + }, + "gasPrice": { + "$ref": "#/components/schemas/BigNumber" + }, + "data": { + "type": "string" + }, + "value": { + "$ref": "#/components/schemas/BigNumber" + }, + "chainId": { + "type": "number" + }, + "type": { + "type": "number" + }, + "accessList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "storageKeys": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "maxFeePerGas": { + "$ref": "#/components/schemas/BigNumber" + }, + "maxPriorityFeePerGas": { + "$ref": "#/components/schemas/BigNumber" + }, + "customData": { + "type": "object", + "additionalProperties": true + }, + "ccipReadEnabled": { + "type": "boolean" + } + } + }, + "purpose": { + "$ref": "#/components/schemas/TransactionPurpose" + }, + "type": { + "enum": ["TRANSACTION"], + "type": "string" + } + }, + "type": "object", + "required": ["type"] + }, + "TransactionPurpose": { + "enum": ["APPROVAL", "FULFILL_ORDER", "CANCEL"], + "type": "string" + }, + "TypedDataDomain": { + "properties": { + "chainId": { + "$ref": "#/components/schemas/BigNumber" + }, + "name": { + "type": "string" + }, + "salt": { + "type": "string" + }, + "verifyingContract": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, + "BigNumberish": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }], + "description": "Any type that can be used where a big number is needed." + }, + "FeeValue": { + "properties": { + "amount": { + "type": "string" + }, + "recipientAddress": { + "type": "string" + } + }, + "required": ["amount", "recipientAddress"], + "type": "object" + }, + "CancellationType": { + "description": "Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account", + "enum": ["ON_CHAIN", "OFF_CHAIN", "UNDERFUNDED"], + "type": "string" + }, + "Fee": { + "properties": { + "amount": { + "type": "string" + }, + "recipientAddress": { + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/FeeType" + } + }, + "type": "object" + }, + "FeeType": { + "enum": ["MAKER_ECOSYSTEM", "TAKER_ECOSYSTEM", "PROTOCOL", "ROYALTY"], + "type": "string" + }, + "Order": { + "properties": { + "accountAddress": { + "type": "string" + }, + "buy": { + "items": { + "oneOf": [{ + "$ref": "#/components/schemas/ERC20Item" + }, { + "$ref": "#/components/schemas/NativeItem" + }] + }, + "type": "array" + }, + "chain": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "createdAt": { + "type": "string" + }, + "endAt": { + "description": "Time after which the Order is expired", + "type": "string" + }, + "fees": { + "items": { + "$ref": "#/components/schemas/Fee" + }, + "type": "array" + }, + "fillStatus": { + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + }, + "type": "object" + }, + "id": { + "type": "string" + }, + "orderHash": { + "type": "string" + }, + "protocolData": { + "properties": { + "counter": { + "type": "string" + }, + "orderType": { + "enum": ["FULL_RESTRICTED", "PARTIAL_RESTRICTED"], + "type": "string" + }, + "seaportAddress": { + "type": "string" + }, + "seaportVersion": { + "type": "string" + }, + "zoneAddress": { + "type": "string" + } + }, + "type": "object" + }, + "salt": { + "type": "string" + }, + "sell": { + "items": { + "oneOf": [{ + "$ref": "#/components/schemas/ERC1155Item" + }, { + "$ref": "#/components/schemas/ERC721Item" + }] + }, + "type": "array" + }, + "signature": { + "type": "string" + }, + "startAt": { + "description": "Time after which the Order is considered active", + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/OrderStatus" + }, + "type": { + "enum": ["LISTING"], + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "type": "object", + "required": ["id", "orderHash", "updatedAt", "type", "sell", "signature", "startAt", "status"] + }, + "OrderStatus": { + "oneOf": [{ + "properties": { + "name": { + "enum": ["ACTIVE"], + "description": "The order status that indicates an order can be fulfilled.", + "type": "string" + } + }, + "type": "object" + }, { + "properties": { + "cancellation_type": { + "$ref": "#/components/schemas/CancellationType" + }, + "name": { + "enum": ["CANCELLED"], + "description": "The order status indicating a order is has been cancelled or about to be cancelled.", + "type": "string" + }, + "pending": { + "description": "Whether the cancellation of the order is pending", + "type": "boolean" + } + }, + "type": "object" + }, { + "properties": { + "name": { + "enum": ["EXPIRED"], + "description": "A terminal order status indicating that an order cannot be fulfilled due to expiry.", + "type": "string" + } + }, + "type": "object" + }, { + "properties": { + "name": { + "enum": ["FILLED"], + "description": "A terminal order status indicating that an order has been fulfilled.", + "type": "string" + } + }, + "type": "object" + }, { + "properties": { + "name": { + "enum": ["INACTIVE"], + "description": "The order status that indicates an order cannot be fulfilled.", + "type": "string" + }, + "sufficient_approvals": { + "description": "Whether the order offerer has sufficient approvals", + "type": "boolean" + }, + "sufficient_balances": { + "description": "Whether the order offerer still has sufficient balance to complete the order", + "type": "boolean" + } + }, + "type": "object" + }, { + "properties": { + "evaluated": { + "description": "Whether the order has been evaluated after its creation", + "type": "boolean" + }, + "name": { + "enum": ["PENDING"], + "description": "The order status that indicates the order is yet to be active due to various reasons.", + "type": "string" + }, + "started": { + "description": "Whether the order has reached its specified start time", + "type": "boolean" + } + }, + "type": "object" + }], + "description": "The Order status" + }, + "CancelledOrderStatusCancellationType": { + "description": "Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account", + "enum": ["ON_CHAIN", "OFF_CHAIN", "UNDERFUNDED"], + "type": "string" + } + } + }, + "paths": { + "/v1/ts-sdk/orderbook/cancelOrders": { + "post": { + "operationId": "cancelOrders", + "tags": ["orderbook"], + "responses": { + "200": { + "description": "Response schema for the cancelOrder endpoint", + "content": { + "application/json": { + "schema": { + "description": "Response schema for the cancelOrder endpoint", + "properties": { + "result": { + "properties": { + "failed_cancellations": { + "description": "Orders which failed to be cancelled", + "items": { + "properties": { + "order": { + "description": "ID of the order which failed to be cancelled", + "type": "string" + }, + "reason_code": { + "enum": ["FILLED"], + "description": "Reason code indicating why the order failed to be cancelled", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "pending_cancellations": { + "description": "Orders which are marked for cancellation but the cancellation cannot be guaranteed", + "items": { + "type": "string" + }, + "type": "array" + }, + "successful_cancellations": { + "description": "Orders which were successfully cancelled", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "orderIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "accountAddress": { + "type": "string" + }, + "signature": { + "type": "string" + } + }, + "required": ["orderIds", "accountAddress", "signature"] + } + } + } + } + } + }, + "/v1/ts-sdk/orderbook/cancelOrdersOnChain": { + "post": { + "operationId": "cancelOrdersOnChain", + "tags": ["orderbook"], + "responses": { + "200": { + "description": "Response schema for the cancelOrder endpoint", + "content": { + "application/json": { + "schema": { + "description": "Response schema for the cancelOrder endpoint", + "properties": { + "cancellationAction": { + "$ref": "#/components/schemas/TransactionAction" + } + }, + "type": "object" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "orderIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "accountAddress": { + "type": "string" + } + }, + "required": ["orderIds", "accountAddress"] + } + } + } + } + } + }, + "/v1/ts-sdk/orderbook/createListing": { + "post": { + "operationId": "createListing", + "tags": ["orderbook"], + "responses": { + "200": { + "description": "The response schema for the create listing endpoint", + "content": { + "application/json": { + "schema": { + "description": "The response schema for the create listing endpoint", + "properties": { + "result": { + "$ref": "#/components/schemas/Order" + } + }, + "type": "object" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "makerFees": { + "items": { + "$ref": "#/components/schemas/FeeValue" + }, + "type": "array" + }, + "orderComponents": { + "$ref": "#/components/schemas/OrderComponents" + }, + "orderHash": { + "type": "string" + }, + "orderSignature": { + "type": "string" + } + }, + "required": ["makerFees", "orderComponents", "orderHash", "orderSignature"], + "type": "object" + } + } + } + } + } + }, + "/v1/ts-sdk/orderbook/fulfillOrder": { + "post": { + "operationId": "fulfillOrder", + "tags": ["orderbook"], + "responses": { + "200": { + "description": "Response schema for the fulfillOrder endpoint", + "content": { + "application/json": { + "schema": { + "description": "Response schema for the fulfillOrder endpoint", + "properties": { + "actions": { + "items": { + "$ref": "#/components/schemas/TransactionAction" + }, + "type": "array" + }, + "expiration": { + "description": "User MUST submit the fulfillment transaction before the expiration\nSubmitting after the expiration will result in a on chain revert", + "type": "string" + }, + "order": { + "$ref": "#/components/schemas/Order" + } + }, + "type": "object" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "listingId": { + "type": "string", + "description": "listingId" + }, + "takerAddress": { + "type": "string", + "description": "takerAddress" + }, + "takerFees": { + "type": "array", + "items": { + "properties": { + "amount": { + "type": "string" + }, + "recipientAddress": { + "type": "string" + } + }, + "required": ["amount", "recipientAddress"], + "type": "object" + }, + "description": "takerFees" + }, + "amountToFill": { + "type": "string", + "description": "amountToFill" + } + }, + "required": ["listingId", "takerAddress", "takerFees"] + } + } + } + } + } + }, + "/v1/ts-sdk/orderbook/prepareListing": { + "post": { + "operationId": "prepareListing", + "tags": ["orderbook"], + "responses": { + "200": { + "description": "Response schema for the prepareListing endpoint", + "content": { + "application/json": { + "schema": { + "description": "Response schema for the prepareListing endpoint", + "properties": { + "actions": { + "items": { + "$ref": "#/components/schemas/Action" + }, + "type": "array" + }, + "orderComponents": { + "$ref": "#/components/schemas/OrderComponents" + }, + "orderHash": { + "type": "string" + } + }, + "required": ["actions", "orderComponents", "orderHash"], + "type": "object" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "buy": { + "oneOf": [{ + "$ref": "#/components/schemas/ERC20Item" + }, { + "$ref": "#/components/schemas/NativeItem" + }] + }, + "makerAddress": { + "type": "string" + }, + "orderExpiry": { + "format": "date-time", + "type": "string" + }, + "sell": { + "oneOf": [{ + "$ref": "#/components/schemas/ERC1155Item" + }, { + "$ref": "#/components/schemas/ERC721Item" + }] + } + }, + "type": "object", + "required": ["makerAddress", "buy", "sell"] + } + } + } + } + } + }, + "/v1/ts-sdk/orderbook/prepareOrderCancellations": { + "post": { + "operationId": "prepareOrderCancellations", + "tags": ["orderbook"], + "responses": { + "200": { + "description": "Response schema for the prepareOrderCancellations endpoint", + "content": { + "application/json": { + "schema": { + "description": "Response schema for the prepareOrderCancellations endpoint", + "properties": { + "signableAction": { + "$ref": "#/components/schemas/SignableAction" + } + }, + "type": "object" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "orderIds": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "required": ["orderIds"] + } + } + } + } + } + }, + "/v1/ts-sdk/token/balance": { + "get": { + "operationId": "tokenBalance", + "tags": ["orderbook"], + "parameters": [{ + "name": "wallet_address", + "in": "query", + "schema": { + "type": "string" + }, + "required": true + }, { + "name": "contract_address", + "in": "query", + "schema": { + "type": "string" + }, + "required": true + }], + "responses": { + "200": { + "description": "The response body returned from get balance endpoint", + "content": { + "application/json": { + "schema": { + "description": "The response body returned from get balance endpoint", + "type": "object", + "properties": { + "quantity": { + "type": "string" + } + }, + "required": ["quantity"] + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Source/Experimental/ImmutablezkEVMAPI/ImmutablezkEVMAPI.Build.cs b/Source/Experimental/ImmutablezkEVMAPI/ImmutablezkEVMAPI.Build.cs new file mode 100644 index 0000000..3072fd0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/ImmutablezkEVMAPI.Build.cs @@ -0,0 +1,31 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * 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 ImmutablezkEVMAPI : ModuleRules +{ + public ImmutablezkEVMAPI(ReadOnlyTargetRules Target) : base(Target) + { + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "HTTP", + "Json", + } + ); + PCHUsage = PCHUsageMode.NoPCHs; + } +} \ No newline at end of file diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError400.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError400.cpp new file mode 100644 index 0000000..38b46d6 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError400.cpp @@ -0,0 +1,104 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAPIError400.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAPIError400::CodeEnum& Value) +{ + switch (Value) + { + case APIAPIError400::CodeEnum::ValidationError: + return TEXT("VALIDATION_ERROR"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAPIError400::CodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAPIError400::EnumToString(const APIAPIError400::CodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAPIError400::CodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("VALIDATION_ERROR"), APIAPIError400::CodeEnum::ValidationError }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAPIError400::EnumFromString(const FString& EnumAsString, APIAPIError400::CodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAPIError400::CodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAPIError400::CodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAPIError400::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message); + Writer->WriteIdentifierPrefix(TEXT("link")); WriteJsonValue(Writer, Link); + Writer->WriteIdentifierPrefix(TEXT("trace_id")); WriteJsonValue(Writer, TraceId); + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code); + if (Details.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIAPIError400::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("link"), Link); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trace_id"), TraceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError401.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError401.cpp new file mode 100644 index 0000000..a3c1222 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError401.cpp @@ -0,0 +1,104 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAPIError401.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAPIError401::CodeEnum& Value) +{ + switch (Value) + { + case APIAPIError401::CodeEnum::UnauthorisedRequest: + return TEXT("UNAUTHORISED_REQUEST"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAPIError401::CodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAPIError401::EnumToString(const APIAPIError401::CodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAPIError401::CodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("UNAUTHORISED_REQUEST"), APIAPIError401::CodeEnum::UnauthorisedRequest }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAPIError401::EnumFromString(const FString& EnumAsString, APIAPIError401::CodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAPIError401::CodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAPIError401::CodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAPIError401::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message); + Writer->WriteIdentifierPrefix(TEXT("link")); WriteJsonValue(Writer, Link); + Writer->WriteIdentifierPrefix(TEXT("trace_id")); WriteJsonValue(Writer, TraceId); + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code); + if (Details.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIAPIError401::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("link"), Link); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trace_id"), TraceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError403.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError403.cpp new file mode 100644 index 0000000..88b3402 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError403.cpp @@ -0,0 +1,104 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAPIError403.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAPIError403::CodeEnum& Value) +{ + switch (Value) + { + case APIAPIError403::CodeEnum::AuthenticationError: + return TEXT("AUTHENTICATION_ERROR"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAPIError403::CodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAPIError403::EnumToString(const APIAPIError403::CodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAPIError403::CodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("AUTHENTICATION_ERROR"), APIAPIError403::CodeEnum::AuthenticationError }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAPIError403::EnumFromString(const FString& EnumAsString, APIAPIError403::CodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAPIError403::CodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAPIError403::CodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAPIError403::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message); + Writer->WriteIdentifierPrefix(TEXT("link")); WriteJsonValue(Writer, Link); + Writer->WriteIdentifierPrefix(TEXT("trace_id")); WriteJsonValue(Writer, TraceId); + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code); + if (Details.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIAPIError403::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("link"), Link); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trace_id"), TraceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError404.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError404.cpp new file mode 100644 index 0000000..d5a2b60 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError404.cpp @@ -0,0 +1,104 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAPIError404.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAPIError404::CodeEnum& Value) +{ + switch (Value) + { + case APIAPIError404::CodeEnum::ResourceNotFound: + return TEXT("RESOURCE_NOT_FOUND"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAPIError404::CodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAPIError404::EnumToString(const APIAPIError404::CodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAPIError404::CodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("RESOURCE_NOT_FOUND"), APIAPIError404::CodeEnum::ResourceNotFound }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAPIError404::EnumFromString(const FString& EnumAsString, APIAPIError404::CodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAPIError404::CodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAPIError404::CodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAPIError404::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message); + Writer->WriteIdentifierPrefix(TEXT("link")); WriteJsonValue(Writer, Link); + Writer->WriteIdentifierPrefix(TEXT("trace_id")); WriteJsonValue(Writer, TraceId); + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code); + if (Details.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIAPIError404::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("link"), Link); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trace_id"), TraceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError409.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError409.cpp new file mode 100644 index 0000000..63d7f10 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError409.cpp @@ -0,0 +1,104 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAPIError409.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAPIError409::CodeEnum& Value) +{ + switch (Value) + { + case APIAPIError409::CodeEnum::ConflictError: + return TEXT("CONFLICT_ERROR"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAPIError409::CodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAPIError409::EnumToString(const APIAPIError409::CodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAPIError409::CodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("CONFLICT_ERROR"), APIAPIError409::CodeEnum::ConflictError }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAPIError409::EnumFromString(const FString& EnumAsString, APIAPIError409::CodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAPIError409::CodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAPIError409::CodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAPIError409::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message); + Writer->WriteIdentifierPrefix(TEXT("link")); WriteJsonValue(Writer, Link); + Writer->WriteIdentifierPrefix(TEXT("trace_id")); WriteJsonValue(Writer, TraceId); + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code); + if (Details.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIAPIError409::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("link"), Link); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trace_id"), TraceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError429.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError429.cpp new file mode 100644 index 0000000..14f2b56 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError429.cpp @@ -0,0 +1,104 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAPIError429.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAPIError429::CodeEnum& Value) +{ + switch (Value) + { + case APIAPIError429::CodeEnum::TooManyRequestsError: + return TEXT("TOO_MANY_REQUESTS_ERROR"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAPIError429::CodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAPIError429::EnumToString(const APIAPIError429::CodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAPIError429::CodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("TOO_MANY_REQUESTS_ERROR"), APIAPIError429::CodeEnum::TooManyRequestsError }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAPIError429::EnumFromString(const FString& EnumAsString, APIAPIError429::CodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAPIError429::CodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAPIError429::CodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAPIError429::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message); + Writer->WriteIdentifierPrefix(TEXT("link")); WriteJsonValue(Writer, Link); + Writer->WriteIdentifierPrefix(TEXT("trace_id")); WriteJsonValue(Writer, TraceId); + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code); + if (Details.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIAPIError429::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("link"), Link); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trace_id"), TraceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError500.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError500.cpp new file mode 100644 index 0000000..99a10e8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError500.cpp @@ -0,0 +1,104 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAPIError500.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAPIError500::CodeEnum& Value) +{ + switch (Value) + { + case APIAPIError500::CodeEnum::InternalServerError: + return TEXT("INTERNAL_SERVER_ERROR"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAPIError500::CodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAPIError500::EnumToString(const APIAPIError500::CodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAPIError500::CodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("INTERNAL_SERVER_ERROR"), APIAPIError500::CodeEnum::InternalServerError }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAPIError500::EnumFromString(const FString& EnumAsString, APIAPIError500::CodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAPIError500::CodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAPIError500::CodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAPIError500::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message); + Writer->WriteIdentifierPrefix(TEXT("link")); WriteJsonValue(Writer, Link); + Writer->WriteIdentifierPrefix(TEXT("trace_id")); WriteJsonValue(Writer, TraceId); + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code); + if (Details.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIAPIError500::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("link"), Link); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trace_id"), TraceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError501.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError501.cpp new file mode 100644 index 0000000..050fa37 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAPIError501.cpp @@ -0,0 +1,104 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAPIError501.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAPIError501::CodeEnum& Value) +{ + switch (Value) + { + case APIAPIError501::CodeEnum::NotImplementedError: + return TEXT("NOT_IMPLEMENTED_ERROR"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAPIError501::CodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAPIError501::EnumToString(const APIAPIError501::CodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAPIError501::CodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("NOT_IMPLEMENTED_ERROR"), APIAPIError501::CodeEnum::NotImplementedError }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAPIError501::EnumFromString(const FString& EnumAsString, APIAPIError501::CodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAPIError501::CodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAPIError501::CodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAPIError501::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message); + Writer->WriteIdentifierPrefix(TEXT("link")); WriteJsonValue(Writer, Link); + Writer->WriteIdentifierPrefix(TEXT("trace_id")); WriteJsonValue(Writer, TraceId); + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code); + if (Details.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIAPIError501::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("link"), Link); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trace_id"), TraceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActiveOrderStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActiveOrderStatus.cpp new file mode 100644 index 0000000..ed28f74 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActiveOrderStatus.cpp @@ -0,0 +1,93 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActiveOrderStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIActiveOrderStatus::NameEnum& Value) +{ + switch (Value) + { + case APIActiveOrderStatus::NameEnum::Active: + return TEXT("ACTIVE"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIActiveOrderStatus::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIActiveOrderStatus::EnumToString(const APIActiveOrderStatus::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIActiveOrderStatus::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ACTIVE"), APIActiveOrderStatus::NameEnum::Active }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIActiveOrderStatus::EnumFromString(const FString& EnumAsString, APIActiveOrderStatus::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIActiveOrderStatus::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIActiveOrderStatus::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIActiveOrderStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteObjectEnd(); +} + +bool APIActiveOrderStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivitiesApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivitiesApi.cpp new file mode 100644 index 0000000..2de93b0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivitiesApi.cpp @@ -0,0 +1,217 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActivitiesApi.h" + +#include "APIActivitiesApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APIActivitiesApi::APIActivitiesApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APIActivitiesApi::~APIActivitiesApi() {} + +void APIActivitiesApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APIActivitiesApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APIActivitiesApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APIActivitiesApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APIActivitiesApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APIActivitiesApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APIActivitiesApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APIActivitiesApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APIActivitiesApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APIActivitiesApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APIActivitiesApi::GetActivity(const GetActivityRequest& Request, const FGetActivityDelegate& Delegate /*= FGetActivityDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIActivitiesApi::OnGetActivityResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIActivitiesApi::OnGetActivityResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetActivityDelegate Delegate) const +{ + GetActivityResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIActivitiesApi::ListActivities(const ListActivitiesRequest& Request, const FListActivitiesDelegate& Delegate /*= FListActivitiesDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIActivitiesApi::OnListActivitiesResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIActivitiesApi::OnListActivitiesResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListActivitiesDelegate Delegate) const +{ + ListActivitiesResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIActivitiesApi::ListActivityHistory(const ListActivityHistoryRequest& Request, const FListActivityHistoryDelegate& Delegate /*= FListActivityHistoryDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIActivitiesApi::OnListActivityHistoryResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIActivitiesApi::OnListActivityHistoryResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListActivityHistoryDelegate Delegate) const +{ + ListActivityHistoryResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivitiesApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivitiesApiOperations.cpp new file mode 100644 index 0000000..93f394c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivitiesApiOperations.cpp @@ -0,0 +1,216 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActivitiesApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APIActivitiesApi::GetActivityRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("activity_id"), FStringFormatArg(ToUrlString(ActivityId)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/activities/{activity_id}"), PathParams); + + return Path; +} + +void APIActivitiesApi::GetActivityRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIActivitiesApi::GetActivityResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIActivitiesApi::GetActivityResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIActivitiesApi::ListActivitiesRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/activities"), PathParams); + + TArray QueryParams; + if(ContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("contract_address=")) + ToUrlString(ContractAddress.GetValue())); + } + if(TokenId.IsSet()) + { + QueryParams.Add(FString(TEXT("token_id=")) + ToUrlString(TokenId.GetValue())); + } + if(AccountAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("account_address=")) + ToUrlString(AccountAddress.GetValue())); + } + if(ActivityType.IsSet()) + { + QueryParams.Add(FString(TEXT("activity_type=")) + ToUrlString(ActivityType.GetValue())); + } + if(TransactionHash.IsSet()) + { + QueryParams.Add(FString(TEXT("transaction_hash=")) + ToUrlString(TransactionHash.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIActivitiesApi::ListActivitiesRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIActivitiesApi::ListActivitiesResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIActivitiesApi::ListActivitiesResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIActivitiesApi::ListActivityHistoryRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/activity-history"), PathParams); + + TArray QueryParams; + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt)); + if(ToUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("to_updated_at=")) + ToUrlString(ToUpdatedAt.GetValue())); + } + if(ContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("contract_address=")) + ToUrlString(ContractAddress.GetValue())); + } + if(ActivityType.IsSet()) + { + QueryParams.Add(FString(TEXT("activity_type=")) + ToUrlString(ActivityType.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIActivitiesApi::ListActivityHistoryRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIActivitiesApi::ListActivityHistoryResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIActivitiesApi::ListActivityHistoryResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivity.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivity.cpp new file mode 100644 index 0000000..1420738 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivity.cpp @@ -0,0 +1,58 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActivity.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIActivity::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + Writer->WriteIdentifierPrefix(TEXT("indexed_at")); WriteJsonValue(Writer, IndexedAt); + if (BlockchainMetadata.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("blockchain_metadata")); WriteJsonValue(Writer, BlockchainMetadata.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIActivity::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("indexed_at"), IndexedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("blockchain_metadata"), BlockchainMetadata); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityAsset.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityAsset.cpp new file mode 100644 index 0000000..0be72ca --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityAsset.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActivityAsset.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIActivityAsset::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteObjectEnd(); +} + +bool APIActivityAsset::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityDetails.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityDetails.cpp new file mode 100644 index 0000000..225379f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityDetails.cpp @@ -0,0 +1,53 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActivityDetails.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIActivityDetails::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("to")); WriteJsonValue(Writer, To); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("asset")); WriteJsonValue(Writer, Asset); + Writer->WriteIdentifierPrefix(TEXT("from")); WriteJsonValue(Writer, From); + Writer->WriteIdentifierPrefix(TEXT("order_id")); WriteJsonValue(Writer, OrderId); + Writer->WriteIdentifierPrefix(TEXT("payment")); WriteJsonValue(Writer, Payment); + Writer->WriteObjectEnd(); +} + +bool APIActivityDetails::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("to"), To); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("asset"), Asset); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("from"), From); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_id"), OrderId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("payment"), Payment); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityNFT.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityNFT.cpp new file mode 100644 index 0000000..bdf5fdd --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityNFT.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActivityNFT.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIActivityNFT::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteObjectEnd(); +} + +bool APIActivityNFT::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityNativeToken.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityNativeToken.cpp new file mode 100644 index 0000000..9821d11 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityNativeToken.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActivityNativeToken.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIActivityNativeToken::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol); + Writer->WriteObjectEnd(); +} + +bool APIActivityNativeToken::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityToken.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityToken.cpp new file mode 100644 index 0000000..c0af2f3 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityToken.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActivityToken.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIActivityToken::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteObjectEnd(); +} + +bool APIActivityToken::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityType.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityType.cpp new file mode 100644 index 0000000..70f264d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIActivityType.cpp @@ -0,0 +1,98 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIActivityType.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIActivityType::Values& Value) +{ + switch (Value) + { + case APIActivityType::Values::Mint: + return TEXT("mint"); + case APIActivityType::Values::Burn: + return TEXT("burn"); + case APIActivityType::Values::Transfer: + return TEXT("transfer"); + case APIActivityType::Values::Sale: + return TEXT("sale"); + case APIActivityType::Values::Deposit: + return TEXT("deposit"); + case APIActivityType::Values::Withdrawal: + return TEXT("withdrawal"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIActivityType::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIActivityType::EnumToString(const APIActivityType::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIActivityType::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("mint"), APIActivityType::Values::Mint }, + { TEXT("burn"), APIActivityType::Values::Burn }, + { TEXT("transfer"), APIActivityType::Values::Transfer }, + { TEXT("sale"), APIActivityType::Values::Sale }, + { TEXT("deposit"), APIActivityType::Values::Deposit }, + { TEXT("withdrawal"), APIActivityType::Values::Withdrawal }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIActivityType::EnumFromString(const FString& EnumAsString, APIActivityType::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIActivityType::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIActivityType::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIActivityType::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIActivityType::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAssetCollectionItem.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAssetCollectionItem.cpp new file mode 100644 index 0000000..3328839 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAssetCollectionItem.cpp @@ -0,0 +1,100 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAssetCollectionItem.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAssetCollectionItem::TypeEnum& Value) +{ + switch (Value) + { + case APIAssetCollectionItem::TypeEnum::ERC721COLLECTION: + return TEXT("ERC721_COLLECTION"); + case APIAssetCollectionItem::TypeEnum::ERC1155COLLECTION: + return TEXT("ERC1155_COLLECTION"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAssetCollectionItem::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAssetCollectionItem::EnumToString(const APIAssetCollectionItem::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAssetCollectionItem::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC721_COLLECTION"), APIAssetCollectionItem::TypeEnum::ERC721COLLECTION }, + { TEXT("ERC1155_COLLECTION"), APIAssetCollectionItem::TypeEnum::ERC1155COLLECTION }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAssetCollectionItem::EnumFromString(const FString& EnumAsString, APIAssetCollectionItem::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAssetCollectionItem::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAssetCollectionItem::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAssetCollectionItem::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteObjectEnd(); +} + +bool APIAssetCollectionItem::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIAssetVerificationStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAssetVerificationStatus.cpp new file mode 100644 index 0000000..a5ca2e9 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIAssetVerificationStatus.cpp @@ -0,0 +1,92 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIAssetVerificationStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIAssetVerificationStatus::Values& Value) +{ + switch (Value) + { + case APIAssetVerificationStatus::Values::Verified: + return TEXT("verified"); + case APIAssetVerificationStatus::Values::Unverified: + return TEXT("unverified"); + case APIAssetVerificationStatus::Values::Spam: + return TEXT("spam"); + case APIAssetVerificationStatus::Values::Inactive: + return TEXT("inactive"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIAssetVerificationStatus::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIAssetVerificationStatus::EnumToString(const APIAssetVerificationStatus::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIAssetVerificationStatus::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("verified"), APIAssetVerificationStatus::Values::Verified }, + { TEXT("unverified"), APIAssetVerificationStatus::Values::Unverified }, + { TEXT("spam"), APIAssetVerificationStatus::Values::Spam }, + { TEXT("inactive"), APIAssetVerificationStatus::Values::Inactive }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIAssetVerificationStatus::EnumFromString(const FString& EnumAsString, APIAssetVerificationStatus::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIAssetVerificationStatus::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIAssetVerificationStatus::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIAssetVerificationStatus::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIAssetVerificationStatus::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIBaseModel.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBaseModel.cpp new file mode 100644 index 0000000..0754c07 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBaseModel.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * 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 ImmutablezkEVMAPI +{ + +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")); + } +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIBasicAPIError.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBasicAPIError.cpp new file mode 100644 index 0000000..eece7b7 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBasicAPIError.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIBasicAPIError.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIBasicAPIError::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message); + Writer->WriteIdentifierPrefix(TEXT("link")); WriteJsonValue(Writer, Link); + Writer->WriteIdentifierPrefix(TEXT("trace_id")); WriteJsonValue(Writer, TraceId); + Writer->WriteObjectEnd(); +} + +bool APIBasicAPIError::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("link"), Link); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trace_id"), TraceId); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIBidResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBidResult.cpp new file mode 100644 index 0000000..5993e75 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBidResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIBidResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIBidResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIBidResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIBlockchainMetadata.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBlockchainMetadata.cpp new file mode 100644 index 0000000..525d70a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBlockchainMetadata.cpp @@ -0,0 +1,52 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIBlockchainMetadata.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIBlockchainMetadata::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("transaction_hash")); WriteJsonValue(Writer, TransactionHash); + Writer->WriteIdentifierPrefix(TEXT("block_number")); WriteJsonValue(Writer, BlockNumber); + Writer->WriteIdentifierPrefix(TEXT("transaction_index")); WriteJsonValue(Writer, TransactionIndex); + if (LogIndex.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("log_index")); WriteJsonValue(Writer, LogIndex.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIBlockchainMetadata::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("transaction_hash"), TransactionHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("block_number"), BlockNumber); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("transaction_index"), TransactionIndex); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("log_index"), LogIndex); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIBurn.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBurn.cpp new file mode 100644 index 0000000..44813f5 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIBurn.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIBurn.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIBurn::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("from")); WriteJsonValue(Writer, From); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("asset")); WriteJsonValue(Writer, Asset); + Writer->WriteObjectEnd(); +} + +bool APIBurn::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("from"), From); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("asset"), Asset); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICall.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICall.cpp new file mode 100644 index 0000000..f03361c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICall.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICall.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICall::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("target_address")); WriteJsonValue(Writer, TargetAddress); + Writer->WriteIdentifierPrefix(TEXT("function_signature")); WriteJsonValue(Writer, FunctionSignature); + Writer->WriteIdentifierPrefix(TEXT("function_args")); WriteJsonValue(Writer, FunctionArgs); + Writer->WriteObjectEnd(); +} + +bool APICall::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("target_address"), TargetAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("function_signature"), FunctionSignature); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("function_args"), FunctionArgs); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelOrdersRequestBody.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelOrdersRequestBody.cpp new file mode 100644 index 0000000..39f7da4 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelOrdersRequestBody.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancelOrdersRequestBody.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICancelOrdersRequestBody::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("account_address")); WriteJsonValue(Writer, AccountAddress); + Writer->WriteIdentifierPrefix(TEXT("orders")); WriteJsonValue(Writer, Orders); + Writer->WriteIdentifierPrefix(TEXT("signature")); WriteJsonValue(Writer, Signature); + Writer->WriteObjectEnd(); +} + +bool APICancelOrdersRequestBody::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("account_address"), AccountAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("orders"), Orders); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signature"), Signature); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelOrdersResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelOrdersResult.cpp new file mode 100644 index 0000000..8c0dfef --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelOrdersResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancelOrdersResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICancelOrdersResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APICancelOrdersResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelOrdersResultData.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelOrdersResultData.cpp new file mode 100644 index 0000000..80090a9 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelOrdersResultData.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancelOrdersResultData.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICancelOrdersResultData::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("successful_cancellations")); WriteJsonValue(Writer, SuccessfulCancellations); + Writer->WriteIdentifierPrefix(TEXT("pending_cancellations")); WriteJsonValue(Writer, PendingCancellations); + Writer->WriteIdentifierPrefix(TEXT("failed_cancellations")); WriteJsonValue(Writer, FailedCancellations); + Writer->WriteObjectEnd(); +} + +bool APICancelOrdersResultData::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("successful_cancellations"), SuccessfulCancellations); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("pending_cancellations"), PendingCancellations); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("failed_cancellations"), FailedCancellations); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelledOrderStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelledOrderStatus.cpp new file mode 100644 index 0000000..a48c6f8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICancelledOrderStatus.cpp @@ -0,0 +1,153 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICancelledOrderStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APICancelledOrderStatus::NameEnum& Value) +{ + switch (Value) + { + case APICancelledOrderStatus::NameEnum::Cancelled: + return TEXT("CANCELLED"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APICancelledOrderStatus::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APICancelledOrderStatus::EnumToString(const APICancelledOrderStatus::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APICancelledOrderStatus::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("CANCELLED"), APICancelledOrderStatus::NameEnum::Cancelled }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APICancelledOrderStatus::EnumFromString(const FString& EnumAsString, APICancelledOrderStatus::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APICancelledOrderStatus::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APICancelledOrderStatus::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +inline FString ToString(const APICancelledOrderStatus::CancellationTypeEnum& Value) +{ + switch (Value) + { + case APICancelledOrderStatus::CancellationTypeEnum::OnChain: + return TEXT("ON_CHAIN"); + case APICancelledOrderStatus::CancellationTypeEnum::OffChain: + return TEXT("OFF_CHAIN"); + case APICancelledOrderStatus::CancellationTypeEnum::Underfunded: + return TEXT("UNDERFUNDED"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APICancelledOrderStatus::CancellationTypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APICancelledOrderStatus::EnumToString(const APICancelledOrderStatus::CancellationTypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APICancelledOrderStatus::CancellationTypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ON_CHAIN"), APICancelledOrderStatus::CancellationTypeEnum::OnChain }, + { TEXT("OFF_CHAIN"), APICancelledOrderStatus::CancellationTypeEnum::OffChain }, + { TEXT("UNDERFUNDED"), APICancelledOrderStatus::CancellationTypeEnum::Underfunded }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APICancelledOrderStatus::EnumFromString(const FString& EnumAsString, APICancelledOrderStatus::CancellationTypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APICancelledOrderStatus::CancellationTypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APICancelledOrderStatus::CancellationTypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APICancelledOrderStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteIdentifierPrefix(TEXT("pending")); WriteJsonValue(Writer, Pending); + Writer->WriteIdentifierPrefix(TEXT("cancellation_type")); WriteJsonValue(Writer, CancellationType); + Writer->WriteObjectEnd(); +} + +bool APICancelledOrderStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("pending"), Pending); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("cancellation_type"), CancellationType); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIChain.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIChain.cpp new file mode 100644 index 0000000..09529c0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIChain.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIChain.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIChain::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteObjectEnd(); +} + +bool APIChain::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIChainWithDetails.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIChainWithDetails.cpp new file mode 100644 index 0000000..0b7da6a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIChainWithDetails.cpp @@ -0,0 +1,50 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIChainWithDetails.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIChainWithDetails::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + if (RpcUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("rpc_url")); WriteJsonValue(Writer, RpcUrl.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIChainWithDetails::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("rpc_url"), RpcUrl); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIChainsApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIChainsApi.cpp new file mode 100644 index 0000000..be2f30d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIChainsApi.cpp @@ -0,0 +1,163 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIChainsApi.h" + +#include "APIChainsApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APIChainsApi::APIChainsApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APIChainsApi::~APIChainsApi() {} + +void APIChainsApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APIChainsApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APIChainsApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APIChainsApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APIChainsApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APIChainsApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APIChainsApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APIChainsApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APIChainsApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APIChainsApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APIChainsApi::ListChains(const ListChainsRequest& Request, const FListChainsDelegate& Delegate /*= FListChainsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIChainsApi::OnListChainsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIChainsApi::OnListChainsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListChainsDelegate Delegate) const +{ + ListChainsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIChainsApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIChainsApiOperations.cpp new file mode 100644 index 0000000..290ffd2 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIChainsApiOperations.cpp @@ -0,0 +1,78 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIChainsApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APIChainsApi::ListChainsRequest::ComputePath() const +{ + FString Path(TEXT("/v1/chains")); + TArray QueryParams; + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIChainsApi::ListChainsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIChainsApi::ListChainsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIChainsApi::ListChainsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICollection.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollection.cpp new file mode 100644 index 0000000..2e7aa65 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollection.cpp @@ -0,0 +1,93 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICollection.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICollection::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Symbol.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalLink.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_link")); WriteJsonValue(Writer, ExternalLink.GetValue()); + } + if (ContractUri.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("contract_uri")); WriteJsonValue(Writer, ContractUri.GetValue()); + } + if (BaseUri.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("base_uri")); WriteJsonValue(Writer, BaseUri.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("verification_status")); WriteJsonValue(Writer, VerificationStatus); + Writer->WriteIdentifierPrefix(TEXT("indexed_at")); WriteJsonValue(Writer, IndexedAt); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + if (MetadataSyncedAt.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("metadata_synced_at")); WriteJsonValue(Writer, MetadataSyncedAt.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APICollection::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_link"), ExternalLink); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_uri"), ContractUri); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("base_uri"), BaseUri); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("verification_status"), VerificationStatus); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("indexed_at"), IndexedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("metadata_synced_at"), MetadataSyncedAt); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionBidResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionBidResult.cpp new file mode 100644 index 0000000..e75347e --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionBidResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICollectionBidResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICollectionBidResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APICollectionBidResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionContractType.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionContractType.cpp new file mode 100644 index 0000000..a90cb41 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionContractType.cpp @@ -0,0 +1,86 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICollectionContractType.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APICollectionContractType::Values& Value) +{ + switch (Value) + { + case APICollectionContractType::Values::ERC721: + return TEXT("ERC721"); + case APICollectionContractType::Values::ERC1155: + return TEXT("ERC1155"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APICollectionContractType::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APICollectionContractType::EnumToString(const APICollectionContractType::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APICollectionContractType::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC721"), APICollectionContractType::Values::ERC721 }, + { TEXT("ERC1155"), APICollectionContractType::Values::ERC1155 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APICollectionContractType::EnumFromString(const FString& EnumAsString, APICollectionContractType::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APICollectionContractType::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APICollectionContractType::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APICollectionContractType::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APICollectionContractType::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionMetadata.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionMetadata.cpp new file mode 100644 index 0000000..1cf3abd --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionMetadata.cpp @@ -0,0 +1,76 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICollectionMetadata.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICollectionMetadata::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Symbol.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalLink.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_link")); WriteJsonValue(Writer, ExternalLink.GetValue()); + } + if (ContractUri.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("contract_uri")); WriteJsonValue(Writer, ContractUri.GetValue()); + } + if (BaseUri.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("base_uri")); WriteJsonValue(Writer, BaseUri.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APICollectionMetadata::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_link"), ExternalLink); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_uri"), ContractUri); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("base_uri"), BaseUri); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionsApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionsApi.cpp new file mode 100644 index 0000000..131e35b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionsApi.cpp @@ -0,0 +1,244 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICollectionsApi.h" + +#include "APICollectionsApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APICollectionsApi::APICollectionsApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APICollectionsApi::~APICollectionsApi() {} + +void APICollectionsApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APICollectionsApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APICollectionsApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APICollectionsApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APICollectionsApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APICollectionsApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APICollectionsApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APICollectionsApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APICollectionsApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APICollectionsApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APICollectionsApi::GetCollection(const GetCollectionRequest& Request, const FGetCollectionDelegate& Delegate /*= FGetCollectionDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APICollectionsApi::OnGetCollectionResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APICollectionsApi::OnGetCollectionResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCollectionDelegate Delegate) const +{ + GetCollectionResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APICollectionsApi::ListCollections(const ListCollectionsRequest& Request, const FListCollectionsDelegate& Delegate /*= FListCollectionsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APICollectionsApi::OnListCollectionsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APICollectionsApi::OnListCollectionsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListCollectionsDelegate Delegate) const +{ + ListCollectionsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APICollectionsApi::ListCollectionsByNFTOwner(const ListCollectionsByNFTOwnerRequest& Request, const FListCollectionsByNFTOwnerDelegate& Delegate /*= FListCollectionsByNFTOwnerDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APICollectionsApi::OnListCollectionsByNFTOwnerResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APICollectionsApi::OnListCollectionsByNFTOwnerResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListCollectionsByNFTOwnerDelegate Delegate) const +{ + ListCollectionsByNFTOwnerResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APICollectionsApi::RefreshCollectionMetadata(const RefreshCollectionMetadataRequest& Request, const FRefreshCollectionMetadataDelegate& Delegate /*= FRefreshCollectionMetadataDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APICollectionsApi::OnRefreshCollectionMetadataResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APICollectionsApi::OnRefreshCollectionMetadataResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshCollectionMetadataDelegate Delegate) const +{ + RefreshCollectionMetadataResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionsApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionsApiOperations.cpp new file mode 100644 index 0000000..db6c51d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICollectionsApiOperations.cpp @@ -0,0 +1,272 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICollectionsApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APICollectionsApi::GetCollectionRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}"), PathParams); + + return Path; +} + +void APICollectionsApi::GetCollectionRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APICollectionsApi::GetCollectionResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APICollectionsApi::GetCollectionResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APICollectionsApi::ListCollectionsRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections"), PathParams); + + TArray QueryParams; + if(ContractAddress.IsSet()) + { + QueryParams.Add(CollectionToUrlString_multi(ContractAddress.GetValue(), TEXT("contract_address"))); + } + if(VerificationStatus.IsSet()) + { + QueryParams.Add(CollectionToUrlString_multi(VerificationStatus.GetValue(), TEXT("verification_status"))); + } + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APICollectionsApi::ListCollectionsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APICollectionsApi::ListCollectionsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APICollectionsApi::ListCollectionsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APICollectionsApi::ListCollectionsByNFTOwnerRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("account_address"), FStringFormatArg(ToUrlString(AccountAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/accounts/{account_address}/collections"), PathParams); + + TArray QueryParams; + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APICollectionsApi::ListCollectionsByNFTOwnerRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APICollectionsApi::ListCollectionsByNFTOwnerResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APICollectionsApi::ListCollectionsByNFTOwnerResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APICollectionsApi::RefreshCollectionMetadataRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/refresh-metadata"), PathParams); + + return Path; +} + +void APICollectionsApi::RefreshCollectionMetadataRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APIRefreshCollectionMetadataRequest); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APIRefreshCollectionMetadataRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APIRefreshCollectionMetadataRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APICollectionsApi::RefreshCollectionMetadataResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APICollectionsApi::RefreshCollectionMetadataResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICraftingApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICraftingApi.cpp new file mode 100644 index 0000000..bde5bcc --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICraftingApi.cpp @@ -0,0 +1,163 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICraftingApi.h" + +#include "APICraftingApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APICraftingApi::APICraftingApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APICraftingApi::~APICraftingApi() {} + +void APICraftingApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APICraftingApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APICraftingApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APICraftingApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APICraftingApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APICraftingApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APICraftingApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APICraftingApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APICraftingApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APICraftingApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APICraftingApi::SignCraftingPayload(const SignCraftingPayloadRequest& Request, const FSignCraftingPayloadDelegate& Delegate /*= FSignCraftingPayloadDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APICraftingApi::OnSignCraftingPayloadResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APICraftingApi::OnSignCraftingPayloadResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSignCraftingPayloadDelegate Delegate) const +{ + SignCraftingPayloadResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICraftingApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICraftingApiOperations.cpp new file mode 100644 index 0000000..f75654f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICraftingApiOperations.cpp @@ -0,0 +1,101 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICraftingApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APICraftingApi::SignCraftingPayloadRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/crafting/sign"), PathParams); + + return Path; +} + +void APICraftingApi::SignCraftingPayloadRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APISignCraftingRequest); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APISignCraftingRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APISignCraftingRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APICraftingApi::SignCraftingPayloadResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APICraftingApi::SignCraftingPayloadResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateBidRequestBody.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateBidRequestBody.cpp new file mode 100644 index 0000000..3dd759a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateBidRequestBody.cpp @@ -0,0 +1,61 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICreateBidRequestBody.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICreateBidRequestBody::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("account_address")); WriteJsonValue(Writer, AccountAddress); + Writer->WriteIdentifierPrefix(TEXT("order_hash")); WriteJsonValue(Writer, OrderHash); + Writer->WriteIdentifierPrefix(TEXT("buy")); WriteJsonValue(Writer, Buy); + Writer->WriteIdentifierPrefix(TEXT("fees")); WriteJsonValue(Writer, Fees); + Writer->WriteIdentifierPrefix(TEXT("end_at")); WriteJsonValue(Writer, EndAt); + Writer->WriteIdentifierPrefix(TEXT("protocol_data")); WriteJsonValue(Writer, ProtocolData); + Writer->WriteIdentifierPrefix(TEXT("salt")); WriteJsonValue(Writer, Salt); + Writer->WriteIdentifierPrefix(TEXT("sell")); WriteJsonValue(Writer, Sell); + Writer->WriteIdentifierPrefix(TEXT("signature")); WriteJsonValue(Writer, Signature); + Writer->WriteIdentifierPrefix(TEXT("start_at")); WriteJsonValue(Writer, StartAt); + Writer->WriteObjectEnd(); +} + +bool APICreateBidRequestBody::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("account_address"), AccountAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_hash"), OrderHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("buy"), Buy); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fees"), Fees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("end_at"), EndAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("protocol_data"), ProtocolData); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("salt"), Salt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sell"), Sell); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signature"), Signature); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("start_at"), StartAt); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateCollectionBidRequestBody.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateCollectionBidRequestBody.cpp new file mode 100644 index 0000000..de6850a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateCollectionBidRequestBody.cpp @@ -0,0 +1,61 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICreateCollectionBidRequestBody.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICreateCollectionBidRequestBody::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("account_address")); WriteJsonValue(Writer, AccountAddress); + Writer->WriteIdentifierPrefix(TEXT("order_hash")); WriteJsonValue(Writer, OrderHash); + Writer->WriteIdentifierPrefix(TEXT("buy")); WriteJsonValue(Writer, Buy); + Writer->WriteIdentifierPrefix(TEXT("fees")); WriteJsonValue(Writer, Fees); + Writer->WriteIdentifierPrefix(TEXT("end_at")); WriteJsonValue(Writer, EndAt); + Writer->WriteIdentifierPrefix(TEXT("protocol_data")); WriteJsonValue(Writer, ProtocolData); + Writer->WriteIdentifierPrefix(TEXT("salt")); WriteJsonValue(Writer, Salt); + Writer->WriteIdentifierPrefix(TEXT("sell")); WriteJsonValue(Writer, Sell); + Writer->WriteIdentifierPrefix(TEXT("signature")); WriteJsonValue(Writer, Signature); + Writer->WriteIdentifierPrefix(TEXT("start_at")); WriteJsonValue(Writer, StartAt); + Writer->WriteObjectEnd(); +} + +bool APICreateCollectionBidRequestBody::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("account_address"), AccountAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_hash"), OrderHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("buy"), Buy); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fees"), Fees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("end_at"), EndAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("protocol_data"), ProtocolData); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("salt"), Salt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sell"), Sell); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signature"), Signature); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("start_at"), StartAt); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateListingRequestBody.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateListingRequestBody.cpp new file mode 100644 index 0000000..31d50fa --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateListingRequestBody.cpp @@ -0,0 +1,61 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICreateListingRequestBody.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICreateListingRequestBody::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("account_address")); WriteJsonValue(Writer, AccountAddress); + Writer->WriteIdentifierPrefix(TEXT("order_hash")); WriteJsonValue(Writer, OrderHash); + Writer->WriteIdentifierPrefix(TEXT("buy")); WriteJsonValue(Writer, Buy); + Writer->WriteIdentifierPrefix(TEXT("fees")); WriteJsonValue(Writer, Fees); + Writer->WriteIdentifierPrefix(TEXT("end_at")); WriteJsonValue(Writer, EndAt); + Writer->WriteIdentifierPrefix(TEXT("protocol_data")); WriteJsonValue(Writer, ProtocolData); + Writer->WriteIdentifierPrefix(TEXT("salt")); WriteJsonValue(Writer, Salt); + Writer->WriteIdentifierPrefix(TEXT("sell")); WriteJsonValue(Writer, Sell); + Writer->WriteIdentifierPrefix(TEXT("signature")); WriteJsonValue(Writer, Signature); + Writer->WriteIdentifierPrefix(TEXT("start_at")); WriteJsonValue(Writer, StartAt); + Writer->WriteObjectEnd(); +} + +bool APICreateListingRequestBody::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("account_address"), AccountAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_hash"), OrderHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("buy"), Buy); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fees"), Fees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("end_at"), EndAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("protocol_data"), ProtocolData); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("salt"), Salt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sell"), Sell); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signature"), Signature); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("start_at"), StartAt); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateMintRequestRequest.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateMintRequestRequest.cpp new file mode 100644 index 0000000..43a0893 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateMintRequestRequest.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICreateMintRequestRequest.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICreateMintRequestRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("assets")); WriteJsonValue(Writer, Assets); + Writer->WriteObjectEnd(); +} + +bool APICreateMintRequestRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("assets"), Assets); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateMintRequestResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateMintRequestResult.cpp new file mode 100644 index 0000000..5f68acb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APICreateMintRequestResult.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APICreateMintRequestResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APICreateMintRequestResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("imx_mint_requests_limit")); WriteJsonValue(Writer, ImxMintRequestsLimit); + Writer->WriteIdentifierPrefix(TEXT("imx_mint_requests_limit_reset")); WriteJsonValue(Writer, ImxMintRequestsLimitReset); + Writer->WriteIdentifierPrefix(TEXT("imx_remaining_mint_requests")); WriteJsonValue(Writer, ImxRemainingMintRequests); + Writer->WriteIdentifierPrefix(TEXT("imx_mint_requests_retry_after")); WriteJsonValue(Writer, ImxMintRequestsRetryAfter); + Writer->WriteObjectEnd(); +} + +bool APICreateMintRequestResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("imx_mint_requests_limit"), ImxMintRequestsLimit); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("imx_mint_requests_limit_reset"), ImxMintRequestsLimitReset); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("imx_remaining_mint_requests"), ImxRemainingMintRequests); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("imx_mint_requests_retry_after"), ImxMintRequestsRetryAfter); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIDeposit.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIDeposit.cpp new file mode 100644 index 0000000..e426c1a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIDeposit.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIDeposit.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIDeposit::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("to")); WriteJsonValue(Writer, To); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("asset")); WriteJsonValue(Writer, Asset); + Writer->WriteObjectEnd(); +} + +bool APIDeposit::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("to"), To); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("asset"), Asset); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC1155CollectionItem.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC1155CollectionItem.cpp new file mode 100644 index 0000000..d620d08 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC1155CollectionItem.cpp @@ -0,0 +1,97 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIERC1155CollectionItem.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIERC1155CollectionItem::TypeEnum& Value) +{ + switch (Value) + { + case APIERC1155CollectionItem::TypeEnum::ERC1155COLLECTION: + return TEXT("ERC1155_COLLECTION"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIERC1155CollectionItem::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIERC1155CollectionItem::EnumToString(const APIERC1155CollectionItem::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIERC1155CollectionItem::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC1155_COLLECTION"), APIERC1155CollectionItem::TypeEnum::ERC1155COLLECTION }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIERC1155CollectionItem::EnumFromString(const FString& EnumAsString, APIERC1155CollectionItem::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIERC1155CollectionItem::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIERC1155CollectionItem::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIERC1155CollectionItem::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteObjectEnd(); +} + +bool APIERC1155CollectionItem::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC1155Item.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC1155Item.cpp new file mode 100644 index 0000000..3a50c5c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC1155Item.cpp @@ -0,0 +1,99 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIERC1155Item.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIERC1155Item::TypeEnum& Value) +{ + switch (Value) + { + case APIERC1155Item::TypeEnum::ERC1155: + return TEXT("ERC1155"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIERC1155Item::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIERC1155Item::EnumToString(const APIERC1155Item::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIERC1155Item::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC1155"), APIERC1155Item::TypeEnum::ERC1155 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIERC1155Item::EnumFromString(const FString& EnumAsString, APIERC1155Item::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIERC1155Item::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIERC1155Item::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIERC1155Item::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteObjectEnd(); +} + +bool APIERC1155Item::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC20Item.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC20Item.cpp new file mode 100644 index 0000000..92e56d5 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC20Item.cpp @@ -0,0 +1,97 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIERC20Item.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIERC20Item::TypeEnum& Value) +{ + switch (Value) + { + case APIERC20Item::TypeEnum::ERC20: + return TEXT("ERC20"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIERC20Item::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIERC20Item::EnumToString(const APIERC20Item::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIERC20Item::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC20"), APIERC20Item::TypeEnum::ERC20 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIERC20Item::EnumFromString(const FString& EnumAsString, APIERC20Item::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIERC20Item::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIERC20Item::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIERC20Item::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteObjectEnd(); +} + +bool APIERC20Item::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC721CollectionItem.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC721CollectionItem.cpp new file mode 100644 index 0000000..2bef8c5 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC721CollectionItem.cpp @@ -0,0 +1,97 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIERC721CollectionItem.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIERC721CollectionItem::TypeEnum& Value) +{ + switch (Value) + { + case APIERC721CollectionItem::TypeEnum::ERC721COLLECTION: + return TEXT("ERC721_COLLECTION"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIERC721CollectionItem::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIERC721CollectionItem::EnumToString(const APIERC721CollectionItem::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIERC721CollectionItem::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC721_COLLECTION"), APIERC721CollectionItem::TypeEnum::ERC721COLLECTION }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIERC721CollectionItem::EnumFromString(const FString& EnumAsString, APIERC721CollectionItem::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIERC721CollectionItem::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIERC721CollectionItem::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIERC721CollectionItem::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteObjectEnd(); +} + +bool APIERC721CollectionItem::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC721Item.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC721Item.cpp new file mode 100644 index 0000000..d2a30f6 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIERC721Item.cpp @@ -0,0 +1,97 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIERC721Item.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIERC721Item::TypeEnum& Value) +{ + switch (Value) + { + case APIERC721Item::TypeEnum::ERC721: + return TEXT("ERC721"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIERC721Item::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIERC721Item::EnumToString(const APIERC721Item::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIERC721Item::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC721"), APIERC721Item::TypeEnum::ERC721 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIERC721Item::EnumFromString(const FString& EnumAsString, APIERC721Item::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIERC721Item::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIERC721Item::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIERC721Item::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteObjectEnd(); +} + +bool APIERC721Item::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIExpiredOrderStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIExpiredOrderStatus.cpp new file mode 100644 index 0000000..18e22bf --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIExpiredOrderStatus.cpp @@ -0,0 +1,93 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIExpiredOrderStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIExpiredOrderStatus::NameEnum& Value) +{ + switch (Value) + { + case APIExpiredOrderStatus::NameEnum::Expired: + return TEXT("EXPIRED"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIExpiredOrderStatus::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIExpiredOrderStatus::EnumToString(const APIExpiredOrderStatus::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIExpiredOrderStatus::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("EXPIRED"), APIExpiredOrderStatus::NameEnum::Expired }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIExpiredOrderStatus::EnumFromString(const FString& EnumAsString, APIExpiredOrderStatus::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIExpiredOrderStatus::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIExpiredOrderStatus::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIExpiredOrderStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteObjectEnd(); +} + +bool APIExpiredOrderStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIFailedOrderCancellation.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFailedOrderCancellation.cpp new file mode 100644 index 0000000..e789cf7 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFailedOrderCancellation.cpp @@ -0,0 +1,95 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFailedOrderCancellation.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIFailedOrderCancellation::ReasonCodeEnum& Value) +{ + switch (Value) + { + case APIFailedOrderCancellation::ReasonCodeEnum::Filled: + return TEXT("FILLED"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIFailedOrderCancellation::ReasonCodeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIFailedOrderCancellation::EnumToString(const APIFailedOrderCancellation::ReasonCodeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIFailedOrderCancellation::ReasonCodeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("FILLED"), APIFailedOrderCancellation::ReasonCodeEnum::Filled }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIFailedOrderCancellation::EnumFromString(const FString& EnumAsString, APIFailedOrderCancellation::ReasonCodeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIFailedOrderCancellation::ReasonCodeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIFailedOrderCancellation::ReasonCodeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIFailedOrderCancellation::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("order")); WriteJsonValue(Writer, Order); + Writer->WriteIdentifierPrefix(TEXT("reason_code")); WriteJsonValue(Writer, ReasonCode); + Writer->WriteObjectEnd(); +} + +bool APIFailedOrderCancellation::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order"), Order); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("reason_code"), ReasonCode); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIFee.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFee.cpp new file mode 100644 index 0000000..3bcc3b9 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFee.cpp @@ -0,0 +1,106 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFee.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIFee::TypeEnum& Value) +{ + switch (Value) + { + case APIFee::TypeEnum::Royalty: + return TEXT("ROYALTY"); + case APIFee::TypeEnum::MakerEcosystem: + return TEXT("MAKER_ECOSYSTEM"); + case APIFee::TypeEnum::TakerEcosystem: + return TEXT("TAKER_ECOSYSTEM"); + case APIFee::TypeEnum::Protocol: + return TEXT("PROTOCOL"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIFee::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIFee::EnumToString(const APIFee::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIFee::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ROYALTY"), APIFee::TypeEnum::Royalty }, + { TEXT("MAKER_ECOSYSTEM"), APIFee::TypeEnum::MakerEcosystem }, + { TEXT("TAKER_ECOSYSTEM"), APIFee::TypeEnum::TakerEcosystem }, + { TEXT("PROTOCOL"), APIFee::TypeEnum::Protocol }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIFee::EnumFromString(const FString& EnumAsString, APIFee::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIFee::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIFee::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIFee::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("recipient_address")); WriteJsonValue(Writer, RecipientAddress); + Writer->WriteObjectEnd(); +} + +bool APIFee::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("recipient_address"), RecipientAddress); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIFillStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFillStatus.cpp new file mode 100644 index 0000000..4312b11 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFillStatus.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFillStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIFillStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("numerator")); WriteJsonValue(Writer, Numerator); + Writer->WriteIdentifierPrefix(TEXT("denominator")); WriteJsonValue(Writer, Denominator); + Writer->WriteObjectEnd(); +} + +bool APIFillStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("numerator"), Numerator); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("denominator"), Denominator); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIFilledOrderStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFilledOrderStatus.cpp new file mode 100644 index 0000000..31b30ff --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFilledOrderStatus.cpp @@ -0,0 +1,93 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFilledOrderStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIFilledOrderStatus::NameEnum& Value) +{ + switch (Value) + { + case APIFilledOrderStatus::NameEnum::Filled: + return TEXT("FILLED"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIFilledOrderStatus::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIFilledOrderStatus::EnumToString(const APIFilledOrderStatus::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIFilledOrderStatus::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("FILLED"), APIFilledOrderStatus::NameEnum::Filled }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIFilledOrderStatus::EnumFromString(const FString& EnumAsString, APIFilledOrderStatus::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIFilledOrderStatus::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIFilledOrderStatus::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIFilledOrderStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteObjectEnd(); +} + +bool APIFilledOrderStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillableOrder.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillableOrder.cpp new file mode 100644 index 0000000..b255b73 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillableOrder.cpp @@ -0,0 +1,50 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFulfillableOrder.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIFulfillableOrder::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("order")); WriteJsonValue(Writer, Order); + if (TokenId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("extra_data")); WriteJsonValue(Writer, ExtraData); + Writer->WriteObjectEnd(); +} + +bool APIFulfillableOrder::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order"), Order); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("extra_data"), ExtraData); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillmentData200Response.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillmentData200Response.cpp new file mode 100644 index 0000000..c25ce4d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillmentData200Response.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFulfillmentData200Response.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIFulfillmentData200Response::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIFulfillmentData200Response::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillmentData200ResponseResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillmentData200ResponseResult.cpp new file mode 100644 index 0000000..7bd243c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillmentData200ResponseResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFulfillmentData200ResponseResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIFulfillmentData200ResponseResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("fulfillable_orders")); WriteJsonValue(Writer, FulfillableOrders); + Writer->WriteIdentifierPrefix(TEXT("unfulfillable_orders")); WriteJsonValue(Writer, UnfulfillableOrders); + Writer->WriteObjectEnd(); +} + +bool APIFulfillmentData200ResponseResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fulfillable_orders"), FulfillableOrders); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("unfulfillable_orders"), UnfulfillableOrders); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillmentDataRequest.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillmentDataRequest.cpp new file mode 100644 index 0000000..32faaeb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIFulfillmentDataRequest.cpp @@ -0,0 +1,52 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIFulfillmentDataRequest.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIFulfillmentDataRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("order_id")); WriteJsonValue(Writer, OrderId); + Writer->WriteIdentifierPrefix(TEXT("taker_address")); WriteJsonValue(Writer, TakerAddress); + Writer->WriteIdentifierPrefix(TEXT("fees")); WriteJsonValue(Writer, Fees); + if (TokenId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIFulfillmentDataRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_id"), OrderId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("taker_address"), TakerAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fees"), Fees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetActivityResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetActivityResult.cpp new file mode 100644 index 0000000..e4d508e --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetActivityResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIGetActivityResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIGetActivityResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIGetActivityResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetCollectionResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetCollectionResult.cpp new file mode 100644 index 0000000..c09c3ef --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetCollectionResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIGetCollectionResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIGetCollectionResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIGetCollectionResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetLinkedAddressesRes.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetLinkedAddressesRes.cpp new file mode 100644 index 0000000..18c2305 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetLinkedAddressesRes.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIGetLinkedAddressesRes.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIGetLinkedAddressesRes::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("linked_addresses")); WriteJsonValue(Writer, LinkedAddresses); + Writer->WriteObjectEnd(); +} + +bool APIGetLinkedAddressesRes::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("linked_addresses"), LinkedAddresses); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetMetadataResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetMetadataResult.cpp new file mode 100644 index 0000000..9d256ad --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetMetadataResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIGetMetadataResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIGetMetadataResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIGetMetadataResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetMintRequestResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetMintRequestResult.cpp new file mode 100644 index 0000000..f32b95c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetMintRequestResult.cpp @@ -0,0 +1,80 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIGetMintRequestResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIGetMintRequestResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("collection_address")); WriteJsonValue(Writer, CollectionAddress); + Writer->WriteIdentifierPrefix(TEXT("reference_id")); WriteJsonValue(Writer, ReferenceId); + Writer->WriteIdentifierPrefix(TEXT("owner_address")); WriteJsonValue(Writer, OwnerAddress); + if (TokenId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId.GetValue()); + } + if (Amount.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount.GetValue()); + } + if (ActivityId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("activity_id")); WriteJsonValue(Writer, ActivityId.GetValue()); + } + if (TransactionHash.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("transaction_hash")); WriteJsonValue(Writer, TransactionHash.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("created_at")); WriteJsonValue(Writer, CreatedAt); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + if (Error.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("error")); WriteJsonValue(Writer, Error.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("status")); WriteJsonValue(Writer, Status); + Writer->WriteObjectEnd(); +} + +bool APIGetMintRequestResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("collection_address"), CollectionAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("reference_id"), ReferenceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("owner_address"), OwnerAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("activity_id"), ActivityId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("transaction_hash"), TransactionHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_at"), CreatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("error"), Error); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("status"), Status); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetNFTResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetNFTResult.cpp new file mode 100644 index 0000000..c0bcec3 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetNFTResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIGetNFTResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIGetNFTResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIGetNFTResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetTokenResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetTokenResult.cpp new file mode 100644 index 0000000..37241a8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIGetTokenResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIGetTokenResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIGetTokenResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIGetTokenResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIHelpers.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIHelpers.cpp new file mode 100644 index 0000000..1adb4cd --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIHelpers.cpp @@ -0,0 +1,233 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIHelpers.h" + +#include "ImmutablezkEVMAPIModule.h" + +#include "Interfaces/IHttpRequest.h" +#include "PlatformHttp.h" +#include "Misc/FileHelper.h" +#include "Misc/Paths.h" + +namespace ImmutablezkEVMAPI +{ + +HttpFileInput::HttpFileInput(const TCHAR* InFilePath) +{ + SetFilePath(InFilePath); +} + +HttpFileInput::HttpFileInput(const FString& InFilePath) +{ + SetFilePath(InFilePath); +} + +void HttpFileInput::SetFilePath(const TCHAR* InFilePath) +{ + FilePath = InFilePath; + if(ContentType.IsEmpty()) + { + ContentType = FPlatformHttp::GetMimeType(InFilePath); + } +} + +void HttpFileInput::SetFilePath(const FString& InFilePath) +{ + SetFilePath(*InFilePath); +} + +void HttpFileInput::SetContentType(const TCHAR* InContentType) +{ + ContentType = InContentType; +} + +FString HttpFileInput::GetFilename() const +{ + return FPaths::GetCleanFilename(FilePath); +} + +////////////////////////////////////////////////////////////////////////// + +const TCHAR* HttpMultipartFormData::Delimiter = TEXT("--"); +const TCHAR* HttpMultipartFormData::Newline = TEXT("\r\n"); + +void HttpMultipartFormData::SetBoundary(const TCHAR* InBoundary) +{ + checkf(Boundary.IsEmpty(), TEXT("Boundary must be set before usage")); + Boundary = InBoundary; +} + +const FString& HttpMultipartFormData::GetBoundary() const +{ + if (Boundary.IsEmpty()) + { + // Generate a random boundary with enough entropy, should avoid occurrences of the boundary in the data. + // Since the boundary is generated at every request, in case of failure, retries should succeed. + Boundary = FGuid::NewGuid().ToString(EGuidFormats::Short); + } + + return Boundary; +} + +void HttpMultipartFormData::SetupHttpRequest(const FHttpRequestRef& HttpRequest) +{ + if(HttpRequest->GetVerb() != TEXT("POST")) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Expected POST verb when using multipart form data")); + } + + // Append final boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Delimiter); + + HttpRequest->SetHeader("Content-Type", FString::Printf(TEXT("multipart/form-data; boundary=%s"), *GetBoundary())); + HttpRequest->SetContent(FormData); +} + +void HttpMultipartFormData::AddStringPart(const TCHAR* Name, const TCHAR* Data) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name = \"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: text/plain; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(Data); + AppendString(Newline); +} + +void HttpMultipartFormData::AddJsonPart(const TCHAR* Name, const FString& JsonString) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/json; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(*JsonString); + AppendString(Newline); +} + +void HttpMultipartFormData::AddBinaryPart(const TCHAR* Name, const TArray& ByteArray) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/octet-stream"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(ByteArray); + AppendString(Newline); +} + +void HttpMultipartFormData::AddFilePart(const TCHAR* Name, const HttpFileInput& File) +{ + TArray FileContents; + if (!FFileHelper::LoadFileToArray(FileContents, *File.GetFilePath())) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to load file (%s)"), *File.GetFilePath()); + return; + } + + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\"; filename=\"%s\""), Name, *File.GetFilename())); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: %s"), *File.GetContentType())); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(FileContents); + AppendString(Newline); +} + +void HttpMultipartFormData::AppendString(const TCHAR* Str) +{ + FTCHARToUTF8 utf8Str(Str); + FormData.Append((uint8*)utf8Str.Get(), utf8Str.Length()); +} + +////////////////////////////////////////////////////////////////////////// + +bool ParseDateTime(const FString& DateTimeString, FDateTime& OutDateTime) +{ + // Iso8601 Format: DateTime: YYYY-mm-ddTHH:MM:SS(.sss)(Z|+hh:mm|+hhmm|-hh:mm|-hhmm) + { + // We cannot call directly FDateTime::ParseIso8601 because it does not allow for precision beyond the millisecond, but DateTimeString might have more digits + int32 DotIndex; + FString StringToParse = DateTimeString; + if (DateTimeString.FindChar('.', DotIndex)) + { + int32 TimeZoneIndex; + if (DateTimeString.FindChar('Z', TimeZoneIndex) || DateTimeString.FindChar('+', TimeZoneIndex) || DateTimeString.FindChar('-', TimeZoneIndex)) + { + // The string contains a time zone designator starting at TimeZoneIndex + if (TimeZoneIndex > DotIndex + 4) + { + // Trim to millisecond + StringToParse = DateTimeString.Left(DotIndex + 4) + DateTimeString.RightChop(TimeZoneIndex); + } + } + else + { + // the string does not contain a time zone designator, trim it to the millisecond + StringToParse = DateTimeString.Left(DotIndex + 4); + } + } + + if (FDateTime::ParseIso8601(*StringToParse, OutDateTime)) + return true; + } + + if (FDateTime::ParseHttpDate(DateTimeString, OutDateTime)) + return true; + + return FDateTime::Parse(DateTimeString, OutDateTime); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIInactiveOrderStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIInactiveOrderStatus.cpp new file mode 100644 index 0000000..d4880a4 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIInactiveOrderStatus.cpp @@ -0,0 +1,97 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIInactiveOrderStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIInactiveOrderStatus::NameEnum& Value) +{ + switch (Value) + { + case APIInactiveOrderStatus::NameEnum::Inactive: + return TEXT("INACTIVE"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIInactiveOrderStatus::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIInactiveOrderStatus::EnumToString(const APIInactiveOrderStatus::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIInactiveOrderStatus::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("INACTIVE"), APIInactiveOrderStatus::NameEnum::Inactive }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIInactiveOrderStatus::EnumFromString(const FString& EnumAsString, APIInactiveOrderStatus::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIInactiveOrderStatus::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIInactiveOrderStatus::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIInactiveOrderStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteIdentifierPrefix(TEXT("sufficient_approvals")); WriteJsonValue(Writer, SufficientApprovals); + Writer->WriteIdentifierPrefix(TEXT("sufficient_balances")); WriteJsonValue(Writer, SufficientBalances); + Writer->WriteObjectEnd(); +} + +bool APIInactiveOrderStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sufficient_approvals"), SufficientApprovals); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sufficient_balances"), SufficientBalances); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIItem.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIItem.cpp new file mode 100644 index 0000000..622b8de --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIItem.cpp @@ -0,0 +1,114 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIItem.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIItem::TypeEnum& Value) +{ + switch (Value) + { + case APIItem::TypeEnum::Native: + return TEXT("NATIVE"); + case APIItem::TypeEnum::ERC20: + return TEXT("ERC20"); + case APIItem::TypeEnum::ERC721: + return TEXT("ERC721"); + case APIItem::TypeEnum::ERC1155: + return TEXT("ERC1155"); + case APIItem::TypeEnum::ERC721COLLECTION: + return TEXT("ERC721_COLLECTION"); + case APIItem::TypeEnum::ERC1155COLLECTION: + return TEXT("ERC1155_COLLECTION"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIItem::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIItem::EnumToString(const APIItem::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIItem::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("NATIVE"), APIItem::TypeEnum::Native }, + { TEXT("ERC20"), APIItem::TypeEnum::ERC20 }, + { TEXT("ERC721"), APIItem::TypeEnum::ERC721 }, + { TEXT("ERC1155"), APIItem::TypeEnum::ERC1155 }, + { TEXT("ERC721_COLLECTION"), APIItem::TypeEnum::ERC721COLLECTION }, + { TEXT("ERC1155_COLLECTION"), APIItem::TypeEnum::ERC1155COLLECTION }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIItem::EnumFromString(const FString& EnumAsString, APIItem::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIItem::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIItem::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIItem::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteObjectEnd(); +} + +bool APIItem::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APILastTrade.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APILastTrade.cpp new file mode 100644 index 0000000..8acc52a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APILastTrade.cpp @@ -0,0 +1,53 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APILastTrade.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APILastTrade::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("trade_id")); WriteJsonValue(Writer, TradeId); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("price_details")); WriteJsonValue(Writer, PriceDetails); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("created_at")); WriteJsonValue(Writer, CreatedAt); + Writer->WriteObjectEnd(); +} + +bool APILastTrade::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trade_id"), TradeId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("price_details"), PriceDetails); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_at"), CreatedAt); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APILinkWalletV2Request.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APILinkWalletV2Request.cpp new file mode 100644 index 0000000..b00ba2d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APILinkWalletV2Request.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APILinkWalletV2Request.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APILinkWalletV2Request::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("wallet_address")); WriteJsonValue(Writer, WalletAddress); + Writer->WriteIdentifierPrefix(TEXT("signature")); WriteJsonValue(Writer, Signature); + Writer->WriteIdentifierPrefix(TEXT("nonce")); WriteJsonValue(Writer, Nonce); + Writer->WriteObjectEnd(); +} + +bool APILinkWalletV2Request::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("wallet_address"), WalletAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signature"), Signature); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("nonce"), Nonce); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListActivitiesResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListActivitiesResult.cpp new file mode 100644 index 0000000..9f20a77 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListActivitiesResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListActivitiesResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListActivitiesResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListActivitiesResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListBidsResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListBidsResult.cpp new file mode 100644 index 0000000..bb55e9e --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListBidsResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListBidsResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListBidsResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIListBidsResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListChainsResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListChainsResult.cpp new file mode 100644 index 0000000..71edb15 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListChainsResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListChainsResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListChainsResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListChainsResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListCollectionBidsResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListCollectionBidsResult.cpp new file mode 100644 index 0000000..e3d09ad --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListCollectionBidsResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListCollectionBidsResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListCollectionBidsResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIListCollectionBidsResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListCollectionOwnersResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListCollectionOwnersResult.cpp new file mode 100644 index 0000000..938fd2c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListCollectionOwnersResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListCollectionOwnersResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListCollectionOwnersResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListCollectionOwnersResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListCollectionsResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListCollectionsResult.cpp new file mode 100644 index 0000000..c0fbae9 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListCollectionsResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListCollectionsResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListCollectionsResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListCollectionsResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListListingsResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListListingsResult.cpp new file mode 100644 index 0000000..e713bf7 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListListingsResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListListingsResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListListingsResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIListListingsResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListMetadataResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListMetadataResult.cpp new file mode 100644 index 0000000..3a0d696 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListMetadataResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListMetadataResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListMetadataResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListMetadataResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListMintRequestsResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListMintRequestsResult.cpp new file mode 100644 index 0000000..932919b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListMintRequestsResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListMintRequestsResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListMintRequestsResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListMintRequestsResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListNFTOwnersResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListNFTOwnersResult.cpp new file mode 100644 index 0000000..e587328 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListNFTOwnersResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListNFTOwnersResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListNFTOwnersResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListNFTOwnersResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListNFTsByOwnerResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListNFTsByOwnerResult.cpp new file mode 100644 index 0000000..905706f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListNFTsByOwnerResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListNFTsByOwnerResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListNFTsByOwnerResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListNFTsByOwnerResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListNFTsResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListNFTsResult.cpp new file mode 100644 index 0000000..f31418d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListNFTsResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListNFTsResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListNFTsResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListNFTsResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListTokensResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListTokensResult.cpp new file mode 100644 index 0000000..e96ea61 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListTokensResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListTokensResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListTokensResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIListTokensResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListTradeResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListTradeResult.cpp new file mode 100644 index 0000000..6efc863 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListTradeResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListTradeResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListTradeResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIListTradeResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListing.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListing.cpp new file mode 100644 index 0000000..c54f236 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListing.cpp @@ -0,0 +1,55 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListing.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListing::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("listing_id")); WriteJsonValue(Writer, ListingId); + Writer->WriteIdentifierPrefix(TEXT("price_details")); WriteJsonValue(Writer, PriceDetails); + Writer->WriteIdentifierPrefix(TEXT("converted_prices")); WriteJsonValue(Writer, ConvertedPrices); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("creator")); WriteJsonValue(Writer, Creator); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteObjectEnd(); +} + +bool APIListing::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("listing_id"), ListingId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("price_details"), PriceDetails); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("converted_prices"), ConvertedPrices); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("creator"), Creator); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIListingResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListingResult.cpp new file mode 100644 index 0000000..172c2d6 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIListingResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIListingResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIListingResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APIListingResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarket.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarket.cpp new file mode 100644 index 0000000..ac32057 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarket.cpp @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMarket.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIMarket::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (FloorListing.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("floor_listing")); WriteJsonValue(Writer, FloorListing.GetValue()); + } + if (LastTrade.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("last_trade")); WriteJsonValue(Writer, LastTrade.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIMarket::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("floor_listing"), FloorListing); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("last_trade"), LastTrade); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketNft.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketNft.cpp new file mode 100644 index 0000000..9ccc791 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketNft.cpp @@ -0,0 +1,46 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMarketNft.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIMarketNft::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (LastTrade.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("last_trade")); WriteJsonValue(Writer, LastTrade.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIMarketNft::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("last_trade"), LastTrade); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceDetails.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceDetails.cpp new file mode 100644 index 0000000..a5794ce --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceDetails.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMarketPriceDetails.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIMarketPriceDetails::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("token")); WriteJsonValue(Writer, Token); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("fee_inclusive_amount")); WriteJsonValue(Writer, FeeInclusiveAmount); + Writer->WriteIdentifierPrefix(TEXT("fees")); WriteJsonValue(Writer, Fees); + Writer->WriteObjectEnd(); +} + +bool APIMarketPriceDetails::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token"), Token); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fee_inclusive_amount"), FeeInclusiveAmount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fees"), Fees); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceDetailsToken.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceDetailsToken.cpp new file mode 100644 index 0000000..a89af93 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceDetailsToken.cpp @@ -0,0 +1,108 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMarketPriceDetailsToken.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIMarketPriceDetailsToken::TypeEnum& Value) +{ + switch (Value) + { + case APIMarketPriceDetailsToken::TypeEnum::Native: + return TEXT("NATIVE"); + case APIMarketPriceDetailsToken::TypeEnum::ERC20: + return TEXT("ERC20"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIMarketPriceDetailsToken::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIMarketPriceDetailsToken::EnumToString(const APIMarketPriceDetailsToken::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIMarketPriceDetailsToken::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("NATIVE"), APIMarketPriceDetailsToken::TypeEnum::Native }, + { TEXT("ERC20"), APIMarketPriceDetailsToken::TypeEnum::ERC20 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIMarketPriceDetailsToken::EnumFromString(const FString& EnumAsString, APIMarketPriceDetailsToken::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIMarketPriceDetailsToken::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIMarketPriceDetailsToken::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIMarketPriceDetailsToken::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + if (Symbol.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + if (Decimals.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("decimals")); WriteJsonValue(Writer, Decimals.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIMarketPriceDetailsToken::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("decimals"), Decimals); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceERC20Token.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceERC20Token.cpp new file mode 100644 index 0000000..04a344b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceERC20Token.cpp @@ -0,0 +1,105 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMarketPriceERC20Token.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIMarketPriceERC20Token::TypeEnum& Value) +{ + switch (Value) + { + case APIMarketPriceERC20Token::TypeEnum::ERC20: + return TEXT("ERC20"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIMarketPriceERC20Token::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIMarketPriceERC20Token::EnumToString(const APIMarketPriceERC20Token::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIMarketPriceERC20Token::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC20"), APIMarketPriceERC20Token::TypeEnum::ERC20 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIMarketPriceERC20Token::EnumFromString(const FString& EnumAsString, APIMarketPriceERC20Token::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIMarketPriceERC20Token::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIMarketPriceERC20Token::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIMarketPriceERC20Token::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + if (Symbol.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol.GetValue()); + } + if (Decimals.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("decimals")); WriteJsonValue(Writer, Decimals.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIMarketPriceERC20Token::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("decimals"), Decimals); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceFees.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceFees.cpp new file mode 100644 index 0000000..bbf10c8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceFees.cpp @@ -0,0 +1,106 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMarketPriceFees.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIMarketPriceFees::TypeEnum& Value) +{ + switch (Value) + { + case APIMarketPriceFees::TypeEnum::Royalty: + return TEXT("ROYALTY"); + case APIMarketPriceFees::TypeEnum::MakerEcosystem: + return TEXT("MAKER_ECOSYSTEM"); + case APIMarketPriceFees::TypeEnum::TakerEcosystem: + return TEXT("TAKER_ECOSYSTEM"); + case APIMarketPriceFees::TypeEnum::Protocol: + return TEXT("PROTOCOL"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIMarketPriceFees::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIMarketPriceFees::EnumToString(const APIMarketPriceFees::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIMarketPriceFees::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ROYALTY"), APIMarketPriceFees::TypeEnum::Royalty }, + { TEXT("MAKER_ECOSYSTEM"), APIMarketPriceFees::TypeEnum::MakerEcosystem }, + { TEXT("TAKER_ECOSYSTEM"), APIMarketPriceFees::TypeEnum::TakerEcosystem }, + { TEXT("PROTOCOL"), APIMarketPriceFees::TypeEnum::Protocol }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIMarketPriceFees::EnumFromString(const FString& EnumAsString, APIMarketPriceFees::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIMarketPriceFees::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIMarketPriceFees::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIMarketPriceFees::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("recipient_address")); WriteJsonValue(Writer, RecipientAddress); + Writer->WriteObjectEnd(); +} + +bool APIMarketPriceFees::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("recipient_address"), RecipientAddress); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceNativeToken.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceNativeToken.cpp new file mode 100644 index 0000000..d8b3311 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketPriceNativeToken.cpp @@ -0,0 +1,98 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMarketPriceNativeToken.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIMarketPriceNativeToken::TypeEnum& Value) +{ + switch (Value) + { + case APIMarketPriceNativeToken::TypeEnum::Native: + return TEXT("NATIVE"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIMarketPriceNativeToken::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIMarketPriceNativeToken::EnumToString(const APIMarketPriceNativeToken::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIMarketPriceNativeToken::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("NATIVE"), APIMarketPriceNativeToken::TypeEnum::Native }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIMarketPriceNativeToken::EnumFromString(const FString& EnumAsString, APIMarketPriceNativeToken::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIMarketPriceNativeToken::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIMarketPriceNativeToken::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIMarketPriceNativeToken::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + if (Symbol.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIMarketPriceNativeToken::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketplaceContractType.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketplaceContractType.cpp new file mode 100644 index 0000000..2fe5d24 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMarketplaceContractType.cpp @@ -0,0 +1,86 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMarketplaceContractType.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIMarketplaceContractType::Values& Value) +{ + switch (Value) + { + case APIMarketplaceContractType::Values::ERC721: + return TEXT("ERC721"); + case APIMarketplaceContractType::Values::ERC1155: + return TEXT("ERC1155"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIMarketplaceContractType::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIMarketplaceContractType::EnumToString(const APIMarketplaceContractType::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIMarketplaceContractType::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC721"), APIMarketplaceContractType::Values::ERC721 }, + { TEXT("ERC1155"), APIMarketplaceContractType::Values::ERC1155 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIMarketplaceContractType::EnumFromString(const FString& EnumAsString, APIMarketplaceContractType::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIMarketplaceContractType::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIMarketplaceContractType::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIMarketplaceContractType::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIMarketplaceContractType::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadata.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadata.cpp new file mode 100644 index 0000000..2e9f827 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadata.cpp @@ -0,0 +1,89 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMetadata.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIMetadata::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("created_at")); WriteJsonValue(Writer, CreatedAt); + if (UpdatedAt.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_url")); WriteJsonValue(Writer, ExternalUrl.GetValue()); + } + if (AnimationUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("animation_url")); WriteJsonValue(Writer, AnimationUrl.GetValue()); + } + if (YoutubeUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("youtube_url")); WriteJsonValue(Writer, YoutubeUrl.GetValue()); + } + if (Attributes.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("attributes")); WriteJsonValue(Writer, Attributes.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIMetadata::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_at"), CreatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_url"), ExternalUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("animation_url"), AnimationUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("youtube_url"), YoutubeUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("attributes"), Attributes); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadataApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadataApi.cpp new file mode 100644 index 0000000..8d18b3b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadataApi.cpp @@ -0,0 +1,271 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMetadataApi.h" + +#include "APIMetadataApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APIMetadataApi::APIMetadataApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APIMetadataApi::~APIMetadataApi() {} + +void APIMetadataApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APIMetadataApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APIMetadataApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APIMetadataApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APIMetadataApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APIMetadataApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APIMetadataApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APIMetadataApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APIMetadataApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APIMetadataApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APIMetadataApi::GetMetadata(const GetMetadataRequest& Request, const FGetMetadataDelegate& Delegate /*= FGetMetadataDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIMetadataApi::OnGetMetadataResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIMetadataApi::OnGetMetadataResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMetadataDelegate Delegate) const +{ + GetMetadataResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIMetadataApi::ListMetadata(const ListMetadataRequest& Request, const FListMetadataDelegate& Delegate /*= FListMetadataDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIMetadataApi::OnListMetadataResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIMetadataApi::OnListMetadataResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMetadataDelegate Delegate) const +{ + ListMetadataResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIMetadataApi::ListMetadataForChain(const ListMetadataForChainRequest& Request, const FListMetadataForChainDelegate& Delegate /*= FListMetadataForChainDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIMetadataApi::OnListMetadataForChainResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIMetadataApi::OnListMetadataForChainResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMetadataForChainDelegate Delegate) const +{ + ListMetadataForChainResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIMetadataApi::RefreshMetadataByID(const RefreshMetadataByIDRequest& Request, const FRefreshMetadataByIDDelegate& Delegate /*= FRefreshMetadataByIDDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIMetadataApi::OnRefreshMetadataByIDResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIMetadataApi::OnRefreshMetadataByIDResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshMetadataByIDDelegate Delegate) const +{ + RefreshMetadataByIDResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIMetadataApi::RefreshNFTMetadataByTokenID(const RefreshNFTMetadataByTokenIDRequest& Request, const FRefreshNFTMetadataByTokenIDDelegate& Delegate /*= FRefreshNFTMetadataByTokenIDDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIMetadataApi::OnRefreshNFTMetadataByTokenIDResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIMetadataApi::OnRefreshNFTMetadataByTokenIDResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshNFTMetadataByTokenIDDelegate Delegate) const +{ + RefreshNFTMetadataByTokenIDResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadataApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadataApiOperations.cpp new file mode 100644 index 0000000..b17d314 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadataApiOperations.cpp @@ -0,0 +1,351 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMetadataApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APIMetadataApi::GetMetadataRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("metadata_id"), FStringFormatArg(ToUrlString(MetadataId)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/metadata/{metadata_id}"), PathParams); + + return Path; +} + +void APIMetadataApi::GetMetadataRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIMetadataApi::GetMetadataResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIMetadataApi::GetMetadataResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIMetadataApi::ListMetadataRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/metadata"), PathParams); + + TArray QueryParams; + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIMetadataApi::ListMetadataRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIMetadataApi::ListMetadataResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIMetadataApi::ListMetadataResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIMetadataApi::ListMetadataForChainRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/metadata"), PathParams); + + TArray QueryParams; + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIMetadataApi::ListMetadataForChainRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIMetadataApi::ListMetadataForChainResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIMetadataApi::ListMetadataForChainResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIMetadataApi::RefreshMetadataByIDRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/metadata/refresh-metadata"), PathParams); + + return Path; +} + +void APIMetadataApi::RefreshMetadataByIDRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APIRefreshMetadataByIDRequest); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APIRefreshMetadataByIDRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APIRefreshMetadataByIDRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIMetadataApi::RefreshMetadataByIDResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 202: + SetResponseString(TEXT("Accepted")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 429: + SetResponseString(TEXT("Too Many Metadata refreshes (429)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIMetadataApi::RefreshMetadataByIDResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIMetadataApi::RefreshNFTMetadataByTokenIDRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/nfts/refresh-metadata"), PathParams); + + return Path; +} + +void APIMetadataApi::RefreshNFTMetadataByTokenIDRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APIRefreshNFTMetadataByTokenIDRequest); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APIRefreshNFTMetadataByTokenIDRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APIRefreshNFTMetadataByTokenIDRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIMetadataApi::RefreshNFTMetadataByTokenIDResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 202: + SetResponseString(TEXT("Accepted")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 429: + SetResponseString(TEXT("Too Many Metadata refreshes (429)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIMetadataApi::RefreshNFTMetadataByTokenIDResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadataRefreshRateLimitResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadataRefreshRateLimitResult.cpp new file mode 100644 index 0000000..43b5584 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMetadataRefreshRateLimitResult.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMetadataRefreshRateLimitResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIMetadataRefreshRateLimitResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("imx_refreshes_limit")); WriteJsonValue(Writer, ImxRefreshesLimit); + Writer->WriteIdentifierPrefix(TEXT("imx_refresh_limit_reset")); WriteJsonValue(Writer, ImxRefreshLimitReset); + Writer->WriteIdentifierPrefix(TEXT("imx_remaining_refreshes")); WriteJsonValue(Writer, ImxRemainingRefreshes); + Writer->WriteIdentifierPrefix(TEXT("retry_after")); WriteJsonValue(Writer, RetryAfter); + Writer->WriteObjectEnd(); +} + +bool APIMetadataRefreshRateLimitResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("imx_refreshes_limit"), ImxRefreshesLimit); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("imx_refresh_limit_reset"), ImxRefreshLimitReset); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("imx_remaining_refreshes"), ImxRemainingRefreshes); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("retry_after"), RetryAfter); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMint.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMint.cpp new file mode 100644 index 0000000..2ec4bab --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMint.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMint.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIMint::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("to")); WriteJsonValue(Writer, To); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("asset")); WriteJsonValue(Writer, Asset); + Writer->WriteObjectEnd(); +} + +bool APIMint::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("to"), To); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("asset"), Asset); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMintAsset.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMintAsset.cpp new file mode 100644 index 0000000..b260f37 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMintAsset.cpp @@ -0,0 +1,60 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMintAsset.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIMintAsset::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("reference_id")); WriteJsonValue(Writer, ReferenceId); + Writer->WriteIdentifierPrefix(TEXT("owner_address")); WriteJsonValue(Writer, OwnerAddress); + if (TokenId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId.GetValue()); + } + if (Amount.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount.GetValue()); + } + if (Metadata.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("metadata")); WriteJsonValue(Writer, Metadata.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIMintAsset::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("reference_id"), ReferenceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("owner_address"), OwnerAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("metadata"), Metadata); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMintRequestErrorMessage.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMintRequestErrorMessage.cpp new file mode 100644 index 0000000..5175402 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMintRequestErrorMessage.cpp @@ -0,0 +1,46 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMintRequestErrorMessage.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIMintRequestErrorMessage::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Message.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIMintRequestErrorMessage::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIMintRequestStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMintRequestStatus.cpp new file mode 100644 index 0000000..1a2a440 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIMintRequestStatus.cpp @@ -0,0 +1,89 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIMintRequestStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIMintRequestStatus::Values& Value) +{ + switch (Value) + { + case APIMintRequestStatus::Values::Pending: + return TEXT("pending"); + case APIMintRequestStatus::Values::Succeeded: + return TEXT("succeeded"); + case APIMintRequestStatus::Values::Failed: + return TEXT("failed"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIMintRequestStatus::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIMintRequestStatus::EnumToString(const APIMintRequestStatus::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIMintRequestStatus::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("pending"), APIMintRequestStatus::Values::Pending }, + { TEXT("succeeded"), APIMintRequestStatus::Values::Succeeded }, + { TEXT("failed"), APIMintRequestStatus::Values::Failed }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIMintRequestStatus::EnumFromString(const FString& EnumAsString, APIMintRequestStatus::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIMintRequestStatus::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIMintRequestStatus::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIMintRequestStatus::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIMintRequestStatus::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFT.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFT.cpp new file mode 100644 index 0000000..5a9d097 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFT.cpp @@ -0,0 +1,105 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFT.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFT::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("indexed_at")); WriteJsonValue(Writer, IndexedAt); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + if (MetadataSyncedAt.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("metadata_synced_at")); WriteJsonValue(Writer, MetadataSyncedAt.GetValue()); + } + if (MetadataId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("metadata_id")); WriteJsonValue(Writer, MetadataId.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalLink.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_link")); WriteJsonValue(Writer, ExternalLink.GetValue()); + } + if (ExternalUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_url")); WriteJsonValue(Writer, ExternalUrl.GetValue()); + } + if (AnimationUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("animation_url")); WriteJsonValue(Writer, AnimationUrl.GetValue()); + } + if (YoutubeUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("youtube_url")); WriteJsonValue(Writer, YoutubeUrl.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("attributes")); WriteJsonValue(Writer, Attributes); + if (TotalSupply.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("total_supply")); WriteJsonValue(Writer, TotalSupply.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APINFT::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("indexed_at"), IndexedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("metadata_synced_at"), MetadataSyncedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("metadata_id"), MetadataId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_link"), ExternalLink); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_url"), ExternalUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("animation_url"), AnimationUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("youtube_url"), YoutubeUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("attributes"), Attributes); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("total_supply"), TotalSupply); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTBundle.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTBundle.cpp new file mode 100644 index 0000000..4e51178 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTBundle.cpp @@ -0,0 +1,50 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTBundle.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFTBundle::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("nft_with_stack")); WriteJsonValue(Writer, NftWithStack); + if (Market.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("market")); WriteJsonValue(Writer, Market.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("listings")); WriteJsonValue(Writer, Listings); + Writer->WriteObjectEnd(); +} + +bool APINFTBundle::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("nft_with_stack"), NftWithStack); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("market"), Market); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("listings"), Listings); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTContractType.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTContractType.cpp new file mode 100644 index 0000000..020bebf --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTContractType.cpp @@ -0,0 +1,86 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTContractType.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APINFTContractType::Values& Value) +{ + switch (Value) + { + case APINFTContractType::Values::ERC721: + return TEXT("ERC721"); + case APINFTContractType::Values::ERC1155: + return TEXT("ERC1155"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APINFTContractType::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APINFTContractType::EnumToString(const APINFTContractType::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APINFTContractType::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC721"), APINFTContractType::Values::ERC721 }, + { TEXT("ERC1155"), APINFTContractType::Values::ERC1155 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APINFTContractType::EnumFromString(const FString& EnumAsString, APINFTContractType::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APINFTContractType::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APINFTContractType::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APINFTContractType::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APINFTContractType::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTMetadataAttribute.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTMetadataAttribute.cpp new file mode 100644 index 0000000..f580ce7 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTMetadataAttribute.cpp @@ -0,0 +1,109 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTMetadataAttribute.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APINFTMetadataAttribute::DisplayTypeEnum& Value) +{ + switch (Value) + { + case APINFTMetadataAttribute::DisplayTypeEnum::Number: + return TEXT("number"); + case APINFTMetadataAttribute::DisplayTypeEnum::BoostPercentage: + return TEXT("boost_percentage"); + case APINFTMetadataAttribute::DisplayTypeEnum::BoostNumber: + return TEXT("boost_number"); + case APINFTMetadataAttribute::DisplayTypeEnum::Date: + return TEXT("date"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APINFTMetadataAttribute::DisplayTypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APINFTMetadataAttribute::EnumToString(const APINFTMetadataAttribute::DisplayTypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APINFTMetadataAttribute::DisplayTypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("number"), APINFTMetadataAttribute::DisplayTypeEnum::Number }, + { TEXT("boost_percentage"), APINFTMetadataAttribute::DisplayTypeEnum::BoostPercentage }, + { TEXT("boost_number"), APINFTMetadataAttribute::DisplayTypeEnum::BoostNumber }, + { TEXT("date"), APINFTMetadataAttribute::DisplayTypeEnum::Date }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APINFTMetadataAttribute::EnumFromString(const FString& EnumAsString, APINFTMetadataAttribute::DisplayTypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APINFTMetadataAttribute::DisplayTypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APINFTMetadataAttribute::DisplayTypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APINFTMetadataAttribute::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (DisplayType.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("display_type")); WriteJsonValue(Writer, DisplayType.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("trait_type")); WriteJsonValue(Writer, TraitType); + Writer->WriteIdentifierPrefix(TEXT("value")); WriteJsonValue(Writer, Value); + Writer->WriteObjectEnd(); +} + +bool APINFTMetadataAttribute::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("display_type"), DisplayType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("trait_type"), TraitType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("value"), Value); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTMetadataAttributeValue.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTMetadataAttributeValue.cpp new file mode 100644 index 0000000..57b0873 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTMetadataAttributeValue.cpp @@ -0,0 +1,41 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTMetadataAttributeValue.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFTMetadataAttributeValue::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); +} + +bool APINFTMetadataAttributeValue::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTMetadataRequest.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTMetadataRequest.cpp new file mode 100644 index 0000000..f36015b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTMetadataRequest.cpp @@ -0,0 +1,76 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTMetadataRequest.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFTMetadataRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_url")); WriteJsonValue(Writer, ExternalUrl.GetValue()); + } + if (AnimationUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("animation_url")); WriteJsonValue(Writer, AnimationUrl.GetValue()); + } + if (YoutubeUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("youtube_url")); WriteJsonValue(Writer, YoutubeUrl.GetValue()); + } + if (Attributes.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("attributes")); WriteJsonValue(Writer, Attributes.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APINFTMetadataRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_url"), ExternalUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("animation_url"), AnimationUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("youtube_url"), YoutubeUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("attributes"), Attributes); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTOwner.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTOwner.cpp new file mode 100644 index 0000000..359573b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTOwner.cpp @@ -0,0 +1,56 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTOwner.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFTOwner::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("account_address")); WriteJsonValue(Writer, AccountAddress); + Writer->WriteIdentifierPrefix(TEXT("balance")); WriteJsonValue(Writer, Balance); + if (UpdatedAt.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APINFTOwner::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("account_address"), AccountAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("balance"), Balance); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTQuoteResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTQuoteResult.cpp new file mode 100644 index 0000000..76e7da8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTQuoteResult.cpp @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTQuoteResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFTQuoteResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("market_stack")); WriteJsonValue(Writer, MarketStack); + Writer->WriteIdentifierPrefix(TEXT("market_nft")); WriteJsonValue(Writer, MarketNft); + Writer->WriteIdentifierPrefix(TEXT("market_collection")); WriteJsonValue(Writer, MarketCollection); + Writer->WriteObjectEnd(); +} + +bool APINFTQuoteResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("market_stack"), MarketStack); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("market_nft"), MarketNft); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("market_collection"), MarketCollection); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTSale.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTSale.cpp new file mode 100644 index 0000000..d661fb0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTSale.cpp @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTSale.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFTSale::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("order_id")); WriteJsonValue(Writer, OrderId); + Writer->WriteIdentifierPrefix(TEXT("to")); WriteJsonValue(Writer, To); + Writer->WriteIdentifierPrefix(TEXT("from")); WriteJsonValue(Writer, From); + Writer->WriteIdentifierPrefix(TEXT("asset")); WriteJsonValue(Writer, Asset); + Writer->WriteIdentifierPrefix(TEXT("payment")); WriteJsonValue(Writer, Payment); + Writer->WriteObjectEnd(); +} + +bool APINFTSale::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_id"), OrderId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("to"), To); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("from"), From); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("asset"), Asset); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("payment"), Payment); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTWithBalance.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTWithBalance.cpp new file mode 100644 index 0000000..55a3698 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTWithBalance.cpp @@ -0,0 +1,97 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTWithBalance.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFTWithBalance::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("indexed_at")); WriteJsonValue(Writer, IndexedAt); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + if (MetadataSyncedAt.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("metadata_synced_at")); WriteJsonValue(Writer, MetadataSyncedAt.GetValue()); + } + if (MetadataId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("metadata_id")); WriteJsonValue(Writer, MetadataId.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalLink.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_link")); WriteJsonValue(Writer, ExternalLink.GetValue()); + } + if (AnimationUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("animation_url")); WriteJsonValue(Writer, AnimationUrl.GetValue()); + } + if (YoutubeUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("youtube_url")); WriteJsonValue(Writer, YoutubeUrl.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("attributes")); WriteJsonValue(Writer, Attributes); + Writer->WriteIdentifierPrefix(TEXT("balance")); WriteJsonValue(Writer, Balance); + Writer->WriteObjectEnd(); +} + +bool APINFTWithBalance::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("indexed_at"), IndexedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("metadata_synced_at"), MetadataSyncedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("metadata_id"), MetadataId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_link"), ExternalLink); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("animation_url"), AnimationUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("youtube_url"), YoutubeUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("attributes"), Attributes); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("balance"), Balance); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTWithOwner.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTWithOwner.cpp new file mode 100644 index 0000000..866cc8f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTWithOwner.cpp @@ -0,0 +1,53 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTWithOwner.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFTWithOwner::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("account_address")); WriteJsonValue(Writer, AccountAddress); + Writer->WriteIdentifierPrefix(TEXT("balance")); WriteJsonValue(Writer, Balance); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + Writer->WriteObjectEnd(); +} + +bool APINFTWithOwner::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("account_address"), AccountAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("balance"), Balance); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTWithStack.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTWithStack.cpp new file mode 100644 index 0000000..b32eb0d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINFTWithStack.cpp @@ -0,0 +1,95 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINFTWithStack.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APINFTWithStack::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteIdentifierPrefix(TEXT("stack_id")); WriteJsonValue(Writer, StackId); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("created_at")); WriteJsonValue(Writer, CreatedAt); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_url")); WriteJsonValue(Writer, ExternalUrl.GetValue()); + } + if (AnimationUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("animation_url")); WriteJsonValue(Writer, AnimationUrl.GetValue()); + } + if (YoutubeUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("youtube_url")); WriteJsonValue(Writer, YoutubeUrl.GetValue()); + } + if (Attributes.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("attributes")); WriteJsonValue(Writer, Attributes.GetValue()); + } + if (Balance.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("balance")); WriteJsonValue(Writer, Balance.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APINFTWithStack::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("stack_id"), StackId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_at"), CreatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_url"), ExternalUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("animation_url"), AnimationUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("youtube_url"), YoutubeUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("attributes"), Attributes); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("balance"), Balance); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINativeItem.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINativeItem.cpp new file mode 100644 index 0000000..0591f5c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINativeItem.cpp @@ -0,0 +1,95 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINativeItem.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APINativeItem::TypeEnum& Value) +{ + switch (Value) + { + case APINativeItem::TypeEnum::Native: + return TEXT("NATIVE"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APINativeItem::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APINativeItem::EnumToString(const APINativeItem::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APINativeItem::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("NATIVE"), APINativeItem::TypeEnum::Native }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APINativeItem::EnumFromString(const FString& EnumAsString, APINativeItem::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APINativeItem::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APINativeItem::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APINativeItem::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteObjectEnd(); +} + +bool APINativeItem::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINftOwnersApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINftOwnersApi.cpp new file mode 100644 index 0000000..3afb9cb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINftOwnersApi.cpp @@ -0,0 +1,217 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINftOwnersApi.h" + +#include "APINftOwnersApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APINftOwnersApi::APINftOwnersApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APINftOwnersApi::~APINftOwnersApi() {} + +void APINftOwnersApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APINftOwnersApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APINftOwnersApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APINftOwnersApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APINftOwnersApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APINftOwnersApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APINftOwnersApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APINftOwnersApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APINftOwnersApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APINftOwnersApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APINftOwnersApi::ListAllNFTOwners(const ListAllNFTOwnersRequest& Request, const FListAllNFTOwnersDelegate& Delegate /*= FListAllNFTOwnersDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftOwnersApi::OnListAllNFTOwnersResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftOwnersApi::OnListAllNFTOwnersResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListAllNFTOwnersDelegate Delegate) const +{ + ListAllNFTOwnersResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APINftOwnersApi::ListNFTOwners(const ListNFTOwnersRequest& Request, const FListNFTOwnersDelegate& Delegate /*= FListNFTOwnersDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftOwnersApi::OnListNFTOwnersResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftOwnersApi::OnListNFTOwnersResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListNFTOwnersDelegate Delegate) const +{ + ListNFTOwnersResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APINftOwnersApi::ListOwnersByContractAddress(const ListOwnersByContractAddressRequest& Request, const FListOwnersByContractAddressDelegate& Delegate /*= FListOwnersByContractAddressDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftOwnersApi::OnListOwnersByContractAddressResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftOwnersApi::OnListOwnersByContractAddressResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListOwnersByContractAddressDelegate Delegate) const +{ + ListOwnersByContractAddressResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINftOwnersApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINftOwnersApiOperations.cpp new file mode 100644 index 0000000..66202d0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINftOwnersApiOperations.cpp @@ -0,0 +1,209 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINftOwnersApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APINftOwnersApi::ListAllNFTOwnersRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/nft-owners"), PathParams); + + TArray QueryParams; + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APINftOwnersApi::ListAllNFTOwnersRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APINftOwnersApi::ListAllNFTOwnersResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftOwnersApi::ListAllNFTOwnersResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APINftOwnersApi::ListNFTOwnersRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("token_id"), FStringFormatArg(ToUrlString(TokenId)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners"), PathParams); + + TArray QueryParams; + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APINftOwnersApi::ListNFTOwnersRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APINftOwnersApi::ListNFTOwnersResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftOwnersApi::ListNFTOwnersResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APINftOwnersApi::ListOwnersByContractAddressRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/owners"), PathParams); + + TArray QueryParams; + if(AccountAddress.IsSet()) + { + QueryParams.Add(CollectionToUrlString_multi(AccountAddress.GetValue(), TEXT("account_address"))); + } + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APINftOwnersApi::ListOwnersByContractAddressRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APINftOwnersApi::ListOwnersByContractAddressResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftOwnersApi::ListOwnersByContractAddressResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINftsApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINftsApi.cpp new file mode 100644 index 0000000..38b5878 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINftsApi.cpp @@ -0,0 +1,325 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINftsApi.h" + +#include "APINftsApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APINftsApi::APINftsApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APINftsApi::~APINftsApi() {} + +void APINftsApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APINftsApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APINftsApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APINftsApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APINftsApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APINftsApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APINftsApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APINftsApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APINftsApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APINftsApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APINftsApi::CreateMintRequest(const CreateMintRequestRequest& Request, const FCreateMintRequestDelegate& Delegate /*= FCreateMintRequestDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftsApi::OnCreateMintRequestResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftsApi::OnCreateMintRequestResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateMintRequestDelegate Delegate) const +{ + CreateMintRequestResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APINftsApi::GetMintRequest(const GetMintRequestRequest& Request, const FGetMintRequestDelegate& Delegate /*= FGetMintRequestDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftsApi::OnGetMintRequestResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftsApi::OnGetMintRequestResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMintRequestDelegate Delegate) const +{ + GetMintRequestResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APINftsApi::GetNFT(const GetNFTRequest& Request, const FGetNFTDelegate& Delegate /*= FGetNFTDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftsApi::OnGetNFTResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftsApi::OnGetNFTResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetNFTDelegate Delegate) const +{ + GetNFTResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APINftsApi::ListAllNFTs(const ListAllNFTsRequest& Request, const FListAllNFTsDelegate& Delegate /*= FListAllNFTsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftsApi::OnListAllNFTsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftsApi::OnListAllNFTsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListAllNFTsDelegate Delegate) const +{ + ListAllNFTsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APINftsApi::ListMintRequests(const ListMintRequestsRequest& Request, const FListMintRequestsDelegate& Delegate /*= FListMintRequestsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftsApi::OnListMintRequestsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftsApi::OnListMintRequestsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMintRequestsDelegate Delegate) const +{ + ListMintRequestsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APINftsApi::ListNFTs(const ListNFTsRequest& Request, const FListNFTsDelegate& Delegate /*= FListNFTsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftsApi::OnListNFTsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftsApi::OnListNFTsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListNFTsDelegate Delegate) const +{ + ListNFTsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APINftsApi::ListNFTsByAccountAddress(const ListNFTsByAccountAddressRequest& Request, const FListNFTsByAccountAddressDelegate& Delegate /*= FListNFTsByAccountAddressDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APINftsApi::OnListNFTsByAccountAddressResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APINftsApi::OnListNFTsByAccountAddressResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListNFTsByAccountAddressDelegate Delegate) const +{ + ListNFTsByAccountAddressResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APINftsApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APINftsApiOperations.cpp new file mode 100644 index 0000000..1a76730 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APINftsApiOperations.cpp @@ -0,0 +1,467 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APINftsApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APINftsApi::CreateMintRequestRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests"), PathParams); + + return Path; +} + +void APINftsApi::CreateMintRequestRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APICreateMintRequestRequest); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICreateMintRequestRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICreateMintRequestRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APINftsApi::CreateMintRequestResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 202: + SetResponseString(TEXT("Accepted")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 409: + SetResponseString(TEXT("Conflict (409)")); + break; + case 429: + SetResponseString(TEXT("Too Many mint requests (429)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftsApi::CreateMintRequestResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APINftsApi::GetMintRequestRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("reference_id"), FStringFormatArg(ToUrlString(ReferenceId)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests/{reference_id}"), PathParams); + + return Path; +} + +void APINftsApi::GetMintRequestRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APINftsApi::GetMintRequestResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftsApi::GetMintRequestResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APINftsApi::GetNFTRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("token_id"), FStringFormatArg(ToUrlString(TokenId)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}"), PathParams); + + return Path; +} + +void APINftsApi::GetNFTRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APINftsApi::GetNFTResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftsApi::GetNFTResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APINftsApi::ListAllNFTsRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/nfts"), PathParams); + + TArray QueryParams; + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APINftsApi::ListAllNFTsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APINftsApi::ListAllNFTsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftsApi::ListAllNFTsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APINftsApi::ListMintRequestsRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests"), PathParams); + + TArray QueryParams; + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + if(Status.IsSet()) + { + QueryParams.Add(FString(TEXT("status=")) + ToUrlString(Status.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APINftsApi::ListMintRequestsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APINftsApi::ListMintRequestsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftsApi::ListMintRequestsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APINftsApi::ListNFTsRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/collections/{contract_address}/nfts"), PathParams); + + TArray QueryParams; + if(TokenId.IsSet()) + { + QueryParams.Add(CollectionToUrlString_multi(TokenId.GetValue(), TEXT("token_id"))); + } + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APINftsApi::ListNFTsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APINftsApi::ListNFTsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftsApi::ListNFTsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APINftsApi::ListNFTsByAccountAddressRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("account_address"), FStringFormatArg(ToUrlString(AccountAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/accounts/{account_address}/nfts"), PathParams); + + TArray QueryParams; + if(ContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("contract_address=")) + ToUrlString(ContractAddress.GetValue())); + } + if(TokenId.IsSet()) + { + QueryParams.Add(CollectionToUrlString_multi(TokenId.GetValue(), TEXT("token_id"))); + } + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APINftsApi::ListNFTsByAccountAddressRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APINftsApi::ListNFTsByAccountAddressResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APINftsApi::ListNFTsByAccountAddressResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistContractStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistContractStatus.cpp new file mode 100644 index 0000000..24fdecd --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistContractStatus.cpp @@ -0,0 +1,53 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOperatorAllowlistContractStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIOperatorAllowlistContractStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("status")); WriteJsonValue(Writer, Status); + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details); + Writer->WriteIdentifierPrefix(TEXT("created_at")); WriteJsonValue(Writer, CreatedAt); + Writer->WriteIdentifierPrefix(TEXT("created_by")); WriteJsonValue(Writer, CreatedBy); + Writer->WriteObjectEnd(); +} + +bool APIOperatorAllowlistContractStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("status"), Status); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_at"), CreatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_by"), CreatedBy); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistContractStatusInternal.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistContractStatusInternal.cpp new file mode 100644 index 0000000..7cf198e --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistContractStatusInternal.cpp @@ -0,0 +1,63 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOperatorAllowlistContractStatusInternal.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIOperatorAllowlistContractStatusInternal::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("status")); WriteJsonValue(Writer, Status); + Writer->WriteIdentifierPrefix(TEXT("details")); WriteJsonValue(Writer, Details); + Writer->WriteIdentifierPrefix(TEXT("created_at")); WriteJsonValue(Writer, CreatedAt); + Writer->WriteIdentifierPrefix(TEXT("created_by")); WriteJsonValue(Writer, CreatedBy); + if (OrgName.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("org_name")); WriteJsonValue(Writer, OrgName.GetValue()); + } + if (OrgTier.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("org_tier")); WriteJsonValue(Writer, OrgTier.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIOperatorAllowlistContractStatusInternal::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("status"), Status); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("details"), Details); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_at"), CreatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_by"), CreatedBy); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("org_name"), OrgName); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("org_tier"), OrgTier); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatus.cpp new file mode 100644 index 0000000..88685de --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatus.cpp @@ -0,0 +1,95 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOperatorAllowlistStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIOperatorAllowlistStatus::Values& Value) +{ + switch (Value) + { + case APIOperatorAllowlistStatus::Values::Requested: + return TEXT("requested"); + case APIOperatorAllowlistStatus::Values::Approved: + return TEXT("approved"); + case APIOperatorAllowlistStatus::Values::Rejected: + return TEXT("rejected"); + case APIOperatorAllowlistStatus::Values::Removed: + return TEXT("removed"); + case APIOperatorAllowlistStatus::Values::Added: + return TEXT("added"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOperatorAllowlistStatus::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOperatorAllowlistStatus::EnumToString(const APIOperatorAllowlistStatus::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOperatorAllowlistStatus::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("requested"), APIOperatorAllowlistStatus::Values::Requested }, + { TEXT("approved"), APIOperatorAllowlistStatus::Values::Approved }, + { TEXT("rejected"), APIOperatorAllowlistStatus::Values::Rejected }, + { TEXT("removed"), APIOperatorAllowlistStatus::Values::Removed }, + { TEXT("added"), APIOperatorAllowlistStatus::Values::Added }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOperatorAllowlistStatus::EnumFromString(const FString& EnumAsString, APIOperatorAllowlistStatus::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOperatorAllowlistStatus::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOperatorAllowlistStatus::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOperatorAllowlistStatus::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIOperatorAllowlistStatus::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatusDetails.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatusDetails.cpp new file mode 100644 index 0000000..8553acc --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatusDetails.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOperatorAllowlistStatusDetails.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIOperatorAllowlistStatusDetails::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("purpose")); WriteJsonValue(Writer, Purpose); + Writer->WriteIdentifierPrefix(TEXT("is_settlement_contract")); WriteJsonValue(Writer, IsSettlementContract); + Writer->WriteIdentifierPrefix(TEXT("reason")); WriteJsonValue(Writer, Reason); + Writer->WriteObjectEnd(); +} + +bool APIOperatorAllowlistStatusDetails::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("purpose"), Purpose); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("is_settlement_contract"), IsSettlementContract); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("reason"), Reason); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatusRequested.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatusRequested.cpp new file mode 100644 index 0000000..d802a81 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatusRequested.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOperatorAllowlistStatusRequested.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIOperatorAllowlistStatusRequested::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("purpose")); WriteJsonValue(Writer, Purpose); + Writer->WriteIdentifierPrefix(TEXT("is_settlement_contract")); WriteJsonValue(Writer, IsSettlementContract); + Writer->WriteObjectEnd(); +} + +bool APIOperatorAllowlistStatusRequested::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("purpose"), Purpose); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("is_settlement_contract"), IsSettlementContract); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatusUpdated.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatusUpdated.cpp new file mode 100644 index 0000000..2943740 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOperatorAllowlistStatusUpdated.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOperatorAllowlistStatusUpdated.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIOperatorAllowlistStatusUpdated::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("reason")); WriteJsonValue(Writer, Reason); + Writer->WriteObjectEnd(); +} + +bool APIOperatorAllowlistStatusUpdated::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("reason"), Reason); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrder.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrder.cpp new file mode 100644 index 0000000..938c6d5 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrder.cpp @@ -0,0 +1,131 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrder.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIOrder::TypeEnum& Value) +{ + switch (Value) + { + case APIOrder::TypeEnum::Listing: + return TEXT("LISTING"); + case APIOrder::TypeEnum::Bid: + return TEXT("BID"); + case APIOrder::TypeEnum::CollectionBid: + return TEXT("COLLECTION_BID"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrder::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrder::EnumToString(const APIOrder::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrder::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("LISTING"), APIOrder::TypeEnum::Listing }, + { TEXT("BID"), APIOrder::TypeEnum::Bid }, + { TEXT("COLLECTION_BID"), APIOrder::TypeEnum::CollectionBid }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrder::EnumFromString(const FString& EnumAsString, APIOrder::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrder::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrder::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrder::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("account_address")); WriteJsonValue(Writer, AccountAddress); + Writer->WriteIdentifierPrefix(TEXT("buy")); WriteJsonValue(Writer, Buy); + Writer->WriteIdentifierPrefix(TEXT("fees")); WriteJsonValue(Writer, Fees); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("created_at")); WriteJsonValue(Writer, CreatedAt); + Writer->WriteIdentifierPrefix(TEXT("end_at")); WriteJsonValue(Writer, EndAt); + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id); + Writer->WriteIdentifierPrefix(TEXT("order_hash")); WriteJsonValue(Writer, OrderHash); + Writer->WriteIdentifierPrefix(TEXT("protocol_data")); WriteJsonValue(Writer, ProtocolData); + Writer->WriteIdentifierPrefix(TEXT("salt")); WriteJsonValue(Writer, Salt); + Writer->WriteIdentifierPrefix(TEXT("sell")); WriteJsonValue(Writer, Sell); + Writer->WriteIdentifierPrefix(TEXT("signature")); WriteJsonValue(Writer, Signature); + Writer->WriteIdentifierPrefix(TEXT("start_at")); WriteJsonValue(Writer, StartAt); + Writer->WriteIdentifierPrefix(TEXT("status")); WriteJsonValue(Writer, Status); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + Writer->WriteIdentifierPrefix(TEXT("fill_status")); WriteJsonValue(Writer, FillStatus); + Writer->WriteObjectEnd(); +} + +bool APIOrder::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("account_address"), AccountAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("buy"), Buy); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fees"), Fees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_at"), CreatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("end_at"), EndAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_hash"), OrderHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("protocol_data"), ProtocolData); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("salt"), Salt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sell"), Sell); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signature"), Signature); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("start_at"), StartAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("status"), Status); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fill_status"), FillStatus); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrderStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrderStatus.cpp new file mode 100644 index 0000000..fb4db25 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrderStatus.cpp @@ -0,0 +1,161 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIOrderStatus::NameEnum& Value) +{ + switch (Value) + { + case APIOrderStatus::NameEnum::Expired: + return TEXT("EXPIRED"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrderStatus::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatus::EnumToString(const APIOrderStatus::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatus::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("EXPIRED"), APIOrderStatus::NameEnum::Expired }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatus::EnumFromString(const FString& EnumAsString, APIOrderStatus::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatus::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatus::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +inline FString ToString(const APIOrderStatus::CancellationTypeEnum& Value) +{ + switch (Value) + { + case APIOrderStatus::CancellationTypeEnum::OnChain: + return TEXT("ON_CHAIN"); + case APIOrderStatus::CancellationTypeEnum::OffChain: + return TEXT("OFF_CHAIN"); + case APIOrderStatus::CancellationTypeEnum::Underfunded: + return TEXT("UNDERFUNDED"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrderStatus::CancellationTypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatus::EnumToString(const APIOrderStatus::CancellationTypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatus::CancellationTypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ON_CHAIN"), APIOrderStatus::CancellationTypeEnum::OnChain }, + { TEXT("OFF_CHAIN"), APIOrderStatus::CancellationTypeEnum::OffChain }, + { TEXT("UNDERFUNDED"), APIOrderStatus::CancellationTypeEnum::Underfunded }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatus::EnumFromString(const FString& EnumAsString, APIOrderStatus::CancellationTypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatus::CancellationTypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatus::CancellationTypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteIdentifierPrefix(TEXT("pending")); WriteJsonValue(Writer, Pending); + Writer->WriteIdentifierPrefix(TEXT("cancellation_type")); WriteJsonValue(Writer, CancellationType); + Writer->WriteIdentifierPrefix(TEXT("evaluated")); WriteJsonValue(Writer, Evaluated); + Writer->WriteIdentifierPrefix(TEXT("started")); WriteJsonValue(Writer, Started); + Writer->WriteIdentifierPrefix(TEXT("sufficient_approvals")); WriteJsonValue(Writer, SufficientApprovals); + Writer->WriteIdentifierPrefix(TEXT("sufficient_balances")); WriteJsonValue(Writer, SufficientBalances); + Writer->WriteObjectEnd(); +} + +bool APIOrderStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("pending"), Pending); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("cancellation_type"), CancellationType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("evaluated"), Evaluated); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("started"), Started); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sufficient_approvals"), SufficientApprovals); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sufficient_balances"), SufficientBalances); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrderStatusName.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrderStatusName.cpp new file mode 100644 index 0000000..ca10283 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrderStatusName.cpp @@ -0,0 +1,98 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrderStatusName.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIOrderStatusName::Values& Value) +{ + switch (Value) + { + case APIOrderStatusName::Values::Pending: + return TEXT("PENDING"); + case APIOrderStatusName::Values::Active: + return TEXT("ACTIVE"); + case APIOrderStatusName::Values::Inactive: + return TEXT("INACTIVE"); + case APIOrderStatusName::Values::Filled: + return TEXT("FILLED"); + case APIOrderStatusName::Values::Expired: + return TEXT("EXPIRED"); + case APIOrderStatusName::Values::Cancelled: + return TEXT("CANCELLED"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrderStatusName::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrderStatusName::EnumToString(const APIOrderStatusName::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrderStatusName::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("PENDING"), APIOrderStatusName::Values::Pending }, + { TEXT("ACTIVE"), APIOrderStatusName::Values::Active }, + { TEXT("INACTIVE"), APIOrderStatusName::Values::Inactive }, + { TEXT("FILLED"), APIOrderStatusName::Values::Filled }, + { TEXT("EXPIRED"), APIOrderStatusName::Values::Expired }, + { TEXT("CANCELLED"), APIOrderStatusName::Values::Cancelled }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrderStatusName::EnumFromString(const FString& EnumAsString, APIOrderStatusName::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrderStatusName::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrderStatusName::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrderStatusName::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIOrderStatusName::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrdersApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrdersApi.cpp new file mode 100644 index 0000000..557f865 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrdersApi.cpp @@ -0,0 +1,487 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrdersApi.h" + +#include "APIOrdersApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APIOrdersApi::APIOrdersApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APIOrdersApi::~APIOrdersApi() {} + +void APIOrdersApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APIOrdersApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APIOrdersApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APIOrdersApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APIOrdersApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APIOrdersApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APIOrdersApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APIOrdersApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APIOrdersApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APIOrdersApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APIOrdersApi::CancelOrders(const CancelOrdersRequest& Request, const FCancelOrdersDelegate& Delegate /*= FCancelOrdersDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnCancelOrdersResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnCancelOrdersResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelOrdersDelegate Delegate) const +{ + CancelOrdersResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::CreateBid(const CreateBidRequest& Request, const FCreateBidDelegate& Delegate /*= FCreateBidDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnCreateBidResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnCreateBidResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateBidDelegate Delegate) const +{ + CreateBidResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::CreateCollectionBid(const CreateCollectionBidRequest& Request, const FCreateCollectionBidDelegate& Delegate /*= FCreateCollectionBidDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnCreateCollectionBidResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnCreateCollectionBidResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateCollectionBidDelegate Delegate) const +{ + CreateCollectionBidResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::CreateListing(const CreateListingRequest& Request, const FCreateListingDelegate& Delegate /*= FCreateListingDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnCreateListingResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnCreateListingResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateListingDelegate Delegate) const +{ + CreateListingResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::FulfillmentData(const FulfillmentDataRequest& Request, const FFulfillmentDataDelegate& Delegate /*= FFulfillmentDataDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnFulfillmentDataResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnFulfillmentDataResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFulfillmentDataDelegate Delegate) const +{ + FulfillmentDataResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::GetBid(const GetBidRequest& Request, const FGetBidDelegate& Delegate /*= FGetBidDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnGetBidResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnGetBidResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetBidDelegate Delegate) const +{ + GetBidResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::GetCollectionBid(const GetCollectionBidRequest& Request, const FGetCollectionBidDelegate& Delegate /*= FGetCollectionBidDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnGetCollectionBidResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnGetCollectionBidResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCollectionBidDelegate Delegate) const +{ + GetCollectionBidResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::GetListing(const GetListingRequest& Request, const FGetListingDelegate& Delegate /*= FGetListingDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnGetListingResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnGetListingResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetListingDelegate Delegate) const +{ + GetListingResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::GetTrade(const GetTradeRequest& Request, const FGetTradeDelegate& Delegate /*= FGetTradeDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnGetTradeResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnGetTradeResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTradeDelegate Delegate) const +{ + GetTradeResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::ListBids(const ListBidsRequest& Request, const FListBidsDelegate& Delegate /*= FListBidsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnListBidsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnListBidsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListBidsDelegate Delegate) const +{ + ListBidsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::ListCollectionBids(const ListCollectionBidsRequest& Request, const FListCollectionBidsDelegate& Delegate /*= FListCollectionBidsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnListCollectionBidsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnListCollectionBidsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListCollectionBidsDelegate Delegate) const +{ + ListCollectionBidsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::ListListings(const ListListingsRequest& Request, const FListListingsDelegate& Delegate /*= FListListingsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnListListingsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnListListingsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListListingsDelegate Delegate) const +{ + ListListingsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIOrdersApi::ListTrades(const ListTradesRequest& Request, const FListTradesDelegate& Delegate /*= FListTradesDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIOrdersApi::OnListTradesResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIOrdersApi::OnListTradesResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListTradesDelegate Delegate) const +{ + ListTradesResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrdersApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrdersApiOperations.cpp new file mode 100644 index 0000000..8def260 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrdersApiOperations.cpp @@ -0,0 +1,1397 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrdersApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APIOrdersApi::CancelOrdersRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/cancel"), PathParams); + + return Path; +} + +void APIOrdersApi::CancelOrdersRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APICancelOrdersRequestBody); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICancelOrdersRequestBody) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICancelOrdersRequestBody) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrdersApi::CancelOrdersResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("Orders cancellation response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 429: + SetResponseString(TEXT("Too Many Requests (429)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + case 501: + SetResponseString(TEXT("Not Implemented Error (501)")); + break; + } +} + +bool APIOrdersApi::CancelOrdersResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrdersApi::CreateBidRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/bids"), PathParams); + + return Path; +} + +void APIOrdersApi::CreateBidRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APICreateBidRequestBody); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICreateBidRequestBody) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICreateBidRequestBody) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrdersApi::CreateBidResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 201: + SetResponseString(TEXT("Created response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + case 501: + SetResponseString(TEXT("Not Implemented Error (501)")); + break; + } +} + +bool APIOrdersApi::CreateBidResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrdersApi::CreateCollectionBidRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/collection-bids"), PathParams); + + return Path; +} + +void APIOrdersApi::CreateCollectionBidRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APICreateCollectionBidRequestBody); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICreateCollectionBidRequestBody) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICreateCollectionBidRequestBody) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrdersApi::CreateCollectionBidResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 201: + SetResponseString(TEXT("Created response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + case 501: + SetResponseString(TEXT("Not Implemented Error (501)")); + break; + } +} + +bool APIOrdersApi::CreateCollectionBidResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrdersApi::CreateListingRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/listings"), PathParams); + + return Path; +} + +void APIOrdersApi::CreateListingRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APICreateListingRequestBody); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICreateListingRequestBody) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APICreateListingRequestBody) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrdersApi::CreateListingResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 201: + SetResponseString(TEXT("Created response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::CreateListingResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrdersApi::FulfillmentDataRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/fulfillment-data"), PathParams); + + return Path; +} + +void APIOrdersApi::FulfillmentDataRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, APIFulfillmentDataRequest); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APIFulfillmentDataRequest) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APIFulfillmentDataRequest) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIOrdersApi::FulfillmentDataResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("Successful response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::FulfillmentDataResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrdersApi::GetBidRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("bid_id"), FStringFormatArg(ToUrlString(BidId)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/bids/{bid_id}"), PathParams); + + return Path; +} + +void APIOrdersApi::GetBidRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIOrdersApi::GetBidResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::GetBidResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrdersApi::GetCollectionBidRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("collection_bid_id"), FStringFormatArg(ToUrlString(CollectionBidId)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/collection-bids/{collection_bid_id}"), PathParams); + + return Path; +} + +void APIOrdersApi::GetCollectionBidRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIOrdersApi::GetCollectionBidResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::GetCollectionBidResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrdersApi::GetListingRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("listing_id"), FStringFormatArg(ToUrlString(ListingId)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/listings/{listing_id}"), PathParams); + + return Path; +} + +void APIOrdersApi::GetListingRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIOrdersApi::GetListingResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::GetListingResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIOrdersApi::GetTradeRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("trade_id"), FStringFormatArg(ToUrlString(TradeId)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/trades/{trade_id}"), PathParams); + + return Path; +} + +void APIOrdersApi::GetTradeRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIOrdersApi::GetTradeResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::GetTradeResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +inline FString ToString(const APIOrdersApi::ListBidsRequest::SortByEnum& Value) +{ + switch (Value) + { + case APIOrdersApi::ListBidsRequest::SortByEnum::CreatedAt: + return TEXT("created_at"); + case APIOrdersApi::ListBidsRequest::SortByEnum::UpdatedAt: + return TEXT("updated_at"); + case APIOrdersApi::ListBidsRequest::SortByEnum::SellItemAmount: + return TEXT("sell_item_amount"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrdersApi::ListBidsRequest::SortByEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrdersApi::ListBidsRequest::EnumToString(const APIOrdersApi::ListBidsRequest::SortByEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrdersApi::ListBidsRequest::SortByEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("created_at"), APIOrdersApi::ListBidsRequest::SortByEnum::CreatedAt }, + { TEXT("updated_at"), APIOrdersApi::ListBidsRequest::SortByEnum::UpdatedAt }, + { TEXT("sell_item_amount"), APIOrdersApi::ListBidsRequest::SortByEnum::SellItemAmount }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrdersApi::ListBidsRequest::EnumFromString(const FString& EnumAsString, APIOrdersApi::ListBidsRequest::SortByEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrdersApi::ListBidsRequest::SortByEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrdersApi::ListBidsRequest::SortByEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +inline FString ToString(const APIOrdersApi::ListBidsRequest::SortDirectionEnum& Value) +{ + switch (Value) + { + case APIOrdersApi::ListBidsRequest::SortDirectionEnum::Asc: + return TEXT("asc"); + case APIOrdersApi::ListBidsRequest::SortDirectionEnum::Desc: + return TEXT("desc"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrdersApi::ListBidsRequest::SortDirectionEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrdersApi::ListBidsRequest::EnumToString(const APIOrdersApi::ListBidsRequest::SortDirectionEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrdersApi::ListBidsRequest::SortDirectionEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("asc"), APIOrdersApi::ListBidsRequest::SortDirectionEnum::Asc }, + { TEXT("desc"), APIOrdersApi::ListBidsRequest::SortDirectionEnum::Desc }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrdersApi::ListBidsRequest::EnumFromString(const FString& EnumAsString, APIOrdersApi::ListBidsRequest::SortDirectionEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrdersApi::ListBidsRequest::SortDirectionEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrdersApi::ListBidsRequest::SortDirectionEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +FString APIOrdersApi::ListBidsRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/bids"), PathParams); + + TArray QueryParams; + if(Status.IsSet()) + { + QueryParams.Add(FString(TEXT("status=")) + ToUrlString(Status.GetValue())); + } + if(BuyItemContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("buy_item_contract_address=")) + ToUrlString(BuyItemContractAddress.GetValue())); + } + if(SellItemContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("sell_item_contract_address=")) + ToUrlString(SellItemContractAddress.GetValue())); + } + if(AccountAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("account_address=")) + ToUrlString(AccountAddress.GetValue())); + } + if(BuyItemMetadataId.IsSet()) + { + QueryParams.Add(FString(TEXT("buy_item_metadata_id=")) + ToUrlString(BuyItemMetadataId.GetValue())); + } + if(BuyItemTokenId.IsSet()) + { + QueryParams.Add(FString(TEXT("buy_item_token_id=")) + ToUrlString(BuyItemTokenId.GetValue())); + } + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + if(SortBy.IsSet()) + { + QueryParams.Add(FString(TEXT("sort_by=")) + ToUrlString(SortBy.GetValue())); + } + if(SortDirection.IsSet()) + { + QueryParams.Add(FString(TEXT("sort_direction=")) + ToUrlString(SortDirection.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIOrdersApi::ListBidsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIOrdersApi::ListBidsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::ListBidsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +inline FString ToString(const APIOrdersApi::ListCollectionBidsRequest::SortByEnum& Value) +{ + switch (Value) + { + case APIOrdersApi::ListCollectionBidsRequest::SortByEnum::CreatedAt: + return TEXT("created_at"); + case APIOrdersApi::ListCollectionBidsRequest::SortByEnum::UpdatedAt: + return TEXT("updated_at"); + case APIOrdersApi::ListCollectionBidsRequest::SortByEnum::SellItemAmount: + return TEXT("sell_item_amount"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrdersApi::ListCollectionBidsRequest::SortByEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrdersApi::ListCollectionBidsRequest::EnumToString(const APIOrdersApi::ListCollectionBidsRequest::SortByEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrdersApi::ListCollectionBidsRequest::SortByEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("created_at"), APIOrdersApi::ListCollectionBidsRequest::SortByEnum::CreatedAt }, + { TEXT("updated_at"), APIOrdersApi::ListCollectionBidsRequest::SortByEnum::UpdatedAt }, + { TEXT("sell_item_amount"), APIOrdersApi::ListCollectionBidsRequest::SortByEnum::SellItemAmount }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrdersApi::ListCollectionBidsRequest::EnumFromString(const FString& EnumAsString, APIOrdersApi::ListCollectionBidsRequest::SortByEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrdersApi::ListCollectionBidsRequest::SortByEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrdersApi::ListCollectionBidsRequest::SortByEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +inline FString ToString(const APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum& Value) +{ + switch (Value) + { + case APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum::Asc: + return TEXT("asc"); + case APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum::Desc: + return TEXT("desc"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrdersApi::ListCollectionBidsRequest::EnumToString(const APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("asc"), APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum::Asc }, + { TEXT("desc"), APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum::Desc }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrdersApi::ListCollectionBidsRequest::EnumFromString(const FString& EnumAsString, APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrdersApi::ListCollectionBidsRequest::SortDirectionEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +FString APIOrdersApi::ListCollectionBidsRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/collection-bids"), PathParams); + + TArray QueryParams; + if(Status.IsSet()) + { + QueryParams.Add(FString(TEXT("status=")) + ToUrlString(Status.GetValue())); + } + if(BuyItemContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("buy_item_contract_address=")) + ToUrlString(BuyItemContractAddress.GetValue())); + } + if(SellItemContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("sell_item_contract_address=")) + ToUrlString(SellItemContractAddress.GetValue())); + } + if(AccountAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("account_address=")) + ToUrlString(AccountAddress.GetValue())); + } + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + if(SortBy.IsSet()) + { + QueryParams.Add(FString(TEXT("sort_by=")) + ToUrlString(SortBy.GetValue())); + } + if(SortDirection.IsSet()) + { + QueryParams.Add(FString(TEXT("sort_direction=")) + ToUrlString(SortDirection.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIOrdersApi::ListCollectionBidsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIOrdersApi::ListCollectionBidsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::ListCollectionBidsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +inline FString ToString(const APIOrdersApi::ListListingsRequest::BuyItemTypeEnum& Value) +{ + switch (Value) + { + case APIOrdersApi::ListListingsRequest::BuyItemTypeEnum::Native: + return TEXT("NATIVE"); + case APIOrdersApi::ListListingsRequest::BuyItemTypeEnum::ERC20: + return TEXT("ERC20"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrdersApi::ListListingsRequest::BuyItemTypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrdersApi::ListListingsRequest::EnumToString(const APIOrdersApi::ListListingsRequest::BuyItemTypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrdersApi::ListListingsRequest::BuyItemTypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("NATIVE"), APIOrdersApi::ListListingsRequest::BuyItemTypeEnum::Native }, + { TEXT("ERC20"), APIOrdersApi::ListListingsRequest::BuyItemTypeEnum::ERC20 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrdersApi::ListListingsRequest::EnumFromString(const FString& EnumAsString, APIOrdersApi::ListListingsRequest::BuyItemTypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrdersApi::ListListingsRequest::BuyItemTypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrdersApi::ListListingsRequest::BuyItemTypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +inline FString ToString(const APIOrdersApi::ListListingsRequest::SortByEnum& Value) +{ + switch (Value) + { + case APIOrdersApi::ListListingsRequest::SortByEnum::CreatedAt: + return TEXT("created_at"); + case APIOrdersApi::ListListingsRequest::SortByEnum::UpdatedAt: + return TEXT("updated_at"); + case APIOrdersApi::ListListingsRequest::SortByEnum::BuyItemAmount: + return TEXT("buy_item_amount"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrdersApi::ListListingsRequest::SortByEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrdersApi::ListListingsRequest::EnumToString(const APIOrdersApi::ListListingsRequest::SortByEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrdersApi::ListListingsRequest::SortByEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("created_at"), APIOrdersApi::ListListingsRequest::SortByEnum::CreatedAt }, + { TEXT("updated_at"), APIOrdersApi::ListListingsRequest::SortByEnum::UpdatedAt }, + { TEXT("buy_item_amount"), APIOrdersApi::ListListingsRequest::SortByEnum::BuyItemAmount }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrdersApi::ListListingsRequest::EnumFromString(const FString& EnumAsString, APIOrdersApi::ListListingsRequest::SortByEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrdersApi::ListListingsRequest::SortByEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrdersApi::ListListingsRequest::SortByEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +inline FString ToString(const APIOrdersApi::ListListingsRequest::SortDirectionEnum& Value) +{ + switch (Value) + { + case APIOrdersApi::ListListingsRequest::SortDirectionEnum::Asc: + return TEXT("asc"); + case APIOrdersApi::ListListingsRequest::SortDirectionEnum::Desc: + return TEXT("desc"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrdersApi::ListListingsRequest::SortDirectionEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrdersApi::ListListingsRequest::EnumToString(const APIOrdersApi::ListListingsRequest::SortDirectionEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrdersApi::ListListingsRequest::SortDirectionEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("asc"), APIOrdersApi::ListListingsRequest::SortDirectionEnum::Asc }, + { TEXT("desc"), APIOrdersApi::ListListingsRequest::SortDirectionEnum::Desc }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrdersApi::ListListingsRequest::EnumFromString(const FString& EnumAsString, APIOrdersApi::ListListingsRequest::SortDirectionEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrdersApi::ListListingsRequest::SortDirectionEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrdersApi::ListListingsRequest::SortDirectionEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +FString APIOrdersApi::ListListingsRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/orders/listings"), PathParams); + + TArray QueryParams; + if(Status.IsSet()) + { + QueryParams.Add(FString(TEXT("status=")) + ToUrlString(Status.GetValue())); + } + if(SellItemContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("sell_item_contract_address=")) + ToUrlString(SellItemContractAddress.GetValue())); + } + if(BuyItemType.IsSet()) + { + QueryParams.Add(FString(TEXT("buy_item_type=")) + ToUrlString(BuyItemType.GetValue())); + } + if(BuyItemContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("buy_item_contract_address=")) + ToUrlString(BuyItemContractAddress.GetValue())); + } + if(AccountAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("account_address=")) + ToUrlString(AccountAddress.GetValue())); + } + if(SellItemMetadataId.IsSet()) + { + QueryParams.Add(FString(TEXT("sell_item_metadata_id=")) + ToUrlString(SellItemMetadataId.GetValue())); + } + if(SellItemTokenId.IsSet()) + { + QueryParams.Add(FString(TEXT("sell_item_token_id=")) + ToUrlString(SellItemTokenId.GetValue())); + } + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + if(SortBy.IsSet()) + { + QueryParams.Add(FString(TEXT("sort_by=")) + ToUrlString(SortBy.GetValue())); + } + if(SortDirection.IsSet()) + { + QueryParams.Add(FString(TEXT("sort_direction=")) + ToUrlString(SortDirection.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIOrdersApi::ListListingsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIOrdersApi::ListListingsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::ListListingsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +inline FString ToString(const APIOrdersApi::ListTradesRequest::SortByEnum& Value) +{ + switch (Value) + { + case APIOrdersApi::ListTradesRequest::SortByEnum::IndexedAt: + return TEXT("indexed_at"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrdersApi::ListTradesRequest::SortByEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrdersApi::ListTradesRequest::EnumToString(const APIOrdersApi::ListTradesRequest::SortByEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrdersApi::ListTradesRequest::SortByEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("indexed_at"), APIOrdersApi::ListTradesRequest::SortByEnum::IndexedAt }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrdersApi::ListTradesRequest::EnumFromString(const FString& EnumAsString, APIOrdersApi::ListTradesRequest::SortByEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrdersApi::ListTradesRequest::SortByEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrdersApi::ListTradesRequest::SortByEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +inline FString ToString(const APIOrdersApi::ListTradesRequest::SortDirectionEnum& Value) +{ + switch (Value) + { + case APIOrdersApi::ListTradesRequest::SortDirectionEnum::Asc: + return TEXT("asc"); + case APIOrdersApi::ListTradesRequest::SortDirectionEnum::Desc: + return TEXT("desc"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrdersApi::ListTradesRequest::SortDirectionEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrdersApi::ListTradesRequest::EnumToString(const APIOrdersApi::ListTradesRequest::SortDirectionEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrdersApi::ListTradesRequest::SortDirectionEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("asc"), APIOrdersApi::ListTradesRequest::SortDirectionEnum::Asc }, + { TEXT("desc"), APIOrdersApi::ListTradesRequest::SortDirectionEnum::Desc }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrdersApi::ListTradesRequest::EnumFromString(const FString& EnumAsString, APIOrdersApi::ListTradesRequest::SortDirectionEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrdersApi::ListTradesRequest::SortDirectionEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrdersApi::ListTradesRequest::SortDirectionEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +FString APIOrdersApi::ListTradesRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/trades"), PathParams); + + TArray QueryParams; + if(AccountAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("account_address=")) + ToUrlString(AccountAddress.GetValue())); + } + if(SellItemContractAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("sell_item_contract_address=")) + ToUrlString(SellItemContractAddress.GetValue())); + } + if(FromIndexedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_indexed_at=")) + ToUrlString(FromIndexedAt.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + if(SortBy.IsSet()) + { + QueryParams.Add(FString(TEXT("sort_by=")) + ToUrlString(SortBy.GetValue())); + } + if(SortDirection.IsSet()) + { + QueryParams.Add(FString(TEXT("sort_direction=")) + ToUrlString(SortDirection.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIOrdersApi::ListTradesRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIOrdersApi::ListTradesResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK response.")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIOrdersApi::ListTradesResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrganisationTier.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrganisationTier.cpp new file mode 100644 index 0000000..dfefde4 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIOrganisationTier.cpp @@ -0,0 +1,95 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIOrganisationTier.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIOrganisationTier::Values& Value) +{ + switch (Value) + { + case APIOrganisationTier::Values::Common: + return TEXT("common"); + case APIOrganisationTier::Values::Uncommon: + return TEXT("uncommon"); + case APIOrganisationTier::Values::Rare: + return TEXT("rare"); + case APIOrganisationTier::Values::Epic: + return TEXT("epic"); + case APIOrganisationTier::Values::Legendary: + return TEXT("legendary"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIOrganisationTier::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIOrganisationTier::EnumToString(const APIOrganisationTier::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIOrganisationTier::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("common"), APIOrganisationTier::Values::Common }, + { TEXT("uncommon"), APIOrganisationTier::Values::Uncommon }, + { TEXT("rare"), APIOrganisationTier::Values::Rare }, + { TEXT("epic"), APIOrganisationTier::Values::Epic }, + { TEXT("legendary"), APIOrganisationTier::Values::Legendary }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIOrganisationTier::EnumFromString(const FString& EnumAsString, APIOrganisationTier::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIOrganisationTier::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIOrganisationTier::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIOrganisationTier::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIOrganisationTier::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIPage.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPage.cpp new file mode 100644 index 0000000..77401bb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPage.cpp @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPage.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIPage::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (PreviousCursor.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("previous_cursor")); WriteJsonValue(Writer, PreviousCursor.GetValue()); + } + if (NextCursor.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("next_cursor")); WriteJsonValue(Writer, NextCursor.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIPage::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("previous_cursor"), PreviousCursor); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("next_cursor"), NextCursor); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportApi.cpp new file mode 100644 index 0000000..434a170 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportApi.cpp @@ -0,0 +1,163 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPassportApi.h" + +#include "APIPassportApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APIPassportApi::APIPassportApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APIPassportApi::~APIPassportApi() {} + +void APIPassportApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APIPassportApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APIPassportApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APIPassportApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APIPassportApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APIPassportApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APIPassportApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APIPassportApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APIPassportApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APIPassportApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APIPassportApi::GetLinkedAddresses(const GetLinkedAddressesRequest& Request, const FGetLinkedAddressesDelegate& Delegate /*= FGetLinkedAddressesDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIPassportApi::OnGetLinkedAddressesResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIPassportApi::OnGetLinkedAddressesResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLinkedAddressesDelegate Delegate) const +{ + GetLinkedAddressesResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportApiOperations.cpp new file mode 100644 index 0000000..5c14d0c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportApiOperations.cpp @@ -0,0 +1,81 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPassportApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APIPassportApi::GetLinkedAddressesRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("user_id"), FStringFormatArg(ToUrlString(UserId)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/passport/users/{user_id}/linked-addresses"), PathParams); + + return Path; +} + +void APIPassportApi::GetLinkedAddressesRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIPassportApi::GetLinkedAddressesResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("User's list of linked addresses response")); + break; + case 400: + SetResponseString(TEXT("BadRequestError")); + break; + case 401: + SetResponseString(TEXT("UnauthorizedError")); + break; + case 403: + SetResponseString(TEXT("ForbiddenError")); + break; + case 429: + SetResponseString(TEXT("TooManyRequestsError")); + break; + case 500: + SetResponseString(TEXT("InternalServerError")); + break; + case 0: + default: + SetResponseString(TEXT("unexpected error")); + break; + } +} + +bool APIPassportApi::GetLinkedAddressesResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportProfileApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportProfileApi.cpp new file mode 100644 index 0000000..da2252b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportProfileApi.cpp @@ -0,0 +1,190 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPassportProfileApi.h" + +#include "APIPassportProfileApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APIPassportProfileApi::APIPassportProfileApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APIPassportProfileApi::~APIPassportProfileApi() {} + +void APIPassportProfileApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APIPassportProfileApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APIPassportProfileApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APIPassportProfileApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APIPassportProfileApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APIPassportProfileApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APIPassportProfileApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APIPassportProfileApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APIPassportProfileApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APIPassportProfileApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APIPassportProfileApi::GetUserInfo(const GetUserInfoRequest& Request, const FGetUserInfoDelegate& Delegate /*= FGetUserInfoDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIPassportProfileApi::OnGetUserInfoResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIPassportProfileApi::OnGetUserInfoResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInfoDelegate Delegate) const +{ + GetUserInfoResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIPassportProfileApi::LinkWalletV2(const LinkWalletV2Request& Request, const FLinkWalletV2Delegate& Delegate /*= FLinkWalletV2Delegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIPassportProfileApi::OnLinkWalletV2Response, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIPassportProfileApi::OnLinkWalletV2Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkWalletV2Delegate Delegate) const +{ + LinkWalletV2Response Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportProfileApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportProfileApiOperations.cpp new file mode 100644 index 0000000..f604023 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPassportProfileApiOperations.cpp @@ -0,0 +1,138 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPassportProfileApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APIPassportProfileApi::GetUserInfoRequest::ComputePath() const +{ + FString Path(TEXT("/passport-profile/v1/user/info")); + return Path; +} + +void APIPassportProfileApi::GetUserInfoRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIPassportProfileApi::GetUserInfoResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("Passport user's info")); + break; + case 401: + SetResponseString(TEXT("UnauthorizedError")); + break; + case 500: + SetResponseString(TEXT("InternalServerError")); + break; + case 0: + default: + SetResponseString(TEXT("unexpected error")); + break; + } +} + +bool APIPassportProfileApi::GetUserInfoResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIPassportProfileApi::LinkWalletV2Request::ComputePath() const +{ + FString Path(TEXT("/passport-profile/v2/linked-wallets")); + return Path; +} + +void APIPassportProfileApi::LinkWalletV2Request::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + if (APILinkWalletV2Request.IsSet()) + { + WriteJsonValue(Writer, APILinkWalletV2Request.GetValue()); + } + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APILinkWalletV2Request) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Body parameter (APILinkWalletV2Request) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void APIPassportProfileApi::LinkWalletV2Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK")); + break; + case 400: + SetResponseString(TEXT("BadRequestError")); + break; + case 401: + SetResponseString(TEXT("UnauthorizedError")); + break; + case 403: + SetResponseString(TEXT("ForbiddenError")); + break; + case 500: + SetResponseString(TEXT("InternalServerError")); + break; + } +} + +bool APIPassportProfileApi::LinkWalletV2Response::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIPendingOrderStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPendingOrderStatus.cpp new file mode 100644 index 0000000..4adbd62 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPendingOrderStatus.cpp @@ -0,0 +1,97 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPendingOrderStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIPendingOrderStatus::NameEnum& Value) +{ + switch (Value) + { + case APIPendingOrderStatus::NameEnum::Pending: + return TEXT("PENDING"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIPendingOrderStatus::NameEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIPendingOrderStatus::EnumToString(const APIPendingOrderStatus::NameEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIPendingOrderStatus::NameEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("PENDING"), APIPendingOrderStatus::NameEnum::Pending }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIPendingOrderStatus::EnumFromString(const FString& EnumAsString, APIPendingOrderStatus::NameEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIPendingOrderStatus::NameEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIPendingOrderStatus::NameEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIPendingOrderStatus::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteIdentifierPrefix(TEXT("evaluated")); WriteJsonValue(Writer, Evaluated); + Writer->WriteIdentifierPrefix(TEXT("started")); WriteJsonValue(Writer, Started); + Writer->WriteObjectEnd(); +} + +bool APIPendingOrderStatus::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("evaluated"), Evaluated); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("started"), Started); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIPricingApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPricingApi.cpp new file mode 100644 index 0000000..c7cae58 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPricingApi.cpp @@ -0,0 +1,190 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPricingApi.h" + +#include "APIPricingApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APIPricingApi::APIPricingApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APIPricingApi::~APIPricingApi() {} + +void APIPricingApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APIPricingApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APIPricingApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APIPricingApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APIPricingApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APIPricingApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APIPricingApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APIPricingApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APIPricingApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APIPricingApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APIPricingApi::QuotesForNFTs(const QuotesForNFTsRequest& Request, const FQuotesForNFTsDelegate& Delegate /*= FQuotesForNFTsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIPricingApi::OnQuotesForNFTsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIPricingApi::OnQuotesForNFTsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FQuotesForNFTsDelegate Delegate) const +{ + QuotesForNFTsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIPricingApi::QuotesForStacks(const QuotesForStacksRequest& Request, const FQuotesForStacksDelegate& Delegate /*= FQuotesForStacksDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIPricingApi::OnQuotesForStacksResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIPricingApi::OnQuotesForStacksResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FQuotesForStacksDelegate Delegate) const +{ + QuotesForStacksResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIPricingApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPricingApiOperations.cpp new file mode 100644 index 0000000..7b26366 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIPricingApiOperations.cpp @@ -0,0 +1,152 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIPricingApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APIPricingApi::QuotesForNFTsRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) } }; + + FString Path = FString::Format(TEXT("/experimental/chains/{chain_name}/quotes/{contract_address}/nfts"), PathParams); + + TArray QueryParams; + QueryParams.Add(CollectionToUrlString_multi(TokenId, TEXT("token_id"))); + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIPricingApi::QuotesForNFTsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIPricingApi::QuotesForNFTsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 429: + SetResponseString(TEXT("Too Many Requests (429)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIPricingApi::QuotesForNFTsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIPricingApi::QuotesForStacksRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) }, + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) } }; + + FString Path = FString::Format(TEXT("/experimental/chains/{chain_name}/quotes/{contract_address}/stacks"), PathParams); + + TArray QueryParams; + QueryParams.Add(CollectionToUrlString_multi(StackId, TEXT("stack_id"))); + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIPricingApi::QuotesForStacksRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIPricingApi::QuotesForStacksResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 429: + SetResponseString(TEXT("Too Many Requests (429)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIPricingApi::QuotesForStacksResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIProtocolData.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIProtocolData.cpp new file mode 100644 index 0000000..b9bb350 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIProtocolData.cpp @@ -0,0 +1,104 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIProtocolData.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIProtocolData::OrderTypeEnum& Value) +{ + switch (Value) + { + case APIProtocolData::OrderTypeEnum::FullRestricted: + return TEXT("FULL_RESTRICTED"); + case APIProtocolData::OrderTypeEnum::PartialRestricted: + return TEXT("PARTIAL_RESTRICTED"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIProtocolData::OrderTypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIProtocolData::EnumToString(const APIProtocolData::OrderTypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIProtocolData::OrderTypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("FULL_RESTRICTED"), APIProtocolData::OrderTypeEnum::FullRestricted }, + { TEXT("PARTIAL_RESTRICTED"), APIProtocolData::OrderTypeEnum::PartialRestricted }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIProtocolData::EnumFromString(const FString& EnumAsString, APIProtocolData::OrderTypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIProtocolData::OrderTypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIProtocolData::OrderTypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIProtocolData::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("order_type")); WriteJsonValue(Writer, OrderType); + Writer->WriteIdentifierPrefix(TEXT("counter")); WriteJsonValue(Writer, Counter); + Writer->WriteIdentifierPrefix(TEXT("zone_address")); WriteJsonValue(Writer, ZoneAddress); + Writer->WriteIdentifierPrefix(TEXT("seaport_address")); WriteJsonValue(Writer, SeaportAddress); + Writer->WriteIdentifierPrefix(TEXT("seaport_version")); WriteJsonValue(Writer, SeaportVersion); + Writer->WriteObjectEnd(); +} + +bool APIProtocolData::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_type"), OrderType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("counter"), Counter); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("zone_address"), ZoneAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("seaport_address"), SeaportAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("seaport_version"), SeaportVersion); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIQuotesForNFTsResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIQuotesForNFTsResult.cpp new file mode 100644 index 0000000..649af54 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIQuotesForNFTsResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIQuotesForNFTsResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIQuotesForNFTsResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIQuotesForNFTsResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIQuotesForStacksResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIQuotesForStacksResult.cpp new file mode 100644 index 0000000..19d9df6 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIQuotesForStacksResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIQuotesForStacksResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIQuotesForStacksResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APIQuotesForStacksResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshCollectionMetadataRequest.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshCollectionMetadataRequest.cpp new file mode 100644 index 0000000..675e274 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshCollectionMetadataRequest.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIRefreshCollectionMetadataRequest.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIRefreshCollectionMetadataRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("collection_metadata")); WriteJsonValue(Writer, CollectionMetadata); + Writer->WriteObjectEnd(); +} + +bool APIRefreshCollectionMetadataRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("collection_metadata"), CollectionMetadata); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshCollectionMetadataResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshCollectionMetadataResult.cpp new file mode 100644 index 0000000..08cf5bb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshCollectionMetadataResult.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIRefreshCollectionMetadataResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIRefreshCollectionMetadataResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("collection_metadata")); WriteJsonValue(Writer, CollectionMetadata); + Writer->WriteObjectEnd(); +} + +bool APIRefreshCollectionMetadataResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("collection_metadata"), CollectionMetadata); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshMetadataByID.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshMetadataByID.cpp new file mode 100644 index 0000000..9742750 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshMetadataByID.cpp @@ -0,0 +1,78 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIRefreshMetadataByID.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIRefreshMetadataByID::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_url")); WriteJsonValue(Writer, ExternalUrl.GetValue()); + } + if (AnimationUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("animation_url")); WriteJsonValue(Writer, AnimationUrl.GetValue()); + } + if (YoutubeUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("youtube_url")); WriteJsonValue(Writer, YoutubeUrl.GetValue()); + } + if (Attributes.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("attributes")); WriteJsonValue(Writer, Attributes.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("metadata_id")); WriteJsonValue(Writer, MetadataId); + Writer->WriteObjectEnd(); +} + +bool APIRefreshMetadataByID::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_url"), ExternalUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("animation_url"), AnimationUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("youtube_url"), YoutubeUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("attributes"), Attributes); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("metadata_id"), MetadataId); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshMetadataByIDRequest.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshMetadataByIDRequest.cpp new file mode 100644 index 0000000..be945ad --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshMetadataByIDRequest.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIRefreshMetadataByIDRequest.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIRefreshMetadataByIDRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("metadata")); WriteJsonValue(Writer, Metadata); + Writer->WriteObjectEnd(); +} + +bool APIRefreshMetadataByIDRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("metadata"), Metadata); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshMetadataByTokenID.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshMetadataByTokenID.cpp new file mode 100644 index 0000000..b89e1ca --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshMetadataByTokenID.cpp @@ -0,0 +1,78 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIRefreshMetadataByTokenID.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIRefreshMetadataByTokenID::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_url")); WriteJsonValue(Writer, ExternalUrl.GetValue()); + } + if (AnimationUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("animation_url")); WriteJsonValue(Writer, AnimationUrl.GetValue()); + } + if (YoutubeUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("youtube_url")); WriteJsonValue(Writer, YoutubeUrl.GetValue()); + } + if (Attributes.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("attributes")); WriteJsonValue(Writer, Attributes.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId); + Writer->WriteObjectEnd(); +} + +bool APIRefreshMetadataByTokenID::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_url"), ExternalUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("animation_url"), AnimationUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("youtube_url"), YoutubeUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("attributes"), Attributes); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshNFTMetadataByTokenIDRequest.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshNFTMetadataByTokenIDRequest.cpp new file mode 100644 index 0000000..763ff93 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshNFTMetadataByTokenIDRequest.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIRefreshNFTMetadataByTokenIDRequest.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIRefreshNFTMetadataByTokenIDRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("nft_metadata")); WriteJsonValue(Writer, NftMetadata); + Writer->WriteObjectEnd(); +} + +bool APIRefreshNFTMetadataByTokenIDRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("nft_metadata"), NftMetadata); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshableNFTAttributes.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshableNFTAttributes.cpp new file mode 100644 index 0000000..bef6ff1 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIRefreshableNFTAttributes.cpp @@ -0,0 +1,76 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIRefreshableNFTAttributes.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIRefreshableNFTAttributes::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_url")); WriteJsonValue(Writer, ExternalUrl.GetValue()); + } + if (AnimationUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("animation_url")); WriteJsonValue(Writer, AnimationUrl.GetValue()); + } + if (YoutubeUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("youtube_url")); WriteJsonValue(Writer, YoutubeUrl.GetValue()); + } + if (Attributes.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("attributes")); WriteJsonValue(Writer, Attributes.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIRefreshableNFTAttributes::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_url"), ExternalUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("animation_url"), AnimationUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("youtube_url"), YoutubeUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("attributes"), Attributes); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APISaleFee.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APISaleFee.cpp new file mode 100644 index 0000000..c0bed2d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APISaleFee.cpp @@ -0,0 +1,106 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISaleFee.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APISaleFee::TypeEnum& Value) +{ + switch (Value) + { + case APISaleFee::TypeEnum::Royalty: + return TEXT("ROYALTY"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APISaleFee::TypeEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APISaleFee::EnumToString(const APISaleFee::TypeEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APISaleFee::TypeEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("ROYALTY"), APISaleFee::TypeEnum::Royalty }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APISaleFee::EnumFromString(const FString& EnumAsString, APISaleFee::TypeEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APISaleFee::TypeEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APISaleFee::TypeEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APISaleFee::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Amount.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount.GetValue()); + } + if (Type.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type.GetValue()); + } + if (Recipient.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("recipient")); WriteJsonValue(Writer, Recipient.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APISaleFee::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("recipient"), Recipient); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APISalePayment.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APISalePayment.cpp new file mode 100644 index 0000000..9bd04d8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APISalePayment.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISalePayment.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APISalePayment::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("token")); WriteJsonValue(Writer, Token); + Writer->WriteIdentifierPrefix(TEXT("price_excluding_fees")); WriteJsonValue(Writer, PriceExcludingFees); + Writer->WriteIdentifierPrefix(TEXT("price_including_fees")); WriteJsonValue(Writer, PriceIncludingFees); + Writer->WriteIdentifierPrefix(TEXT("fees")); WriteJsonValue(Writer, Fees); + Writer->WriteObjectEnd(); +} + +bool APISalePayment::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token"), Token); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("price_excluding_fees"), PriceExcludingFees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("price_including_fees"), PriceIncludingFees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fees"), Fees); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APISalePaymentToken.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APISalePaymentToken.cpp new file mode 100644 index 0000000..36b1f06 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APISalePaymentToken.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISalePaymentToken.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APISalePaymentToken::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol); + Writer->WriteObjectEnd(); +} + +bool APISalePaymentToken::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APISearchNFTsResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APISearchNFTsResult.cpp new file mode 100644 index 0000000..08ea510 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APISearchNFTsResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISearchNFTsResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APISearchNFTsResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APISearchNFTsResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APISearchStacksResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APISearchStacksResult.cpp new file mode 100644 index 0000000..c157209 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APISearchStacksResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISearchStacksResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APISearchStacksResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteIdentifierPrefix(TEXT("page")); WriteJsonValue(Writer, Page); + Writer->WriteObjectEnd(); +} + +bool APISearchStacksResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("page"), Page); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APISignCraftingRequest.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APISignCraftingRequest.cpp new file mode 100644 index 0000000..2fe8648 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APISignCraftingRequest.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISignCraftingRequest.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APISignCraftingRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("multi_caller")); WriteJsonValue(Writer, MultiCaller); + Writer->WriteIdentifierPrefix(TEXT("reference_id")); WriteJsonValue(Writer, ReferenceId); + Writer->WriteIdentifierPrefix(TEXT("calls")); WriteJsonValue(Writer, Calls); + Writer->WriteIdentifierPrefix(TEXT("expires_at")); WriteJsonValue(Writer, ExpiresAt); + Writer->WriteObjectEnd(); +} + +bool APISignCraftingRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("multi_caller"), MultiCaller); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("reference_id"), ReferenceId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("calls"), Calls); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("expires_at"), ExpiresAt); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APISignCraftingRequestMultiCaller.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APISignCraftingRequestMultiCaller.cpp new file mode 100644 index 0000000..585e30d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APISignCraftingRequestMultiCaller.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISignCraftingRequestMultiCaller.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APISignCraftingRequestMultiCaller::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("address")); WriteJsonValue(Writer, Address); + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteIdentifierPrefix(TEXT("version")); WriteJsonValue(Writer, Version); + Writer->WriteObjectEnd(); +} + +bool APISignCraftingRequestMultiCaller::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("address"), Address); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("version"), Version); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APISignCraftingResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APISignCraftingResult.cpp new file mode 100644 index 0000000..3ddbbb9 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APISignCraftingResult.cpp @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APISignCraftingResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APISignCraftingResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("signer_address")); WriteJsonValue(Writer, SignerAddress); + Writer->WriteIdentifierPrefix(TEXT("signature")); WriteJsonValue(Writer, Signature); + Writer->WriteObjectEnd(); +} + +bool APISignCraftingResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signer_address"), SignerAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("signature"), Signature); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIStack.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStack.cpp new file mode 100644 index 0000000..7f5f485 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStack.cpp @@ -0,0 +1,88 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIStack.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIStack::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("stack_id")); WriteJsonValue(Writer, StackId); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("created_at")); WriteJsonValue(Writer, CreatedAt); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (Image.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image")); WriteJsonValue(Writer, Image.GetValue()); + } + if (ExternalUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("external_url")); WriteJsonValue(Writer, ExternalUrl.GetValue()); + } + if (AnimationUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("animation_url")); WriteJsonValue(Writer, AnimationUrl.GetValue()); + } + if (YoutubeUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("youtube_url")); WriteJsonValue(Writer, YoutubeUrl.GetValue()); + } + if (Attributes.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("attributes")); WriteJsonValue(Writer, Attributes.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIStack::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("stack_id"), StackId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_at"), CreatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image"), Image); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("external_url"), ExternalUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("animation_url"), AnimationUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("youtube_url"), YoutubeUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("attributes"), Attributes); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIStackBundle.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStackBundle.cpp new file mode 100644 index 0000000..84638b0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStackBundle.cpp @@ -0,0 +1,52 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIStackBundle.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIStackBundle::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("stack")); WriteJsonValue(Writer, Stack); + Writer->WriteIdentifierPrefix(TEXT("stack_count")); WriteJsonValue(Writer, StackCount); + if (Market.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("market")); WriteJsonValue(Writer, Market.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("listings")); WriteJsonValue(Writer, Listings); + Writer->WriteObjectEnd(); +} + +bool APIStackBundle::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("stack"), Stack); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("stack_count"), StackCount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("market"), Market); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("listings"), Listings); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIStackQuoteResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStackQuoteResult.cpp new file mode 100644 index 0000000..5f20e77 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStackQuoteResult.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIStackQuoteResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIStackQuoteResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("stack_id")); WriteJsonValue(Writer, StackId); + Writer->WriteIdentifierPrefix(TEXT("market_stack")); WriteJsonValue(Writer, MarketStack); + Writer->WriteIdentifierPrefix(TEXT("market_collection")); WriteJsonValue(Writer, MarketCollection); + Writer->WriteObjectEnd(); +} + +bool APIStackQuoteResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("stack_id"), StackId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("market_stack"), MarketStack); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("market_collection"), MarketCollection); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIStacksApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStacksApi.cpp new file mode 100644 index 0000000..87eb741 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStacksApi.cpp @@ -0,0 +1,217 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIStacksApi.h" + +#include "APIStacksApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APIStacksApi::APIStacksApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APIStacksApi::~APIStacksApi() {} + +void APIStacksApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APIStacksApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APIStacksApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APIStacksApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APIStacksApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APIStacksApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APIStacksApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APIStacksApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APIStacksApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APIStacksApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APIStacksApi::ListStacks(const ListStacksRequest& Request, const FListStacksDelegate& Delegate /*= FListStacksDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIStacksApi::OnListStacksResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIStacksApi::OnListStacksResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListStacksDelegate Delegate) const +{ + ListStacksResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIStacksApi::SearchNFTs(const SearchNFTsRequest& Request, const FSearchNFTsDelegate& Delegate /*= FSearchNFTsDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIStacksApi::OnSearchNFTsResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIStacksApi::OnSearchNFTsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSearchNFTsDelegate Delegate) const +{ + SearchNFTsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APIStacksApi::SearchStacks(const SearchStacksRequest& Request, const FSearchStacksDelegate& Delegate /*= FSearchStacksDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APIStacksApi::OnSearchStacksResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APIStacksApi::OnSearchStacksResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSearchStacksDelegate Delegate) const +{ + SearchStacksResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIStacksApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStacksApiOperations.cpp new file mode 100644 index 0000000..d435ff3 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIStacksApiOperations.cpp @@ -0,0 +1,302 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIStacksApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APIStacksApi::ListStacksRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/experimental/chains/{chain_name}/stacks"), PathParams); + + TArray QueryParams; + QueryParams.Add(CollectionToUrlString_multi(StackId, TEXT("stack_id"))); + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIStacksApi::ListStacksRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIStacksApi::ListStacksResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 429: + SetResponseString(TEXT("Too Many Requests (429)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIStacksApi::ListStacksResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APIStacksApi::SearchNFTsRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/experimental/chains/{chain_name}/search/nfts"), PathParams); + + TArray QueryParams; + QueryParams.Add(CollectionToUrlString_multi(ContractAddress, TEXT("contract_address"))); + if(AccountAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("account_address=")) + ToUrlString(AccountAddress.GetValue())); + } + if(StackId.IsSet()) + { + QueryParams.Add(CollectionToUrlString_multi(StackId.GetValue(), TEXT("stack_id"))); + } + if(OnlyIncludeOwnerListings.IsSet()) + { + QueryParams.Add(FString(TEXT("only_include_owner_listings=")) + ToUrlString(OnlyIncludeOwnerListings.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIStacksApi::SearchNFTsRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIStacksApi::SearchNFTsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 429: + SetResponseString(TEXT("Too Many Requests (429)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIStacksApi::SearchNFTsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +inline FString ToString(const APIStacksApi::SearchStacksRequest::SortByEnum& Value) +{ + switch (Value) + { + case APIStacksApi::SearchStacksRequest::SortByEnum::CheapestFirst: + return TEXT("cheapest_first"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIStacksApi::SearchStacksRequest::SortByEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIStacksApi::SearchStacksRequest::EnumToString(const APIStacksApi::SearchStacksRequest::SortByEnum& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIStacksApi::SearchStacksRequest::SortByEnum& Value) +{ + static TMap StringToEnum = { + { TEXT("cheapest_first"), APIStacksApi::SearchStacksRequest::SortByEnum::CheapestFirst }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIStacksApi::SearchStacksRequest::EnumFromString(const FString& EnumAsString, APIStacksApi::SearchStacksRequest::SortByEnum& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIStacksApi::SearchStacksRequest::SortByEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIStacksApi::SearchStacksRequest::SortByEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +FString APIStacksApi::SearchStacksRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/experimental/chains/{chain_name}/search/stacks"), PathParams); + + TArray QueryParams; + QueryParams.Add(CollectionToUrlString_multi(ContractAddress, TEXT("contract_address"))); + if(AccountAddress.IsSet()) + { + QueryParams.Add(FString(TEXT("account_address=")) + ToUrlString(AccountAddress.GetValue())); + } + if(OnlyIncludeOwnerListings.IsSet()) + { + QueryParams.Add(FString(TEXT("only_include_owner_listings=")) + ToUrlString(OnlyIncludeOwnerListings.GetValue())); + } + if(OnlyIfHasActiveListings.IsSet()) + { + QueryParams.Add(FString(TEXT("only_if_has_active_listings=")) + ToUrlString(OnlyIfHasActiveListings.GetValue())); + } + if(Trait.IsSet()) + { + QueryParams.Add(FString(TEXT("trait=")) + ToUrlString(Trait.GetValue())); + } + if(Keyword.IsSet()) + { + QueryParams.Add(FString(TEXT("keyword=")) + ToUrlString(Keyword.GetValue())); + } + if(SortBy.IsSet()) + { + QueryParams.Add(FString(TEXT("sort_by=")) + ToUrlString(SortBy.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APIStacksApi::SearchStacksRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APIStacksApi::SearchStacksResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("200 response")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 401: + SetResponseString(TEXT("Unauthorised Request (401)")); + break; + case 403: + SetResponseString(TEXT("Forbidden Request (403)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 429: + SetResponseString(TEXT("Too Many Requests (429)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APIStacksApi::SearchStacksResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIToken.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIToken.cpp new file mode 100644 index 0000000..271c1a5 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIToken.cpp @@ -0,0 +1,86 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIToken.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIToken::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + if (RootContractAddress.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("root_contract_address")); WriteJsonValue(Writer, RootContractAddress.GetValue()); + } + if (RootChainId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("root_chain_id")); WriteJsonValue(Writer, RootChainId.GetValue()); + } + if (BridgeUsed.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("bridge_used")); WriteJsonValue(Writer, BridgeUsed.GetValue()); + } + if (Symbol.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol.GetValue()); + } + if (Decimals.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("decimals")); WriteJsonValue(Writer, Decimals.GetValue()); + } + if (ImageUrl.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("image_url")); WriteJsonValue(Writer, ImageUrl.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("verification_status")); WriteJsonValue(Writer, VerificationStatus); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + Writer->WriteIdentifierPrefix(TEXT("is_canonical")); WriteJsonValue(Writer, IsCanonical); + Writer->WriteObjectEnd(); +} + +bool APIToken::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("root_contract_address"), RootContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("root_chain_id"), RootChainId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("bridge_used"), BridgeUsed); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("decimals"), Decimals); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("image_url"), ImageUrl); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("verification_status"), VerificationStatus); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("is_canonical"), IsCanonical); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APITokenContractType.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APITokenContractType.cpp new file mode 100644 index 0000000..e37de72 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APITokenContractType.cpp @@ -0,0 +1,83 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITokenContractType.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APITokenContractType::Values& Value) +{ + switch (Value) + { + case APITokenContractType::Values::ERC20: + return TEXT("ERC20"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APITokenContractType::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APITokenContractType::EnumToString(const APITokenContractType::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APITokenContractType::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC20"), APITokenContractType::Values::ERC20 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APITokenContractType::EnumFromString(const FString& EnumAsString, APITokenContractType::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APITokenContractType::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APITokenContractType::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APITokenContractType::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APITokenContractType::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APITokensApi.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APITokensApi.cpp new file mode 100644 index 0000000..48679bb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APITokensApi.cpp @@ -0,0 +1,190 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITokensApi.h" + +#include "APITokensApiOperations.h" +#include "ImmutablezkEVMAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace ImmutablezkEVMAPI +{ + +APITokensApi::APITokensApi() +: Url(TEXT("https://api.sandbox.immutable.com")) +{ +} + +APITokensApi::~APITokensApi() {} + +void APITokensApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void APITokensApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void APITokensApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool APITokensApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("APITokensApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void APITokensApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& APITokensApi::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("APITokensApi: RetryManager is null. You may have meant to set it with SetHttpRetryManager first, or you may not be using a custom RetryManager at all.")) + return *RetryManager; +} + +FHttpRequestRef APITokensApi::CreateHttpRequest(const Request& Request) const +{ + if (!Request.GetRetryParams().IsSet()) + { + return FHttpModule::Get().CreateRequest(); + } + else + { + if (!RetryManager) + { + // Create default retry manager if none was specified + DefaultRetryManager = MakeUnique(6, 60); + RetryManager = DefaultRetryManager.Get(); + } + + const HttpRetryParams& Params = Request.GetRetryParams().GetValue(); + return RetryManager->CreateRequest(Params.RetryLimitCountOverride, Params.RetryTimeoutRelativeSecondsOverride, Params.RetryResponseCodes, Params.RetryVerbs, Params.RetryDomains); + } +} + +void APITokensApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType.StartsWith(TEXT("application/json")) || ContentType.StartsWith("text/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType.StartsWith(TEXT("text/plain"))) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +FHttpRequestPtr APITokensApi::GetERC20Token(const GetERC20TokenRequest& Request, const FGetERC20TokenDelegate& Delegate /*= FGetERC20TokenDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APITokensApi::OnGetERC20TokenResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APITokensApi::OnGetERC20TokenResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetERC20TokenDelegate Delegate) const +{ + GetERC20TokenResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +FHttpRequestPtr APITokensApi::ListERC20Tokens(const ListERC20TokensRequest& Request, const FListERC20TokensDelegate& Delegate /*= FListERC20TokensDelegate()*/) const +{ + if (!IsValid()) + return nullptr; + + FHttpRequestRef HttpRequest = CreateHttpRequest(Request); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &APITokensApi::OnListERC20TokensResponse, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void APITokensApi::OnListERC20TokensResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListERC20TokensDelegate Delegate) const +{ + ListERC20TokensResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APITokensApiOperations.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APITokensApiOperations.cpp new file mode 100644 index 0000000..5802a50 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APITokensApiOperations.cpp @@ -0,0 +1,139 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITokensApiOperations.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace ImmutablezkEVMAPI +{ + +FString APITokensApi::GetERC20TokenRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("contract_address"), FStringFormatArg(ToUrlString(ContractAddress)) }, + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/tokens/{contract_address}"), PathParams); + + return Path; +} + +void APITokensApi::GetERC20TokenRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APITokensApi::GetERC20TokenResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APITokensApi::GetERC20TokenResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString APITokensApi::ListERC20TokensRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("chain_name"), FStringFormatArg(ToUrlString(ChainName)) } }; + + FString Path = FString::Format(TEXT("/v1/chains/{chain_name}/tokens"), PathParams); + + TArray QueryParams; + if(FromUpdatedAt.IsSet()) + { + QueryParams.Add(FString(TEXT("from_updated_at=")) + ToUrlString(FromUpdatedAt.GetValue())); + } + if(VerificationStatus.IsSet()) + { + QueryParams.Add(CollectionToUrlString_multi(VerificationStatus.GetValue(), TEXT("verification_status"))); + } + if(IsCanonical.IsSet()) + { + QueryParams.Add(FString(TEXT("is_canonical=")) + ToUrlString(IsCanonical.GetValue())); + } + if(PageCursor.IsSet()) + { + QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); + } + if(PageSize.IsSet()) + { + QueryParams.Add(FString(TEXT("page_size=")) + ToUrlString(PageSize.GetValue())); + } + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void APITokensApi::ListERC20TokensRequest::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + +} + +void APITokensApi::ListERC20TokensResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + SetResponseString(TEXT("OK")); + break; + case 400: + SetResponseString(TEXT("Bad Request (400)")); + break; + case 404: + SetResponseString(TEXT("The specified resource was not found (404)")); + break; + case 500: + SetResponseString(TEXT("Internal Server Error (500)")); + break; + } +} + +bool APITokensApi::ListERC20TokensResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APITrade.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APITrade.cpp new file mode 100644 index 0000000..51e6632 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APITrade.cpp @@ -0,0 +1,70 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITrade.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APITrade::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("buy")); WriteJsonValue(Writer, Buy); + Writer->WriteIdentifierPrefix(TEXT("buyer_address")); WriteJsonValue(Writer, BuyerAddress); + Writer->WriteIdentifierPrefix(TEXT("buyer_fees")); WriteJsonValue(Writer, BuyerFees); + Writer->WriteIdentifierPrefix(TEXT("fees")); WriteJsonValue(Writer, Fees); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("order_id")); WriteJsonValue(Writer, OrderId); + if (BlockchainMetadata.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("blockchain_metadata")); WriteJsonValue(Writer, BlockchainMetadata.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("indexed_at")); WriteJsonValue(Writer, IndexedAt); + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id); + Writer->WriteIdentifierPrefix(TEXT("sell")); WriteJsonValue(Writer, Sell); + Writer->WriteIdentifierPrefix(TEXT("seller_address")); WriteJsonValue(Writer, SellerAddress); + Writer->WriteIdentifierPrefix(TEXT("maker_address")); WriteJsonValue(Writer, MakerAddress); + Writer->WriteIdentifierPrefix(TEXT("taker_address")); WriteJsonValue(Writer, TakerAddress); + Writer->WriteObjectEnd(); +} + +bool APITrade::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("buy"), Buy); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("buyer_address"), BuyerAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("buyer_fees"), BuyerFees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("fees"), Fees); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_id"), OrderId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("blockchain_metadata"), BlockchainMetadata); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("indexed_at"), IndexedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sell"), Sell); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("seller_address"), SellerAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("maker_address"), MakerAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("taker_address"), TakerAddress); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APITradeBlockchainMetadata.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APITradeBlockchainMetadata.cpp new file mode 100644 index 0000000..5bff6c6 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APITradeBlockchainMetadata.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITradeBlockchainMetadata.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APITradeBlockchainMetadata::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("transaction_hash")); WriteJsonValue(Writer, TransactionHash); + Writer->WriteIdentifierPrefix(TEXT("block_number")); WriteJsonValue(Writer, BlockNumber); + Writer->WriteIdentifierPrefix(TEXT("transaction_index")); WriteJsonValue(Writer, TransactionIndex); + Writer->WriteIdentifierPrefix(TEXT("log_index")); WriteJsonValue(Writer, LogIndex); + Writer->WriteObjectEnd(); +} + +bool APITradeBlockchainMetadata::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("transaction_hash"), TransactionHash); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("block_number"), BlockNumber); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("transaction_index"), TransactionIndex); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("log_index"), LogIndex); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APITradeResult.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APITradeResult.cpp new file mode 100644 index 0000000..26ccb77 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APITradeResult.cpp @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITradeResult.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APITradeResult::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result); + Writer->WriteObjectEnd(); +} + +bool APITradeResult::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APITransfer.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APITransfer.cpp new file mode 100644 index 0000000..ba31947 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APITransfer.cpp @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APITransfer.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APITransfer::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("from")); WriteJsonValue(Writer, From); + Writer->WriteIdentifierPrefix(TEXT("to")); WriteJsonValue(Writer, To); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("asset")); WriteJsonValue(Writer, Asset); + Writer->WriteObjectEnd(); +} + +bool APITransfer::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("from"), From); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("to"), To); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("asset"), Asset); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIUnfulfillableOrder.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIUnfulfillableOrder.cpp new file mode 100644 index 0000000..15225a8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIUnfulfillableOrder.cpp @@ -0,0 +1,50 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIUnfulfillableOrder.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIUnfulfillableOrder::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("order_id")); WriteJsonValue(Writer, OrderId); + if (TokenId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("reason")); WriteJsonValue(Writer, Reason); + Writer->WriteObjectEnd(); +} + +bool APIUnfulfillableOrder::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("order_id"), OrderId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("token_id"), TokenId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("reason"), Reason); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIUserInfo.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIUserInfo.cpp new file mode 100644 index 0000000..92bcb23 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIUserInfo.cpp @@ -0,0 +1,55 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIUserInfo.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIUserInfo::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("sub")); WriteJsonValue(Writer, Sub); + if (Email.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("email")); WriteJsonValue(Writer, Email.GetValue()); + } + if (PassportAddress.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("passport_address")); WriteJsonValue(Writer, PassportAddress.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("linked_addresses")); WriteJsonValue(Writer, LinkedAddresses); + Writer->WriteObjectEnd(); +} + +bool APIUserInfo::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("sub"), Sub); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("email"), Email); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("passport_address"), PassportAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("linked_addresses"), LinkedAddresses); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequest.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequest.cpp new file mode 100644 index 0000000..5406eae --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequest.cpp @@ -0,0 +1,81 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIVerificationRequest.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIVerificationRequest::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + if (OrgName.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("org_name")); WriteJsonValue(Writer, OrgName.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Symbol.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (OrgId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("org_id")); WriteJsonValue(Writer, OrgId.GetValue()); + } + if (RequesterEmail.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("requester_email")); WriteJsonValue(Writer, RequesterEmail.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("verification_request_status")); WriteJsonValue(Writer, VerificationRequestStatus); + Writer->WriteObjectEnd(); +} + +bool APIVerificationRequest::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("org_name"), OrgName); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("org_id"), OrgId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("requester_email"), RequesterEmail); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("verification_request_status"), VerificationRequestStatus); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequestContractType.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequestContractType.cpp new file mode 100644 index 0000000..ec8167f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequestContractType.cpp @@ -0,0 +1,89 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIVerificationRequestContractType.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIVerificationRequestContractType::Values& Value) +{ + switch (Value) + { + case APIVerificationRequestContractType::Values::ERC20: + return TEXT("ERC20"); + case APIVerificationRequestContractType::Values::ERC721: + return TEXT("ERC721"); + case APIVerificationRequestContractType::Values::ERC1155: + return TEXT("ERC1155"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIVerificationRequestContractType::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIVerificationRequestContractType::EnumToString(const APIVerificationRequestContractType::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIVerificationRequestContractType::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("ERC20"), APIVerificationRequestContractType::Values::ERC20 }, + { TEXT("ERC721"), APIVerificationRequestContractType::Values::ERC721 }, + { TEXT("ERC1155"), APIVerificationRequestContractType::Values::ERC1155 }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIVerificationRequestContractType::EnumFromString(const FString& EnumAsString, APIVerificationRequestContractType::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIVerificationRequestContractType::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIVerificationRequestContractType::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIVerificationRequestContractType::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIVerificationRequestContractType::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequestInternal.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequestInternal.cpp new file mode 100644 index 0000000..4434d86 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequestInternal.cpp @@ -0,0 +1,86 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIVerificationRequestInternal.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIVerificationRequestInternal::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id); + Writer->WriteIdentifierPrefix(TEXT("chain")); WriteJsonValue(Writer, Chain); + Writer->WriteIdentifierPrefix(TEXT("contract_address")); WriteJsonValue(Writer, ContractAddress); + if (OrgName.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("org_name")); WriteJsonValue(Writer, OrgName.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + if (Symbol.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("symbol")); WriteJsonValue(Writer, Symbol.GetValue()); + } + if (Description.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("description")); WriteJsonValue(Writer, Description.GetValue()); + } + if (OrgId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("org_id")); WriteJsonValue(Writer, OrgId.GetValue()); + } + if (RequesterEmail.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("requester_email")); WriteJsonValue(Writer, RequesterEmail.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("contract_type")); WriteJsonValue(Writer, ContractType); + Writer->WriteIdentifierPrefix(TEXT("verification_request_status")); WriteJsonValue(Writer, VerificationRequestStatus); + if (OrgTier.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("org_tier")); WriteJsonValue(Writer, OrgTier.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool APIVerificationRequestInternal::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("chain"), Chain); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_address"), ContractAddress); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("org_name"), OrgName); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("symbol"), Symbol); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("description"), Description); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("org_id"), OrgId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("requester_email"), RequesterEmail); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("contract_type"), ContractType); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("verification_request_status"), VerificationRequestStatus); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("org_tier"), OrgTier); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequestStatus.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequestStatus.cpp new file mode 100644 index 0000000..ed67e35 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIVerificationRequestStatus.cpp @@ -0,0 +1,86 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIVerificationRequestStatus.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +inline FString ToString(const APIVerificationRequestStatus::Values& Value) +{ + switch (Value) + { + case APIVerificationRequestStatus::Values::Completed: + return TEXT("completed"); + case APIVerificationRequestStatus::Values::Pending: + return TEXT("pending"); + } + + UE_LOG(LogImmutablezkEVMAPI, Error, TEXT("Invalid APIVerificationRequestStatus::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString APIVerificationRequestStatus::EnumToString(const APIVerificationRequestStatus::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, APIVerificationRequestStatus::Values& Value) +{ + static TMap StringToEnum = { + { TEXT("completed"), APIVerificationRequestStatus::Values::Completed }, + { TEXT("pending"), APIVerificationRequestStatus::Values::Pending }, }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool APIVerificationRequestStatus::EnumFromString(const FString& EnumAsString, APIVerificationRequestStatus::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const APIVerificationRequestStatus::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, APIVerificationRequestStatus::Values& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + return false; +} + +void APIVerificationRequestStatus::WriteJson(JsonWriter& Writer) const +{ + WriteJsonValue(Writer, Value); +} + +bool APIVerificationRequestStatus::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Value); +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIWallet.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIWallet.cpp new file mode 100644 index 0000000..99297ee --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIWallet.cpp @@ -0,0 +1,56 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIWallet.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIWallet::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("address")); WriteJsonValue(Writer, Address); + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); + Writer->WriteIdentifierPrefix(TEXT("created_at")); WriteJsonValue(Writer, CreatedAt); + Writer->WriteIdentifierPrefix(TEXT("updated_at")); WriteJsonValue(Writer, UpdatedAt); + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("clientName")); WriteJsonValue(Writer, ClientName); + Writer->WriteObjectEnd(); +} + +bool APIWallet::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("address"), Address); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("created_at"), CreatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("updated_at"), UpdatedAt); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("clientName"), ClientName); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/APIWithdrawal.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/APIWithdrawal.cpp new file mode 100644 index 0000000..386dd64 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/APIWithdrawal.cpp @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "APIWithdrawal.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIWithdrawal::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("from")); WriteJsonValue(Writer, From); + Writer->WriteIdentifierPrefix(TEXT("amount")); WriteJsonValue(Writer, Amount); + Writer->WriteIdentifierPrefix(TEXT("asset")); WriteJsonValue(Writer, Asset); + Writer->WriteObjectEnd(); +} + +bool APIWithdrawal::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("from"), From); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("amount"), Amount); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("asset"), Asset); + + return ParseSuccess; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/ImmutablezkEVMAPIModule.cpp b/Source/Experimental/ImmutablezkEVMAPI/Private/ImmutablezkEVMAPIModule.cpp new file mode 100644 index 0000000..97a2613 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/ImmutablezkEVMAPIModule.cpp @@ -0,0 +1,24 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "ImmutablezkEVMAPIModule.h" + +IMPLEMENT_MODULE(ImmutablezkEVMAPIModule, ImmutablezkEVMAPI); +DEFINE_LOG_CATEGORY(LogImmutablezkEVMAPI); + +void ImmutablezkEVMAPIModule::StartupModule() +{ +} + +void ImmutablezkEVMAPIModule::ShutdownModule() +{ +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Private/ImmutablezkEVMAPIModule.h b/Source/Experimental/ImmutablezkEVMAPI/Private/ImmutablezkEVMAPIModule.h new file mode 100644 index 0000000..f20f531 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Private/ImmutablezkEVMAPIModule.h @@ -0,0 +1,26 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "Modules/ModuleInterface.h" +#include "Modules/ModuleManager.h" +#include "Logging/LogMacros.h" + +DECLARE_LOG_CATEGORY_EXTERN(LogImmutablezkEVMAPI, Log, All); + +class IMMUTABLEZKEVMAPI_API ImmutablezkEVMAPIModule : public IModuleInterface +{ +public: + void StartupModule() final; + void ShutdownModule() final; +}; diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError400.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError400.h new file mode 100644 index 0000000..bcd6939 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError400.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAPIError400 + * + * + */ +class IMMUTABLEZKEVMAPI_API APIAPIError400 : public Model +{ +public: + virtual ~APIAPIError400() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Error Message */ + FString Message; + /* Link to IMX documentation that can help resolve this error */ + FString Link; + /* Trace ID of the initial request */ + FString TraceId; + enum class CodeEnum + { + ValidationError, + }; + + static FString EnumToString(const CodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CodeEnum& EnumValue); + /* Error Code */ + CodeEnum Code; + /* Additional details to help resolve the error */ + TOptional> Details; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError401.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError401.h new file mode 100644 index 0000000..92af290 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError401.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAPIError401 + * + * + */ +class IMMUTABLEZKEVMAPI_API APIAPIError401 : public Model +{ +public: + virtual ~APIAPIError401() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Error Message */ + FString Message; + /* Link to IMX documentation that can help resolve this error */ + FString Link; + /* Trace ID of the initial request */ + FString TraceId; + enum class CodeEnum + { + UnauthorisedRequest, + }; + + static FString EnumToString(const CodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CodeEnum& EnumValue); + /* Error Code */ + CodeEnum Code; + /* Additional details to help resolve the error */ + TOptional> Details; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError403.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError403.h new file mode 100644 index 0000000..90d1eda --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError403.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAPIError403 + * + * + */ +class IMMUTABLEZKEVMAPI_API APIAPIError403 : public Model +{ +public: + virtual ~APIAPIError403() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Error Message */ + FString Message; + /* Link to IMX documentation that can help resolve this error */ + FString Link; + /* Trace ID of the initial request */ + FString TraceId; + enum class CodeEnum + { + AuthenticationError, + }; + + static FString EnumToString(const CodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CodeEnum& EnumValue); + /* Error Code */ + CodeEnum Code; + /* Additional details to help resolve the error */ + TOptional> Details; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError404.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError404.h new file mode 100644 index 0000000..47e958d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError404.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAPIError404 + * + * + */ +class IMMUTABLEZKEVMAPI_API APIAPIError404 : public Model +{ +public: + virtual ~APIAPIError404() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Error Message */ + FString Message; + /* Link to IMX documentation that can help resolve this error */ + FString Link; + /* Trace ID of the initial request */ + FString TraceId; + enum class CodeEnum + { + ResourceNotFound, + }; + + static FString EnumToString(const CodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CodeEnum& EnumValue); + /* Error Code */ + CodeEnum Code; + /* Additional details to help resolve the error */ + TOptional> Details; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError409.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError409.h new file mode 100644 index 0000000..768c996 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError409.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAPIError409 + * + * + */ +class IMMUTABLEZKEVMAPI_API APIAPIError409 : public Model +{ +public: + virtual ~APIAPIError409() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Error Message */ + FString Message; + /* Link to IMX documentation that can help resolve this error */ + FString Link; + /* Trace ID of the initial request */ + FString TraceId; + enum class CodeEnum + { + ConflictError, + }; + + static FString EnumToString(const CodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CodeEnum& EnumValue); + /* Error Code */ + CodeEnum Code; + /* Additional details to help resolve the error */ + TOptional>> Details; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError429.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError429.h new file mode 100644 index 0000000..a281390 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError429.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAPIError429 + * + * + */ +class IMMUTABLEZKEVMAPI_API APIAPIError429 : public Model +{ +public: + virtual ~APIAPIError429() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Error Message */ + FString Message; + /* Link to IMX documentation that can help resolve this error */ + FString Link; + /* Trace ID of the initial request */ + FString TraceId; + enum class CodeEnum + { + TooManyRequestsError, + }; + + static FString EnumToString(const CodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CodeEnum& EnumValue); + /* Error Code */ + CodeEnum Code; + /* Additional details to help resolve the error */ + TOptional> Details; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError500.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError500.h new file mode 100644 index 0000000..3ab23b8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError500.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAPIError500 + * + * + */ +class IMMUTABLEZKEVMAPI_API APIAPIError500 : public Model +{ +public: + virtual ~APIAPIError500() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Error Message */ + FString Message; + /* Link to IMX documentation that can help resolve this error */ + FString Link; + /* Trace ID of the initial request */ + FString TraceId; + enum class CodeEnum + { + InternalServerError, + }; + + static FString EnumToString(const CodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CodeEnum& EnumValue); + /* Error Code */ + CodeEnum Code; + /* Additional details to help resolve the error */ + TOptional> Details; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError501.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError501.h new file mode 100644 index 0000000..cd31e28 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAPIError501.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAPIError501 + * + * + */ +class IMMUTABLEZKEVMAPI_API APIAPIError501 : public Model +{ +public: + virtual ~APIAPIError501() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Error Message */ + FString Message; + /* Link to IMX documentation that can help resolve this error */ + FString Link; + /* Trace ID of the initial request */ + FString TraceId; + enum class CodeEnum + { + NotImplementedError, + }; + + static FString EnumToString(const CodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CodeEnum& EnumValue); + /* Error Code */ + CodeEnum Code; + /* Additional details to help resolve the error */ + TOptional> Details; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActiveOrderStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActiveOrderStatus.h new file mode 100644 index 0000000..52287ac --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActiveOrderStatus.h @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIActiveOrderStatus + * + * + */ +class IMMUTABLEZKEVMAPI_API APIActiveOrderStatus : public Model +{ +public: + virtual ~APIActiveOrderStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Active, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* The order status that indicates an order can be fulfilled. */ + NameEnum Name; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivitiesApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivitiesApi.h new file mode 100644 index 0000000..45a6a5b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivitiesApi.h @@ -0,0 +1,71 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APIActivitiesApi +{ +public: + APIActivitiesApi(); + ~APIActivitiesApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class GetActivityRequest; + class GetActivityResponse; + class ListActivitiesRequest; + class ListActivitiesResponse; + class ListActivityHistoryRequest; + class ListActivityHistoryResponse; + + DECLARE_DELEGATE_OneParam(FGetActivityDelegate, const GetActivityResponse&); + DECLARE_DELEGATE_OneParam(FListActivitiesDelegate, const ListActivitiesResponse&); + DECLARE_DELEGATE_OneParam(FListActivityHistoryDelegate, const ListActivityHistoryResponse&); + + FHttpRequestPtr GetActivity(const GetActivityRequest& Request, const FGetActivityDelegate& Delegate = FGetActivityDelegate()) const; + FHttpRequestPtr ListActivities(const ListActivitiesRequest& Request, const FListActivitiesDelegate& Delegate = FListActivitiesDelegate()) const; + FHttpRequestPtr ListActivityHistory(const ListActivityHistoryRequest& Request, const FListActivityHistoryDelegate& Delegate = FListActivityHistoryDelegate()) const; + +private: + void OnGetActivityResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetActivityDelegate Delegate) const; + void OnListActivitiesResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListActivitiesDelegate Delegate) const; + void OnListActivityHistoryResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListActivityHistoryDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivitiesApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivitiesApiOperations.h new file mode 100644 index 0000000..2622317 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivitiesApiOperations.h @@ -0,0 +1,131 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivitiesApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError404.h" +#include "APIAPIError500.h" +#include "APIActivityType.h" +#include "APIGetActivityResult.h" +#include "APIListActivitiesResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* Get a single activity by ID + * + * Get a single activity by ID +*/ +class IMMUTABLEZKEVMAPI_API APIActivitiesApi::GetActivityRequest : public Request +{ +public: + virtual ~GetActivityRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* The id of activity */ + FGuid ActivityId; +}; + +class IMMUTABLEZKEVMAPI_API APIActivitiesApi::GetActivityResponse : public Response +{ +public: + virtual ~GetActivityResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIGetActivityResult Content; +}; + +/* List all activities + * + * List all activities +*/ +class IMMUTABLEZKEVMAPI_API APIActivitiesApi::ListActivitiesRequest : public Request +{ +public: + virtual ~ListActivitiesRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* The contract address of NFT or ERC20 Token */ + TOptional ContractAddress; + /* An `uint256` token id as string */ + TOptional TokenId; + /* The account address activity contains */ + TOptional AccountAddress; + /* The activity type */ + TOptional ActivityType; + /* The transaction hash of activity */ + TOptional TransactionHash; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APIActivitiesApi::ListActivitiesResponse : public Response +{ +public: + virtual ~ListActivitiesResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListActivitiesResult Content; +}; + +/* List history of activities + * + * List activities sorted by updated_at timestamp ascending, useful for time based data replication +*/ +class IMMUTABLEZKEVMAPI_API APIActivitiesApi::ListActivityHistoryRequest : public Request +{ +public: + virtual ~ListActivityHistoryRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* From indexed at including given date */ + FDateTime FromUpdatedAt; + /* To indexed at including given date */ + TOptional ToUpdatedAt; + /* The contract address of the collection */ + TOptional ContractAddress; + /* The activity type */ + TOptional ActivityType; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APIActivitiesApi::ListActivityHistoryResponse : public Response +{ +public: + virtual ~ListActivityHistoryResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListActivitiesResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivity.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivity.h new file mode 100644 index 0000000..0f0d955 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivity.h @@ -0,0 +1,48 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityDetails.h" +#include "APIActivityType.h" +#include "APIBlockchainMetadata.h" +#include "APIChain.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIActivity + * + * + */ +class IMMUTABLEZKEVMAPI_API APIActivity : public Model +{ +public: + virtual ~APIActivity() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Activity id in UUIDv4 format */ + FGuid Id; + APIChain Chain; + APIActivityType Type; + APIActivityDetails Details; + /* The time activity was updated at */ + FDateTime UpdatedAt; + /* The time activity was indexed */ + FDateTime IndexedAt; + TOptional BlockchainMetadata; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityAsset.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityAsset.h new file mode 100644 index 0000000..989e44b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityAsset.h @@ -0,0 +1,44 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityNFT.h" +#include "APIActivityToken.h" +#include "APITokenContractType.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIActivityAsset + * + * The contract and asset details for this activity + */ +class IMMUTABLEZKEVMAPI_API APIActivityAsset : public Model +{ +public: + virtual ~APIActivityAsset() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APITokenContractType ContractType; + /* The contract address */ + FString ContractAddress; + /* An `uint256` token id as string */ + FString TokenId; + /* (deprecated - will never be filled, use amount on Activity instead) The amount of tokens exchanged */ + FString Amount; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityDetails.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityDetails.h new file mode 100644 index 0000000..5ad5660 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityDetails.h @@ -0,0 +1,52 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityAsset.h" +#include "APIBurn.h" +#include "APIDeposit.h" +#include "APIMint.h" +#include "APINFTSale.h" +#include "APISalePayment.h" +#include "APITransfer.h" +#include "APIWithdrawal.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIActivityDetails + * + * The activity details + */ +class IMMUTABLEZKEVMAPI_API APIActivityDetails : public Model +{ +public: + virtual ~APIActivityDetails() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The account address the asset was deposited to */ + FString To; + /* The amount of assets withdrawn */ + FString Amount; + APIActivityAsset Asset; + /* The account address the asset was withdrawn from */ + FString From; + /* The id of order */ + FString OrderId; + APISalePayment Payment; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityNFT.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityNFT.h new file mode 100644 index 0000000..fd646cb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityNFT.h @@ -0,0 +1,42 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTContractType.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIActivityNFT + * + * + */ +class IMMUTABLEZKEVMAPI_API APIActivityNFT : public Model +{ +public: + virtual ~APIActivityNFT() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APINFTContractType ContractType; + /* The token contract address */ + FString ContractAddress; + /* An `uint256` token id as string */ + FString TokenId; + /* (deprecated - will never be filled, use amount on Activity instead) The amount of tokens exchanged */ + FString Amount; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityNativeToken.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityNativeToken.h new file mode 100644 index 0000000..17c2470 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityNativeToken.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIActivityNativeToken + * + * + */ +class IMMUTABLEZKEVMAPI_API APIActivityNativeToken : public Model +{ +public: + virtual ~APIActivityNativeToken() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The token symbol */ + FString Symbol; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityToken.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityToken.h new file mode 100644 index 0000000..d9abd82 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityToken.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APITokenContractType.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIActivityToken + * + * + */ +class IMMUTABLEZKEVMAPI_API APIActivityToken : public Model +{ +public: + virtual ~APIActivityToken() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APITokenContractType ContractType; + /* The contract address */ + FString ContractAddress; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityType.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityType.h new file mode 100644 index 0000000..ee07f48 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIActivityType.h @@ -0,0 +1,48 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIActivityType + * + * The activity type + */ +class IMMUTABLEZKEVMAPI_API APIActivityType : public Model +{ +public: + virtual ~APIActivityType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + Mint, + Burn, + Transfer, + Sale, + Deposit, + Withdrawal, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAssetCollectionItem.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAssetCollectionItem.h new file mode 100644 index 0000000..8696280 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAssetCollectionItem.h @@ -0,0 +1,50 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIERC1155CollectionItem.h" +#include "APIERC721CollectionItem.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAssetCollectionItem + * + * + */ +class IMMUTABLEZKEVMAPI_API APIAssetCollectionItem : public Model +{ +public: + virtual ~APIAssetCollectionItem() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + ERC721COLLECTION, + ERC1155COLLECTION, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is ERC721 */ + TypeEnum Type; + /* Address of ERC1155 collection */ + FString ContractAddress; + /* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum). */ + FString Amount; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIAssetVerificationStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAssetVerificationStatus.h new file mode 100644 index 0000000..818af6c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIAssetVerificationStatus.h @@ -0,0 +1,46 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIAssetVerificationStatus + * + * The verification status for a given contract + */ +class IMMUTABLEZKEVMAPI_API APIAssetVerificationStatus : public Model +{ +public: + virtual ~APIAssetVerificationStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + Verified, + Unverified, + Spam, + Inactive, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIBaseModel.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBaseModel.h new file mode 100644 index 0000000..90f57c1 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBaseModel.h @@ -0,0 +1,107 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" +#include "Serialization/JsonWriter.h" +#include "Dom/JsonObject.h" +#include "HttpRetrySystem.h" +#include "Containers/Ticker.h" +#include "Runtime/Launch/Resources/Version.h" + +namespace ImmutablezkEVMAPI +{ + +typedef TSharedRef> JsonWriter; +using namespace FHttpRetrySystem; + +struct IMMUTABLEZKEVMAPI_API HttpRetryManager + : public FManager +#if ENGINE_MAJOR_VERSION <= 4 + , public FTickerObjectBase +#else + , public FTSTickerObjectBase +#endif +{ + using FManager::FManager; + + bool Tick(float DeltaTime) final; +}; + +struct IMMUTABLEZKEVMAPI_API HttpRetryParams +{ + HttpRetryParams( + const FRetryLimitCountSetting& InRetryLimitCountOverride = FRetryLimitCountSetting(), + const FRetryTimeoutRelativeSecondsSetting& InRetryTimeoutRelativeSecondsOverride = FRetryTimeoutRelativeSecondsSetting(), + const FRetryResponseCodes& InRetryResponseCodes = FRetryResponseCodes(), + const FRetryVerbs& InRetryVerbs = FRetryVerbs(), + const FRetryDomainsPtr& InRetryDomains = FRetryDomainsPtr() + ); + + FRetryLimitCountSetting RetryLimitCountOverride; + FRetryTimeoutRelativeSecondsSetting RetryTimeoutRelativeSecondsOverride; + FRetryResponseCodes RetryResponseCodes; + FRetryVerbs RetryVerbs; + FRetryDomainsPtr RetryDomains; +}; + +class IMMUTABLEZKEVMAPI_API Model +{ +public: + virtual ~Model() {} + virtual void WriteJson(JsonWriter& Writer) const = 0; + virtual bool FromJson(const TSharedPtr& JsonValue) = 0; +}; + +class IMMUTABLEZKEVMAPI_API Request +{ +public: + virtual ~Request() {} + virtual void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const = 0; + virtual FString ComputePath() const = 0; + + /* Enables retry and optionally sets a retry policy for this request */ + void SetShouldRetry(const HttpRetryParams& Params = HttpRetryParams()) { RetryParams = Params; } + const TOptional& GetRetryParams() const { return RetryParams; } + +private: + TOptional RetryParams; +}; + +class IMMUTABLEZKEVMAPI_API Response +{ +public: + virtual ~Response() {} + virtual bool FromJson(const TSharedPtr& JsonValue) = 0; + + void SetSuccessful(bool InSuccessful) { Successful = InSuccessful; } + bool IsSuccessful() const { return Successful; } + + virtual void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode); + EHttpResponseCodes::Type GetHttpResponseCode() const { return ResponseCode; } + + void SetResponseString(const FString& InResponseString) { ResponseString = InResponseString; } + const FString& GetResponseString() const { return ResponseString; } + + void SetHttpResponse(const FHttpResponsePtr& InHttpResponse) { HttpResponse = InHttpResponse; } + const FHttpResponsePtr& GetHttpResponse() const { return HttpResponse; } + +private: + bool Successful; + EHttpResponseCodes::Type ResponseCode; + FString ResponseString; + FHttpResponsePtr HttpResponse; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIBasicAPIError.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBasicAPIError.h new file mode 100644 index 0000000..15eb037 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBasicAPIError.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIBasicAPIError + * + * + */ +class IMMUTABLEZKEVMAPI_API APIBasicAPIError : public Model +{ +public: + virtual ~APIBasicAPIError() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Error Message */ + FString Message; + /* Link to IMX documentation that can help resolve this error */ + FString Link; + /* Trace ID of the initial request */ + FString TraceId; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIBidResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBidResult.h new file mode 100644 index 0000000..9af6d9c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBidResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrder.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIBidResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIBidResult : public Model +{ +public: + virtual ~APIBidResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIOrder Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIBlockchainMetadata.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBlockchainMetadata.h new file mode 100644 index 0000000..05b4d03 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBlockchainMetadata.h @@ -0,0 +1,42 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIBlockchainMetadata + * + * The metadata related to blockchain transaction + */ +class IMMUTABLEZKEVMAPI_API APIBlockchainMetadata : public Model +{ +public: + virtual ~APIBlockchainMetadata() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The transaction hash of the activity */ + FString TransactionHash; + /* EVM block number (uint64 as string) */ + FString BlockNumber; + /* Transaction index in a block (uint32 as string) */ + FString TransactionIndex; + /* The log index of activity in a block (uint32 as string) */ + TOptional LogIndex; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIBurn.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBurn.h new file mode 100644 index 0000000..21f0c2d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIBurn.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityAsset.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIBurn + * + * The burn activity details + */ +class IMMUTABLEZKEVMAPI_API APIBurn : public Model +{ +public: + virtual ~APIBurn() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The account address the asset was transferred from */ + FString From; + /* The amount of assets burnt */ + FString Amount; + APIActivityAsset Asset; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICall.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICall.h new file mode 100644 index 0000000..42098ae --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICall.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICall + * + * + */ +class IMMUTABLEZKEVMAPI_API APICall : public Model +{ +public: + virtual ~APICall() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* An Ethereum address */ + FString TargetAddress; + /* The function signature */ + FString FunctionSignature; + /* The function arguments */ + TArray FunctionArgs; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelOrdersRequestBody.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelOrdersRequestBody.h new file mode 100644 index 0000000..583312b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelOrdersRequestBody.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICancelOrdersRequestBody + * + * + */ +class IMMUTABLEZKEVMAPI_API APICancelOrdersRequestBody : public Model +{ +public: + virtual ~APICancelOrdersRequestBody() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Address of the user initiating the cancel request */ + FString AccountAddress; + /* List of order ids proposed for cancellation */ + TArray Orders; + /* Signature generated by the user for the specific cancellation request */ + FString Signature; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelOrdersResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelOrdersResult.h new file mode 100644 index 0000000..7602f03 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelOrdersResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICancelOrdersResultData.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICancelOrdersResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APICancelOrdersResult : public Model +{ +public: + virtual ~APICancelOrdersResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APICancelOrdersResultData Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelOrdersResultData.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelOrdersResultData.h new file mode 100644 index 0000000..1cb552a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelOrdersResultData.h @@ -0,0 +1,41 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIFailedOrderCancellation.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICancelOrdersResultData + * + * + */ +class IMMUTABLEZKEVMAPI_API APICancelOrdersResultData : public Model +{ +public: + virtual ~APICancelOrdersResultData() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Orders which were successfully cancelled */ + TArray SuccessfulCancellations; + /* Orders which are marked for cancellation but the cancellation cannot be guaranteed */ + TArray PendingCancellations; + /* Orders which failed to be cancelled */ + TArray FailedCancellations; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelledOrderStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelledOrderStatus.h new file mode 100644 index 0000000..479ea8f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICancelledOrderStatus.h @@ -0,0 +1,56 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICancelledOrderStatus + * + * + */ +class IMMUTABLEZKEVMAPI_API APICancelledOrderStatus : public Model +{ +public: + virtual ~APICancelledOrderStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Cancelled, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* The order status indicating a order is has been cancelled or about to be cancelled. */ + NameEnum Name; + /* Whether the cancellation of the order is pending */ + bool Pending = false; + enum class CancellationTypeEnum + { + OnChain, + OffChain, + Underfunded, + }; + + static FString EnumToString(const CancellationTypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CancellationTypeEnum& EnumValue); + /* Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account */ + CancellationTypeEnum CancellationType; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIChain.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIChain.h new file mode 100644 index 0000000..eb87c9f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIChain.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIChain + * + * The chain details + */ +class IMMUTABLEZKEVMAPI_API APIChain : public Model +{ +public: + virtual ~APIChain() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The id of chain */ + FString Id; + /* The name of chain */ + FString Name; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIChainWithDetails.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIChainWithDetails.h new file mode 100644 index 0000000..74f7656 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIChainWithDetails.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIChainWithDetails + * + * + */ +class IMMUTABLEZKEVMAPI_API APIChainWithDetails : public Model +{ +public: + virtual ~APIChainWithDetails() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The id of chain */ + FString Id; + /* The name of chain */ + FString Name; + /* URL for RPC node */ + TOptional RpcUrl; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIChainsApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIChainsApi.h new file mode 100644 index 0000000..76df6dc --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIChainsApi.h @@ -0,0 +1,61 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APIChainsApi +{ +public: + APIChainsApi(); + ~APIChainsApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class ListChainsRequest; + class ListChainsResponse; + + DECLARE_DELEGATE_OneParam(FListChainsDelegate, const ListChainsResponse&); + + FHttpRequestPtr ListChains(const ListChainsRequest& Request, const FListChainsDelegate& Delegate = FListChainsDelegate()) const; + +private: + void OnListChainsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListChainsDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIChainsApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIChainsApiOperations.h new file mode 100644 index 0000000..e74adc3 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIChainsApiOperations.h @@ -0,0 +1,53 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChainsApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError404.h" +#include "APIAPIError500.h" +#include "APIListChainsResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* List supported chains + * + * List supported chains +*/ +class IMMUTABLEZKEVMAPI_API APIChainsApi::ListChainsRequest : public Request +{ +public: + virtual ~ListChainsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APIChainsApi::ListChainsResponse : public Response +{ +public: + virtual ~ListChainsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListChainsResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICollection.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollection.h new file mode 100644 index 0000000..0e99ff0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollection.h @@ -0,0 +1,62 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIAssetVerificationStatus.h" +#include "APIChain.h" +#include "APICollectionContractType.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICollection + * + * + */ +class IMMUTABLEZKEVMAPI_API APICollection : public Model +{ +public: + virtual ~APICollection() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* The name of the collection */ + TOptional Name; + /* The symbol of contract */ + TOptional Symbol; + APICollectionContractType ContractType; + /* The address of the contract */ + FString ContractAddress; + /* The description of collection */ + TOptional Description; + /* The url of the collection image */ + TOptional Image; + /* The url of external link */ + TOptional ExternalLink; + /* The uri for the metadata of the collection */ + TOptional ContractUri; + /* The metadata uri for nft */ + TOptional BaseUri; + APIAssetVerificationStatus VerificationStatus; + /* When the collection was first indexed */ + FDateTime IndexedAt; + /* When the collection was last updated */ + FDateTime UpdatedAt; + /* When the collection metadata was last synced */ + TOptional MetadataSyncedAt; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionBidResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionBidResult.h new file mode 100644 index 0000000..d9a5140 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionBidResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrder.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICollectionBidResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APICollectionBidResult : public Model +{ +public: + virtual ~APICollectionBidResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIOrder Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionContractType.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionContractType.h new file mode 100644 index 0000000..96fa1ea --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionContractType.h @@ -0,0 +1,44 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICollectionContractType + * + * The collection contract type + */ +class IMMUTABLEZKEVMAPI_API APICollectionContractType : public Model +{ +public: + virtual ~APICollectionContractType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + ERC721, + ERC1155, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionMetadata.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionMetadata.h new file mode 100644 index 0000000..5342572 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionMetadata.h @@ -0,0 +1,48 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICollectionMetadata + * + * + */ +class IMMUTABLEZKEVMAPI_API APICollectionMetadata : public Model +{ +public: + virtual ~APICollectionMetadata() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The name of the collection */ + TOptional Name; + /* The symbol of contract */ + TOptional Symbol; + /* The description of collection */ + TOptional Description; + /* The url of the collection image */ + TOptional Image; + /* The url of external link */ + TOptional ExternalLink; + /* The uri for the metadata of the collection */ + TOptional ContractUri; + /* The metadata uri for nft */ + TOptional BaseUri; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionsApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionsApi.h new file mode 100644 index 0000000..ac1c772 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionsApi.h @@ -0,0 +1,76 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APICollectionsApi +{ +public: + APICollectionsApi(); + ~APICollectionsApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class GetCollectionRequest; + class GetCollectionResponse; + class ListCollectionsRequest; + class ListCollectionsResponse; + class ListCollectionsByNFTOwnerRequest; + class ListCollectionsByNFTOwnerResponse; + class RefreshCollectionMetadataRequest; + class RefreshCollectionMetadataResponse; + + DECLARE_DELEGATE_OneParam(FGetCollectionDelegate, const GetCollectionResponse&); + DECLARE_DELEGATE_OneParam(FListCollectionsDelegate, const ListCollectionsResponse&); + DECLARE_DELEGATE_OneParam(FListCollectionsByNFTOwnerDelegate, const ListCollectionsByNFTOwnerResponse&); + DECLARE_DELEGATE_OneParam(FRefreshCollectionMetadataDelegate, const RefreshCollectionMetadataResponse&); + + FHttpRequestPtr GetCollection(const GetCollectionRequest& Request, const FGetCollectionDelegate& Delegate = FGetCollectionDelegate()) const; + FHttpRequestPtr ListCollections(const ListCollectionsRequest& Request, const FListCollectionsDelegate& Delegate = FListCollectionsDelegate()) const; + FHttpRequestPtr ListCollectionsByNFTOwner(const ListCollectionsByNFTOwnerRequest& Request, const FListCollectionsByNFTOwnerDelegate& Delegate = FListCollectionsByNFTOwnerDelegate()) const; + FHttpRequestPtr RefreshCollectionMetadata(const RefreshCollectionMetadataRequest& Request, const FRefreshCollectionMetadataDelegate& Delegate = FRefreshCollectionMetadataDelegate()) const; + +private: + void OnGetCollectionResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCollectionDelegate Delegate) const; + void OnListCollectionsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListCollectionsDelegate Delegate) const; + void OnListCollectionsByNFTOwnerResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListCollectionsByNFTOwnerDelegate Delegate) const; + void OnRefreshCollectionMetadataResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshCollectionMetadataDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionsApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionsApiOperations.h new file mode 100644 index 0000000..d561c90 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICollectionsApiOperations.h @@ -0,0 +1,154 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICollectionsApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError401.h" +#include "APIAPIError403.h" +#include "APIAPIError404.h" +#include "APIAPIError500.h" +#include "APIAssetVerificationStatus.h" +#include "APIGetCollectionResult.h" +#include "APIListCollectionsResult.h" +#include "APIRefreshCollectionMetadataRequest.h" +#include "APIRefreshCollectionMetadataResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* Get collection by contract address + * + * Get collection by contract address +*/ +class IMMUTABLEZKEVMAPI_API APICollectionsApi::GetCollectionRequest : public Request +{ +public: + virtual ~GetCollectionRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address contract */ + FString ContractAddress; + /* The name of chain */ + FString ChainName; +}; + +class IMMUTABLEZKEVMAPI_API APICollectionsApi::GetCollectionResponse : public Response +{ +public: + virtual ~GetCollectionResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIGetCollectionResult Content; +}; + +/* List all collections + * + * List all collections +*/ +class IMMUTABLEZKEVMAPI_API APICollectionsApi::ListCollectionsRequest : public Request +{ +public: + virtual ~ListCollectionsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* List of contract addresses to filter by */ + TOptional> ContractAddress; + /* List of verification status to filter by */ + TOptional> VerificationStatus; + /* Datetime to use as the oldest updated timestamp */ + TOptional FromUpdatedAt; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APICollectionsApi::ListCollectionsResponse : public Response +{ +public: + virtual ~ListCollectionsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListCollectionsResult Content; +}; + +/* List collections by NFT owner + * + * List collections by NFT owner account address +*/ +class IMMUTABLEZKEVMAPI_API APICollectionsApi::ListCollectionsByNFTOwnerRequest : public Request +{ +public: + virtual ~ListCollectionsByNFTOwnerRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Account address */ + FString AccountAddress; + /* The name of chain */ + FString ChainName; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APICollectionsApi::ListCollectionsByNFTOwnerResponse : public Response +{ +public: + virtual ~ListCollectionsByNFTOwnerResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListCollectionsResult Content; +}; + +/* Refresh collection metadata + * + * Refresh collection metadata +*/ +class IMMUTABLEZKEVMAPI_API APICollectionsApi::RefreshCollectionMetadataRequest : public Request +{ +public: + virtual ~RefreshCollectionMetadataRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address contract */ + FString ContractAddress; + /* The name of chain */ + FString ChainName; + /* The request body */ + APIRefreshCollectionMetadataRequest APIRefreshCollectionMetadataRequest; +}; + +class IMMUTABLEZKEVMAPI_API APICollectionsApi::RefreshCollectionMetadataResponse : public Response +{ +public: + virtual ~RefreshCollectionMetadataResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIRefreshCollectionMetadataResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICraftingApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICraftingApi.h new file mode 100644 index 0000000..40c6d7c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICraftingApi.h @@ -0,0 +1,61 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APICraftingApi +{ +public: + APICraftingApi(); + ~APICraftingApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class SignCraftingPayloadRequest; + class SignCraftingPayloadResponse; + + DECLARE_DELEGATE_OneParam(FSignCraftingPayloadDelegate, const SignCraftingPayloadResponse&); + + FHttpRequestPtr SignCraftingPayload(const SignCraftingPayloadRequest& Request, const FSignCraftingPayloadDelegate& Delegate = FSignCraftingPayloadDelegate()) const; + +private: + void OnSignCraftingPayloadResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSignCraftingPayloadDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICraftingApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICraftingApiOperations.h new file mode 100644 index 0000000..9b8edf3 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICraftingApiOperations.h @@ -0,0 +1,56 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICraftingApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError401.h" +#include "APIAPIError403.h" +#include "APIAPIError404.h" +#include "APIAPIError500.h" +#include "APISignCraftingRequest.h" +#include "APISignCraftingResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* Sign a crafting payload + * + * Sign a crafting payload +*/ +class IMMUTABLEZKEVMAPI_API APICraftingApi::SignCraftingPayloadRequest : public Request +{ +public: + virtual ~SignCraftingPayloadRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* The request body */ + APISignCraftingRequest APISignCraftingRequest; +}; + +class IMMUTABLEZKEVMAPI_API APICraftingApi::SignCraftingPayloadResponse : public Response +{ +public: + virtual ~SignCraftingPayloadResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APISignCraftingResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateBidRequestBody.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateBidRequestBody.h new file mode 100644 index 0000000..7f76733 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateBidRequestBody.h @@ -0,0 +1,55 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIERC20Item.h" +#include "APIFee.h" +#include "APIItem.h" +#include "APIProtocolData.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICreateBidRequestBody + * + * + */ +class IMMUTABLEZKEVMAPI_API APICreateBidRequestBody : public Model +{ +public: + virtual ~APICreateBidRequestBody() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString AccountAddress; + FString OrderHash; + /* Buy item for bid should either be ERC721 or ERC1155 item */ + TArray Buy; + /* Buy fees should only include maker marketplace fees and should be no more than two entries as more entires will incur more gas. It is best practice to have this as few as possible. */ + TArray Fees; + /* Time after which the Order is considered expired */ + FDateTime EndAt; + APIProtocolData ProtocolData; + /* A random value added to the create Order request */ + FString Salt; + /* Sell item for bid should be an ERC20 item */ + TArray Sell; + /* Digital signature generated by the user for the specific Order */ + FString Signature; + /* Time after which Order is considered active */ + FDateTime StartAt; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateCollectionBidRequestBody.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateCollectionBidRequestBody.h new file mode 100644 index 0000000..f4e2a2d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateCollectionBidRequestBody.h @@ -0,0 +1,55 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIAssetCollectionItem.h" +#include "APIERC20Item.h" +#include "APIFee.h" +#include "APIProtocolData.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICreateCollectionBidRequestBody + * + * + */ +class IMMUTABLEZKEVMAPI_API APICreateCollectionBidRequestBody : public Model +{ +public: + virtual ~APICreateCollectionBidRequestBody() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString AccountAddress; + FString OrderHash; + /* Buy item for collection bid should either be ERC721 or ERC1155 collection item */ + TArray Buy; + /* Buy fees should only include maker marketplace fees and should be no more than two entries as more entires will incur more gas. It is best practice to have this as few as possible. */ + TArray Fees; + /* Time after which the Order is considered expired */ + FDateTime EndAt; + APIProtocolData ProtocolData; + /* A random value added to the create Order request */ + FString Salt; + /* Sell item for collection bid should be an ERC20 item */ + TArray Sell; + /* Digital signature generated by the user for the specific Order */ + FString Signature; + /* Time after which Order is considered active */ + FDateTime StartAt; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateListingRequestBody.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateListingRequestBody.h new file mode 100644 index 0000000..15aa97d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateListingRequestBody.h @@ -0,0 +1,54 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIFee.h" +#include "APIItem.h" +#include "APIProtocolData.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICreateListingRequestBody + * + * + */ +class IMMUTABLEZKEVMAPI_API APICreateListingRequestBody : public Model +{ +public: + virtual ~APICreateListingRequestBody() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString AccountAddress; + FString OrderHash; + /* Buy item for listing should either be NATIVE or ERC20 item */ + TArray Buy; + /* Buy fees should only include maker marketplace fees and should be no more than two entries as more entires will incur more gas. It is best practice to have this as few as possible. */ + TArray Fees; + /* Time after which the Order is considered expired */ + FDateTime EndAt; + APIProtocolData ProtocolData; + /* A random value added to the create Order request */ + FString Salt; + /* Sell item for listing should be an ERC721 item */ + TArray Sell; + /* Digital signature generated by the user for the specific Order */ + FString Signature; + /* Time after which Order is considered active */ + FDateTime StartAt; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateMintRequestRequest.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateMintRequestRequest.h new file mode 100644 index 0000000..0597ece --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateMintRequestRequest.h @@ -0,0 +1,37 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIMintAsset.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICreateMintRequestRequest + * + * + */ +class IMMUTABLEZKEVMAPI_API APICreateMintRequestRequest : public Model +{ +public: + virtual ~APICreateMintRequestRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of nft to be minted */ + TArray Assets; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateMintRequestResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateMintRequestResult.h new file mode 100644 index 0000000..8177b2f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APICreateMintRequestResult.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APICreateMintRequestResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APICreateMintRequestResult : public Model +{ +public: + virtual ~APICreateMintRequestResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString ImxMintRequestsLimit; + FString ImxMintRequestsLimitReset; + FString ImxRemainingMintRequests; + FString ImxMintRequestsRetryAfter; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIDeposit.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIDeposit.h new file mode 100644 index 0000000..714cb59 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIDeposit.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityAsset.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIDeposit + * + * The deposit activity details + */ +class IMMUTABLEZKEVMAPI_API APIDeposit : public Model +{ +public: + virtual ~APIDeposit() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The account address the asset was deposited to */ + FString To; + /* The deposited amount */ + FString Amount; + APIActivityAsset Asset; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC1155CollectionItem.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC1155CollectionItem.h new file mode 100644 index 0000000..ad5f158 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC1155CollectionItem.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIERC1155CollectionItem + * + * + */ +class IMMUTABLEZKEVMAPI_API APIERC1155CollectionItem : public Model +{ +public: + virtual ~APIERC1155CollectionItem() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + ERC1155COLLECTION, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is ERC1155 */ + TypeEnum Type; + /* Address of ERC1155 collection */ + FString ContractAddress; + /* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum). */ + FString Amount; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC1155Item.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC1155Item.h new file mode 100644 index 0000000..16b82d7 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC1155Item.h @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIERC1155Item + * + * + */ +class IMMUTABLEZKEVMAPI_API APIERC1155Item : public Model +{ +public: + virtual ~APIERC1155Item() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + ERC1155, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is ERC1155 */ + TypeEnum Type; + /* Address of ERC1155 token */ + FString ContractAddress; + /* ID of ERC1155 token */ + FString TokenId; + /* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum). */ + FString Amount; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC20Item.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC20Item.h new file mode 100644 index 0000000..39b7ca8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC20Item.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIERC20Item + * + * + */ +class IMMUTABLEZKEVMAPI_API APIERC20Item : public Model +{ +public: + virtual ~APIERC20Item() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + ERC20, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is ERC20 */ + TypeEnum Type; + /* Address of ERC20 token */ + FString ContractAddress; + /* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum). */ + FString Amount; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC721CollectionItem.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC721CollectionItem.h new file mode 100644 index 0000000..394a06b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC721CollectionItem.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIERC721CollectionItem + * + * + */ +class IMMUTABLEZKEVMAPI_API APIERC721CollectionItem : public Model +{ +public: + virtual ~APIERC721CollectionItem() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + ERC721COLLECTION, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is ERC721 */ + TypeEnum Type; + /* Address of ERC721 collection */ + FString ContractAddress; + /* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum). */ + FString Amount; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC721Item.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC721Item.h new file mode 100644 index 0000000..5f9ec74 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIERC721Item.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIERC721Item + * + * + */ +class IMMUTABLEZKEVMAPI_API APIERC721Item : public Model +{ +public: + virtual ~APIERC721Item() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + ERC721, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is ERC721 */ + TypeEnum Type; + /* Address of ERC721 token */ + FString ContractAddress; + /* ID of ERC721 token */ + FString TokenId; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIExpiredOrderStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIExpiredOrderStatus.h new file mode 100644 index 0000000..7d49e84 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIExpiredOrderStatus.h @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIExpiredOrderStatus + * + * + */ +class IMMUTABLEZKEVMAPI_API APIExpiredOrderStatus : public Model +{ +public: + virtual ~APIExpiredOrderStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Expired, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* A terminal order status indicating that an order cannot be fulfilled due to expiry. */ + NameEnum Name; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIFailedOrderCancellation.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFailedOrderCancellation.h new file mode 100644 index 0000000..32e2e55 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFailedOrderCancellation.h @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIFailedOrderCancellation + * + * + */ +class IMMUTABLEZKEVMAPI_API APIFailedOrderCancellation : public Model +{ +public: + virtual ~APIFailedOrderCancellation() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* ID of the order which failed to be cancelled */ + FString Order; + enum class ReasonCodeEnum + { + Filled, + }; + + static FString EnumToString(const ReasonCodeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, ReasonCodeEnum& EnumValue); + /* Reason code indicating why the order failed to be cancelled */ + ReasonCodeEnum ReasonCode; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIFee.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFee.h new file mode 100644 index 0000000..e3bd7c0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFee.h @@ -0,0 +1,50 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIFee + * + * + */ +class IMMUTABLEZKEVMAPI_API APIFee : public Model +{ +public: + virtual ~APIFee() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Fee payable to recipient upon settlement */ + FString Amount; + enum class TypeEnum + { + Royalty, + MakerEcosystem, + TakerEcosystem, + Protocol, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Fee type */ + TypeEnum Type; + /* Wallet address of fee recipient */ + FString RecipientAddress; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIFillStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFillStatus.h new file mode 100644 index 0000000..c29e2ab --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFillStatus.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIFillStatus + * + * The ratio of the order that has been filled, an order that has been fully filled will have the same numerator and denominator values. + */ +class IMMUTABLEZKEVMAPI_API APIFillStatus : public Model +{ +public: + virtual ~APIFillStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The numerator of the fill status */ + FString Numerator; + /* The denominator of the fill status */ + FString Denominator; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIFilledOrderStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFilledOrderStatus.h new file mode 100644 index 0000000..36db628 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFilledOrderStatus.h @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIFilledOrderStatus + * + * + */ +class IMMUTABLEZKEVMAPI_API APIFilledOrderStatus : public Model +{ +public: + virtual ~APIFilledOrderStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Filled, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* A terminal order status indicating that an order has been fulfilled. */ + NameEnum Name; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillableOrder.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillableOrder.h new file mode 100644 index 0000000..507d649 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillableOrder.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrder.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIFulfillableOrder + * + * + */ +class IMMUTABLEZKEVMAPI_API APIFulfillableOrder : public Model +{ +public: + virtual ~APIFulfillableOrder() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIOrder Order; + /* Token ID for the ERC721 or ERC1155 token when fulfilling a collection order */ + TOptional TokenId; + FString ExtraData; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillmentData200Response.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillmentData200Response.h new file mode 100644 index 0000000..612860d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillmentData200Response.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIFulfillmentData200ResponseResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIFulfillmentData200Response + * + * + */ +class IMMUTABLEZKEVMAPI_API APIFulfillmentData200Response : public Model +{ +public: + virtual ~APIFulfillmentData200Response() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIFulfillmentData200ResponseResult Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillmentData200ResponseResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillmentData200ResponseResult.h new file mode 100644 index 0000000..55746fa --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillmentData200ResponseResult.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIFulfillableOrder.h" +#include "APIUnfulfillableOrder.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIFulfillmentData200ResponseResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIFulfillmentData200ResponseResult : public Model +{ +public: + virtual ~APIFulfillmentData200ResponseResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TArray FulfillableOrders; + TArray UnfulfillableOrders; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillmentDataRequest.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillmentDataRequest.h new file mode 100644 index 0000000..e428707 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIFulfillmentDataRequest.h @@ -0,0 +1,41 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIFee.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIFulfillmentDataRequest + * + * + */ +class IMMUTABLEZKEVMAPI_API APIFulfillmentDataRequest : public Model +{ +public: + virtual ~APIFulfillmentDataRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FGuid OrderId; + /* Address of the intended account fulfilling the order */ + FString TakerAddress; + TArray Fees; + /* Token ID for the ERC721 or ERC1155 token when fulfilling a collection order */ + TOptional TokenId; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetActivityResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetActivityResult.h new file mode 100644 index 0000000..6ba93da --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetActivityResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivity.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIGetActivityResult + * + * Single activity + */ +class IMMUTABLEZKEVMAPI_API APIGetActivityResult : public Model +{ +public: + virtual ~APIGetActivityResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIActivity Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetCollectionResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetCollectionResult.h new file mode 100644 index 0000000..763426f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetCollectionResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICollection.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIGetCollectionResult + * + * Single Collection + */ +class IMMUTABLEZKEVMAPI_API APIGetCollectionResult : public Model +{ +public: + virtual ~APIGetCollectionResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APICollection Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetLinkedAddressesRes.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetLinkedAddressesRes.h new file mode 100644 index 0000000..d43728f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetLinkedAddressesRes.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIGetLinkedAddressesRes + * + * + */ +class IMMUTABLEZKEVMAPI_API APIGetLinkedAddressesRes : public Model +{ +public: + virtual ~APIGetLinkedAddressesRes() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The user's list of linked addresses */ + TArray LinkedAddresses; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetMetadataResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetMetadataResult.h new file mode 100644 index 0000000..dd15272 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetMetadataResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIMetadata.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIGetMetadataResult + * + * Single metadata + */ +class IMMUTABLEZKEVMAPI_API APIGetMetadataResult : public Model +{ +public: + virtual ~APIGetMetadataResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIMetadata Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetMintRequestResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetMintRequestResult.h new file mode 100644 index 0000000..b394323 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetMintRequestResult.h @@ -0,0 +1,58 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIMintRequestErrorMessage.h" +#include "APIMintRequestStatus.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIGetMintRequestResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIGetMintRequestResult : public Model +{ +public: + virtual ~APIGetMintRequestResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* The address of the contract */ + FString CollectionAddress; + /* The reference id of this mint request */ + FString ReferenceId; + /* The address of the owner of the NFT */ + FString OwnerAddress; + /* An `uint256` token id as string. Only available when the mint request succeeds */ + TOptional TokenId; + /* An `uint256` amount as string. Only relevant for mint requests on ERC1155 contracts */ + TOptional Amount; + /* The id of the mint activity associated with this mint request */ + TOptional ActivityId; + /* The transaction hash of the activity */ + TOptional TransactionHash; + /* When the mint request was created */ + FDateTime CreatedAt; + /* When the mint request was last updated */ + FDateTime UpdatedAt; + TOptional Error; + APIMintRequestStatus Status; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetNFTResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetNFTResult.h new file mode 100644 index 0000000..3d468c9 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetNFTResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFT.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIGetNFTResult + * + * Single NFT + */ +class IMMUTABLEZKEVMAPI_API APIGetNFTResult : public Model +{ +public: + virtual ~APIGetNFTResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APINFT Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetTokenResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetTokenResult.h new file mode 100644 index 0000000..2f47c9a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIGetTokenResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIToken.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIGetTokenResult + * + * Single Token + */ +class IMMUTABLEZKEVMAPI_API APIGetTokenResult : public Model +{ +public: + virtual ~APIGetTokenResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIToken Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIHelpers.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIHelpers.h new file mode 100644 index 0000000..b55adc0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIHelpers.h @@ -0,0 +1,477 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +#include "Serialization/JsonSerializer.h" +#include "Dom/JsonObject.h" +#include "Misc/Base64.h" +#include "PlatformHttp.h" + +class IHttpRequest; + +namespace ImmutablezkEVMAPI +{ + +typedef TSharedRef> JsonWriter; + +////////////////////////////////////////////////////////////////////////// + +class IMMUTABLEZKEVMAPI_API HttpFileInput +{ +public: + explicit HttpFileInput(const TCHAR* InFilePath); + explicit HttpFileInput(const FString& InFilePath); + + // This will automatically set the content type if not already set + void SetFilePath(const TCHAR* InFilePath); + void SetFilePath(const FString& InFilePath); + + // Optional if it can be deduced from the FilePath + void SetContentType(const TCHAR* ContentType); + + HttpFileInput& operator=(const HttpFileInput& Other) = default; + HttpFileInput& operator=(const FString& InFilePath) { SetFilePath(*InFilePath); return*this; } + HttpFileInput& operator=(const TCHAR* InFilePath) { SetFilePath(InFilePath); return*this; } + + const FString& GetFilePath() const { return FilePath; } + const FString& GetContentType() const { return ContentType; } + + // Returns the filename with extension + FString GetFilename() const; + +private: + FString FilePath; + FString ContentType; +}; + +////////////////////////////////////////////////////////////////////////// + +class HttpMultipartFormData +{ +public: + void SetBoundary(const TCHAR* InBoundary); + void SetupHttpRequest(const FHttpRequestRef& HttpRequest); + + void AddStringPart(const TCHAR* Name, const TCHAR* Data); + void AddJsonPart(const TCHAR* Name, const FString& JsonString); + void AddBinaryPart(const TCHAR* Name, const TArray& ByteArray); + void AddFilePart(const TCHAR* Name, const HttpFileInput& File); + +private: + void AppendString(const TCHAR* Str); + const FString& GetBoundary() const; + + mutable FString Boundary; + TArray FormData; + + static const TCHAR* Delimiter; + static const TCHAR* Newline; +}; + +////////////////////////////////////////////////////////////////////////// + +// Decodes Base64Url encoded strings, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +bool Base64UrlDecode(const FString& Base64String, T& Value) +{ + FString TmpCopy(Base64String); + TmpCopy.ReplaceInline(TEXT("-"), TEXT("+")); + TmpCopy.ReplaceInline(TEXT("_"), TEXT("/")); + + return FBase64::Decode(TmpCopy, Value); +} + +// Encodes strings in Base64Url, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +FString Base64UrlEncode(const T& Value) +{ + FString Base64String = FBase64::Encode(Value); + Base64String.ReplaceInline(TEXT("+"), TEXT("-")); + Base64String.ReplaceInline(TEXT("/"), TEXT("_")); + return Base64String; +} + +template +inline auto ToString(const T& Value) + -> typename std::enable_if::value, FString>::type +{ + return ::LexToString(Value); +} + +template +inline auto ToString(const T& EnumModelValue) + -> typename std::enable_if::value, FString>::type +{ + return T::EnumToString(EnumModelValue.Value); +} + +inline FString ToString(const Model& Value) +{ + FString String; + JsonWriter Writer = TJsonWriterFactory<>::Create(&String); + Value.WriteJson(Writer); + Writer->Close(); + return String; +} + +inline FString ToString(const FDateTime& Value) +{ + return Value.ToIso8601(); +} + +inline FString ToString(const FGuid& Value) +{ + return Value.ToString(EGuidFormats::DigitsWithHyphens); +} + +inline FString ToString(const TArray& Value) +{ + return FBase64::Encode(Value); +} + +template +inline FString ToUrlString(const T& Value) +{ + return FPlatformHttp::UrlEncode(ToString(Value)); +} + +inline FString ToUrlString(const TArray& Value) +{ + return Base64UrlEncode(Value); +} + +template +inline FString CollectionToUrlString(const TArray& Collection, const TCHAR* Separator) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += ToUrlString(Collection[0]); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("{0}{1}"), { Separator, *ToUrlString(Collection[i]) }); + } + return Output; +} + +template +inline FString CollectionToUrlString_csv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(",")); +} + +template +inline FString CollectionToUrlString_ssv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(" ")); +} + +template +inline FString CollectionToUrlString_tsv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("\t")); +} + +template +inline FString CollectionToUrlString_pipes(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("|")); +} + +template +inline FString CollectionToUrlString_multi(const TArray& Collection, const TCHAR* BaseName) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += FString::Format(TEXT("{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[0]) }); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("&{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[i]) }); + } + return Output; +} + + +template +inline FString CollectionToUrlString_multi(const TSet& Collection, const TCHAR* BaseName) +{ + FString Output; + if (Collection.Num() == 0) + { + return Output; + } + + int32 Index = 0; + for (typename TSet::TConstIterator Iter = Collection.CreateConstIterator(); Iter; ++Iter) + { + if (Index == 0) + { + Output += FString::Format(TEXT("{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(*Iter) }); + Index++; + continue; + } + Output += FString::Format(TEXT("&{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(*Iter) }); + } + return Output; +} + +////////////////////////////////////////////////////////////////////////// + +inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr& Value) +{ + if (Value.IsValid()) + { + FJsonSerializer::Serialize(Value.ToSharedRef(), "", Writer, false); + } + else + { + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); + } +} + +inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr& Value) +{ + if (Value.IsValid()) + { + FJsonSerializer::Serialize(Value.ToSharedRef(), Writer, false); + } + else + { + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); + } +} + +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteValue(FBase64::Encode(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value) +{ + Writer->WriteValue(Value.ToIso8601()); +} + +inline void WriteJsonValue(JsonWriter& Writer, const FGuid& Value) +{ + Writer->WriteValue(Value.ToString(EGuidFormats::DigitsWithHyphens)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const Model& Value) +{ + Value.WriteJson(Writer); +} + +template::value, int>::type = 0> +inline void WriteJsonValue(JsonWriter& Writer, const T& Value) +{ + Writer->WriteValue(Value); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteArrayStart(); + for (const auto& Element : Value) + { + WriteJsonValue(Writer, Element); + } + Writer->WriteArrayEnd(); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TMap& Value) +{ + Writer->WriteObjectStart(); + for (const auto& It : Value) + { + Writer->WriteIdentifierPrefix(It.Key); + WriteJsonValue(Writer, It.Value); + } + Writer->WriteObjectEnd(); +} + +////////////////////////////////////////////////////////////////////////// + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FString& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +IMMUTABLEZKEVMAPI_API bool ParseDateTime(const FString& DateTimeString, FDateTime& OutDateTime); + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FDateTime& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + return ParseDateTime(TmpValue, Value); + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FGuid& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + return FGuid::Parse(TmpValue, Value); + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, bool& Value) +{ + bool TmpValue; + if (JsonValue->TryGetBool(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSharedPtr& JsonObjectValue) +{ + JsonObjectValue = JsonValue; + return true; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSharedPtr& JsonObjectValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + JsonObjectValue = *Object; + return true; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + FBase64::Decode(TmpValue, Value); + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, Model& Value) +{ + return Value.FromJson(JsonValue); +} + +template::value, int>::type = 0> +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, T& Value) +{ + T TmpValue; + if (JsonValue->TryGetNumber(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& ArrayValue) +{ + const TArray>* JsonArray; + if (JsonValue->TryGetArray(JsonArray)) + { + bool ParseSuccess = true; + const int32 Count = JsonArray->Num(); + ArrayValue.Reset(Count); + for (int i = 0; i < Count; i++) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue((*JsonArray)[i], TmpValue); + ArrayValue.Emplace(MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TMap& MapValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + MapValue.Reset(); + bool ParseSuccess = true; + for (const auto& It : (*Object)->Values) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue(It.Value, TmpValue); + MapValue.Emplace(It.Key, MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, T& Value) +{ + const TSharedPtr JsonValue = JsonObject->TryGetField(Key); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + return TryGetJsonValue(JsonValue, Value); + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, TOptional& OptionalValue) +{ + const TSharedPtr JsonValue = JsonObject->TryGetField(Key); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + T Value; + if (TryGetJsonValue(JsonValue, Value)) + { + OptionalValue = Value; + return true; + } + else + return false; + } + // Absence of optional value is not a parsing error. + // Nullable is handled like optional. + return true; +} + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIInactiveOrderStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIInactiveOrderStatus.h new file mode 100644 index 0000000..2f2bb60 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIInactiveOrderStatus.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIInactiveOrderStatus + * + * + */ +class IMMUTABLEZKEVMAPI_API APIInactiveOrderStatus : public Model +{ +public: + virtual ~APIInactiveOrderStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Inactive, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* The order status that indicates an order cannot be fulfilled. */ + NameEnum Name; + /* Whether the order offerer has sufficient approvals */ + bool SufficientApprovals = false; + /* Whether the order offerer still has sufficient balance to complete the order */ + bool SufficientBalances = false; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIItem.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIItem.h new file mode 100644 index 0000000..175db4f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIItem.h @@ -0,0 +1,60 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIERC1155CollectionItem.h" +#include "APIERC1155Item.h" +#include "APIERC20Item.h" +#include "APIERC721CollectionItem.h" +#include "APIERC721Item.h" +#include "APINativeItem.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIItem + * + * + */ +class IMMUTABLEZKEVMAPI_API APIItem : public Model +{ +public: + virtual ~APIItem() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + Native, + ERC20, + ERC721, + ERC1155, + ERC721COLLECTION, + ERC1155COLLECTION, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is the native IMX token */ + TypeEnum Type; + /* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum). */ + FString Amount; + /* Address of ERC1155 collection */ + FString ContractAddress; + /* ID of ERC1155 token */ + FString TokenId; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APILastTrade.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APILastTrade.h new file mode 100644 index 0000000..f9f9752 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APILastTrade.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIMarketPriceDetails.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APILastTrade + * + * Most recent trade + */ +class IMMUTABLEZKEVMAPI_API APILastTrade : public Model +{ +public: + virtual ~APILastTrade() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Trade ID */ + FGuid TradeId; + /* ETH Address of collection that the asset belongs to */ + FString ContractAddress; + /* Token id of the traded asset (uint256 as string) */ + FString TokenId; + /* Price details, list of payments involved in this trade */ + TArray PriceDetails; + /* Amount of the trade (uint256 as string) */ + FString Amount; + /* When the trade was created */ + FDateTime CreatedAt; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APILinkWalletV2Request.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APILinkWalletV2Request.h new file mode 100644 index 0000000..e938570 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APILinkWalletV2Request.h @@ -0,0 +1,42 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APILinkWalletV2Request + * + * Link wallet V2 request + */ +class IMMUTABLEZKEVMAPI_API APILinkWalletV2Request : public Model +{ +public: + virtual ~APILinkWalletV2Request() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* This should be the EIP-6963 rdns value, if you're unable to get the rdns value you can provide \"External\". If using WalletConnect then provide \"WalletConnect\". */ + FString Type; + /* The address of the external wallet being linked to Passport */ + FString WalletAddress; + /* The EIP-712 signature */ + FString Signature; + /* A unique identifier for the signature */ + FString Nonce; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListActivitiesResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListActivitiesResult.h new file mode 100644 index 0000000..750fe10 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListActivitiesResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivity.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListActivitiesResult + * + * List activities response + */ +class IMMUTABLEZKEVMAPI_API APIListActivitiesResult : public Model +{ +public: + virtual ~APIListActivitiesResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of activities */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListBidsResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListBidsResult.h new file mode 100644 index 0000000..e6268d2 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListBidsResult.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrder.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListBidsResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListBidsResult : public Model +{ +public: + virtual ~APIListBidsResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIPage Page; + TArray Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListChainsResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListChainsResult.h new file mode 100644 index 0000000..37eb09d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListChainsResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChainWithDetails.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListChainsResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListChainsResult : public Model +{ +public: + virtual ~APIListChainsResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of chains */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListCollectionBidsResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListCollectionBidsResult.h new file mode 100644 index 0000000..1c8ffc9 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListCollectionBidsResult.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrder.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListCollectionBidsResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListCollectionBidsResult : public Model +{ +public: + virtual ~APIListCollectionBidsResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIPage Page; + TArray Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListCollectionOwnersResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListCollectionOwnersResult.h new file mode 100644 index 0000000..c7a452b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListCollectionOwnersResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTWithOwner.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListCollectionOwnersResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListCollectionOwnersResult : public Model +{ +public: + virtual ~APIListCollectionOwnersResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of NFT owners */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListCollectionsResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListCollectionsResult.h new file mode 100644 index 0000000..8918a60 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListCollectionsResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICollection.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListCollectionsResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListCollectionsResult : public Model +{ +public: + virtual ~APIListCollectionsResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of collections */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListListingsResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListListingsResult.h new file mode 100644 index 0000000..216f93d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListListingsResult.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrder.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListListingsResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListListingsResult : public Model +{ +public: + virtual ~APIListListingsResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIPage Page; + TArray Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListMetadataResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListMetadataResult.h new file mode 100644 index 0000000..4619135 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListMetadataResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIMetadata.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListMetadataResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListMetadataResult : public Model +{ +public: + virtual ~APIListMetadataResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of metadata */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListMintRequestsResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListMintRequestsResult.h new file mode 100644 index 0000000..3f94332 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListMintRequestsResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIGetMintRequestResult.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListMintRequestsResult + * + * List mint requests + */ +class IMMUTABLEZKEVMAPI_API APIListMintRequestsResult : public Model +{ +public: + virtual ~APIListMintRequestsResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of mint requests */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListNFTOwnersResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListNFTOwnersResult.h new file mode 100644 index 0000000..54de7cb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListNFTOwnersResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTOwner.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListNFTOwnersResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListNFTOwnersResult : public Model +{ +public: + virtual ~APIListNFTOwnersResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of nft owners */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListNFTsByOwnerResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListNFTsByOwnerResult.h new file mode 100644 index 0000000..bf53697 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListNFTsByOwnerResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTWithBalance.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListNFTsByOwnerResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListNFTsByOwnerResult : public Model +{ +public: + virtual ~APIListNFTsByOwnerResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of NFTs by owner */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListNFTsResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListNFTsResult.h new file mode 100644 index 0000000..8d3b34c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListNFTsResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFT.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListNFTsResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListNFTsResult : public Model +{ +public: + virtual ~APIListNFTsResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of NFTs */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListTokensResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListTokensResult.h new file mode 100644 index 0000000..85fc832 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListTokensResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIPage.h" +#include "APIToken.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListTokensResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListTokensResult : public Model +{ +public: + virtual ~APIListTokensResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of tokens */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListTradeResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListTradeResult.h new file mode 100644 index 0000000..1b256c6 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListTradeResult.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIPage.h" +#include "APITrade.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListTradeResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListTradeResult : public Model +{ +public: + virtual ~APIListTradeResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIPage Page; + TArray Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListing.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListing.h new file mode 100644 index 0000000..4c395fa --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListing.h @@ -0,0 +1,48 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIMarketPriceDetails.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListing + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListing : public Model +{ +public: + virtual ~APIListing() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Global Order identifier */ + FString ListingId; + APIMarketPriceDetails PriceDetails; + /* A mapping of converted prices for major currencies such as ETH, USD. All converted prices are fee-inclusive. */ + TMap ConvertedPrices; + /* Token ID */ + FString TokenId; + /* ETH Address of collection that the asset belongs to */ + FString ContractAddress; + /* ETH Address of listing creator */ + FString Creator; + /* Amount of token included in the listing */ + FString Amount; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIListingResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListingResult.h new file mode 100644 index 0000000..4b70c3e --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIListingResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrder.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIListingResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIListingResult : public Model +{ +public: + virtual ~APIListingResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIOrder Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarket.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarket.h new file mode 100644 index 0000000..cf61f09 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarket.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APILastTrade.h" +#include "APIListing.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMarket + * + * Market data + */ +class IMMUTABLEZKEVMAPI_API APIMarket : public Model +{ +public: + virtual ~APIMarket() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Cheapest active listing */ + TOptional FloorListing; + TOptional LastTrade; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketNft.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketNft.h new file mode 100644 index 0000000..144f074 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketNft.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APILastTrade.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMarketNft + * + * NFT market data + */ +class IMMUTABLEZKEVMAPI_API APIMarketNft : public Model +{ +public: + virtual ~APIMarketNft() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional LastTrade; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceDetails.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceDetails.h new file mode 100644 index 0000000..10c0e9e --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceDetails.h @@ -0,0 +1,42 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIMarketPriceDetailsToken.h" +#include "APIMarketPriceFees.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMarketPriceDetails + * + * Market Price details + */ +class IMMUTABLEZKEVMAPI_API APIMarketPriceDetails : public Model +{ +public: + virtual ~APIMarketPriceDetails() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIMarketPriceDetailsToken Token; + /* The token amount value. This value is provided in the smallest unit of the token (e.g. wei for ETH) */ + FString Amount; + /* The token amount value. This value is provided in the smallest unit of the token (e.g. wei for ETH) */ + FString FeeInclusiveAmount; + TArray Fees; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceDetailsToken.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceDetailsToken.h new file mode 100644 index 0000000..6b3e167 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceDetailsToken.h @@ -0,0 +1,52 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIMarketPriceERC20Token.h" +#include "APIMarketPriceNativeToken.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMarketPriceDetailsToken + * + * Token details + */ +class IMMUTABLEZKEVMAPI_API APIMarketPriceDetailsToken : public Model +{ +public: + virtual ~APIMarketPriceDetailsToken() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + Native, + ERC20, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is the native IMX token */ + TypeEnum Type; + /* The symbol of token */ + TOptional Symbol; + /* Address of ERC20 token */ + FString ContractAddress; + /* The decimals of token */ + TOptional Decimals; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceERC20Token.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceERC20Token.h new file mode 100644 index 0000000..9c14e3e --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceERC20Token.h @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMarketPriceERC20Token + * + * + */ +class IMMUTABLEZKEVMAPI_API APIMarketPriceERC20Token : public Model +{ +public: + virtual ~APIMarketPriceERC20Token() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + ERC20, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is ERC20 */ + TypeEnum Type; + /* Address of ERC20 token */ + FString ContractAddress; + /* The symbol of token */ + TOptional Symbol; + /* The decimals of token */ + TOptional Decimals; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceFees.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceFees.h new file mode 100644 index 0000000..016f5c1 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceFees.h @@ -0,0 +1,50 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMarketPriceFees + * + * + */ +class IMMUTABLEZKEVMAPI_API APIMarketPriceFees : public Model +{ +public: + virtual ~APIMarketPriceFees() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Fee in the payment currency */ + FString Amount; + enum class TypeEnum + { + Royalty, + MakerEcosystem, + TakerEcosystem, + Protocol, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Fee type */ + TypeEnum Type; + /* Wallet address of fee recipient */ + FString RecipientAddress; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceNativeToken.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceNativeToken.h new file mode 100644 index 0000000..edcd3ea --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketPriceNativeToken.h @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMarketPriceNativeToken + * + * + */ +class IMMUTABLEZKEVMAPI_API APIMarketPriceNativeToken : public Model +{ +public: + virtual ~APIMarketPriceNativeToken() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + Native, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is the native IMX token */ + TypeEnum Type; + /* The symbol of token */ + TOptional Symbol; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketplaceContractType.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketplaceContractType.h new file mode 100644 index 0000000..b0f9be0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMarketplaceContractType.h @@ -0,0 +1,44 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMarketplaceContractType + * + * The contract type for a collection + */ +class IMMUTABLEZKEVMAPI_API APIMarketplaceContractType : public Model +{ +public: + virtual ~APIMarketplaceContractType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + ERC721, + ERC1155, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadata.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadata.h new file mode 100644 index 0000000..4f8db12 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadata.h @@ -0,0 +1,59 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APINFTMetadataAttribute.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMetadata + * + * + */ +class IMMUTABLEZKEVMAPI_API APIMetadata : public Model +{ +public: + virtual ~APIMetadata() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Metadata id in UUIDv4 format */ + FGuid Id; + APIChain Chain; + /* The contract address of the metadata */ + FString ContractAddress; + /* When the metadata was created */ + FDateTime CreatedAt; + /* When the metadata was last updated */ + TOptional UpdatedAt; + /* The name of the NFT */ + TOptional Name; + /* The description of the NFT */ + TOptional Description; + /* The image url of the NFT */ + TOptional Image; + /* The external website link of NFT */ + TOptional ExternalUrl; + /* The animation url of the NFT */ + TOptional AnimationUrl; + /* The youtube URL of NFT */ + TOptional YoutubeUrl; + /* List of Metadata attributes */ + TOptional> Attributes; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadataApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadataApi.h new file mode 100644 index 0000000..97b47f1 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadataApi.h @@ -0,0 +1,81 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APIMetadataApi +{ +public: + APIMetadataApi(); + ~APIMetadataApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class GetMetadataRequest; + class GetMetadataResponse; + class ListMetadataRequest; + class ListMetadataResponse; + class ListMetadataForChainRequest; + class ListMetadataForChainResponse; + class RefreshMetadataByIDRequest; + class RefreshMetadataByIDResponse; + class RefreshNFTMetadataByTokenIDRequest; + class RefreshNFTMetadataByTokenIDResponse; + + DECLARE_DELEGATE_OneParam(FGetMetadataDelegate, const GetMetadataResponse&); + DECLARE_DELEGATE_OneParam(FListMetadataDelegate, const ListMetadataResponse&); + DECLARE_DELEGATE_OneParam(FListMetadataForChainDelegate, const ListMetadataForChainResponse&); + DECLARE_DELEGATE_OneParam(FRefreshMetadataByIDDelegate, const RefreshMetadataByIDResponse&); + DECLARE_DELEGATE_OneParam(FRefreshNFTMetadataByTokenIDDelegate, const RefreshNFTMetadataByTokenIDResponse&); + + FHttpRequestPtr GetMetadata(const GetMetadataRequest& Request, const FGetMetadataDelegate& Delegate = FGetMetadataDelegate()) const; + FHttpRequestPtr ListMetadata(const ListMetadataRequest& Request, const FListMetadataDelegate& Delegate = FListMetadataDelegate()) const; + FHttpRequestPtr ListMetadataForChain(const ListMetadataForChainRequest& Request, const FListMetadataForChainDelegate& Delegate = FListMetadataForChainDelegate()) const; + FHttpRequestPtr RefreshMetadataByID(const RefreshMetadataByIDRequest& Request, const FRefreshMetadataByIDDelegate& Delegate = FRefreshMetadataByIDDelegate()) const; + FHttpRequestPtr RefreshNFTMetadataByTokenID(const RefreshNFTMetadataByTokenIDRequest& Request, const FRefreshNFTMetadataByTokenIDDelegate& Delegate = FRefreshNFTMetadataByTokenIDDelegate()) const; + +private: + void OnGetMetadataResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMetadataDelegate Delegate) const; + void OnListMetadataResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMetadataDelegate Delegate) const; + void OnListMetadataForChainResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMetadataForChainDelegate Delegate) const; + void OnRefreshMetadataByIDResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshMetadataByIDDelegate Delegate) const; + void OnRefreshNFTMetadataByTokenIDResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FRefreshNFTMetadataByTokenIDDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadataApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadataApiOperations.h new file mode 100644 index 0000000..96d744d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadataApiOperations.h @@ -0,0 +1,184 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIMetadataApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError401.h" +#include "APIAPIError403.h" +#include "APIAPIError404.h" +#include "APIAPIError429.h" +#include "APIAPIError500.h" +#include "APIGetMetadataResult.h" +#include "APIListMetadataResult.h" +#include "APIMetadataRefreshRateLimitResult.h" +#include "APIRefreshMetadataByIDRequest.h" +#include "APIRefreshNFTMetadataByTokenIDRequest.h" + +namespace ImmutablezkEVMAPI +{ + +/* Get metadata by ID + * + * Get metadata by ID +*/ +class IMMUTABLEZKEVMAPI_API APIMetadataApi::GetMetadataRequest : public Request +{ +public: + virtual ~GetMetadataRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* The address of metadata contract */ + FString ContractAddress; + /* The id of the metadata */ + FGuid MetadataId; +}; + +class IMMUTABLEZKEVMAPI_API APIMetadataApi::GetMetadataResponse : public Response +{ +public: + virtual ~GetMetadataResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIGetMetadataResult Content; +}; + +/* Get a list of metadata from the given contract + * + * Get a list of metadata from the given contract +*/ +class IMMUTABLEZKEVMAPI_API APIMetadataApi::ListMetadataRequest : public Request +{ +public: + virtual ~ListMetadataRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* The address of metadata contract */ + FString ContractAddress; + /* Datetime to use as the oldest updated timestamp */ + TOptional FromUpdatedAt; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APIMetadataApi::ListMetadataResponse : public Response +{ +public: + virtual ~ListMetadataResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListMetadataResult Content; +}; + +/* Get a list of metadata from the given chain + * + * Get a list of metadata from the given chain +*/ +class IMMUTABLEZKEVMAPI_API APIMetadataApi::ListMetadataForChainRequest : public Request +{ +public: + virtual ~ListMetadataForChainRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* Datetime to use as the oldest updated timestamp */ + TOptional FromUpdatedAt; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APIMetadataApi::ListMetadataForChainResponse : public Response +{ +public: + virtual ~ListMetadataForChainResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListMetadataResult Content; +}; + +/* Refresh stacked metadata + * + * Refresh stacked metadata +*/ +class IMMUTABLEZKEVMAPI_API APIMetadataApi::RefreshMetadataByIDRequest : public Request +{ +public: + virtual ~RefreshMetadataByIDRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* Contract address */ + FString ContractAddress; + /* NFT Metadata Refresh Request */ + APIRefreshMetadataByIDRequest APIRefreshMetadataByIDRequest; +}; + +class IMMUTABLEZKEVMAPI_API APIMetadataApi::RefreshMetadataByIDResponse : public Response +{ +public: + virtual ~RefreshMetadataByIDResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIMetadataRefreshRateLimitResult Content; +}; + +/* Refresh NFT metadata + * + * Refresh NFT metadata +*/ +class IMMUTABLEZKEVMAPI_API APIMetadataApi::RefreshNFTMetadataByTokenIDRequest : public Request +{ +public: + virtual ~RefreshNFTMetadataByTokenIDRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address of contract */ + FString ContractAddress; + /* The name of chain */ + FString ChainName; + /* the request body */ + APIRefreshNFTMetadataByTokenIDRequest APIRefreshNFTMetadataByTokenIDRequest; +}; + +class IMMUTABLEZKEVMAPI_API APIMetadataApi::RefreshNFTMetadataByTokenIDResponse : public Response +{ +public: + virtual ~RefreshNFTMetadataByTokenIDResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIMetadataRefreshRateLimitResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadataRefreshRateLimitResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadataRefreshRateLimitResult.h new file mode 100644 index 0000000..3ae787f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMetadataRefreshRateLimitResult.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMetadataRefreshRateLimitResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIMetadataRefreshRateLimitResult : public Model +{ +public: + virtual ~APIMetadataRefreshRateLimitResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString ImxRefreshesLimit; + FString ImxRefreshLimitReset; + FString ImxRemainingRefreshes; + FString RetryAfter; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMint.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMint.h new file mode 100644 index 0000000..69e53c0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMint.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityAsset.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMint + * + * The mint activity details + */ +class IMMUTABLEZKEVMAPI_API APIMint : public Model +{ +public: + virtual ~APIMint() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The account address the asset was minted to */ + FString To; + /* The minted amount */ + FString Amount; + APIActivityAsset Asset; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMintAsset.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMintAsset.h new file mode 100644 index 0000000..11c0fca --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMintAsset.h @@ -0,0 +1,44 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTMetadataRequest.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMintAsset + * + * + */ +class IMMUTABLEZKEVMAPI_API APIMintAsset : public Model +{ +public: + virtual ~APIMintAsset() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The id of this asset in the system that originates the mint request */ + FString ReferenceId; + /* The address of the receiver */ + FString OwnerAddress; + /* An optional `uint256` token id as string. Required for ERC1155 collections. */ + TOptional TokenId; + /* Optional mount of tokens to mint. Required for ERC1155 collections. ERC712 collections can omit this field or set it to 1 */ + TOptional Amount; + TOptional Metadata; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMintRequestErrorMessage.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMintRequestErrorMessage.h new file mode 100644 index 0000000..468687a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMintRequestErrorMessage.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMintRequestErrorMessage + * + * The error details in case the mint request fails + */ +class IMMUTABLEZKEVMAPI_API APIMintRequestErrorMessage : public Model +{ +public: + virtual ~APIMintRequestErrorMessage() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* An error message in case the mint request fails */ + TOptional Message; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIMintRequestStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMintRequestStatus.h new file mode 100644 index 0000000..8c9fd98 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIMintRequestStatus.h @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIMintRequestStatus + * + * The status of the mint request + */ +class IMMUTABLEZKEVMAPI_API APIMintRequestStatus : public Model +{ +public: + virtual ~APIMintRequestStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + Pending, + Succeeded, + Failed, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFT.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFT.h new file mode 100644 index 0000000..83716bb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFT.h @@ -0,0 +1,69 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APINFTContractType.h" +#include "APINFTMetadataAttribute.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFT + * + * + */ +class IMMUTABLEZKEVMAPI_API APINFT : public Model +{ +public: + virtual ~APINFT() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* An `uint256` token id as string */ + FString TokenId; + /* The contract address of the NFT */ + FString ContractAddress; + APINFTContractType ContractType; + /* When the NFT was first indexed */ + FDateTime IndexedAt; + /* When the NFT owner was last updated */ + FDateTime UpdatedAt; + /* When NFT metadata was last synced */ + TOptional MetadataSyncedAt; + /* The id of the metadata of this NFT */ + TOptional MetadataId; + /* The name of the NFT */ + TOptional Name; + /* The description of the NFT */ + TOptional Description; + /* The image url of the NFT */ + TOptional Image; + /* (deprecated - use external_url instead) The external website link of NFT */ + TOptional ExternalLink; + /* The external website link of NFT */ + TOptional ExternalUrl; + /* The animation url of the NFT */ + TOptional AnimationUrl; + /* The youtube URL of NFT */ + TOptional YoutubeUrl; + /* List of NFT Metadata attributes */ + TArray Attributes; + /* The total supply of NFT */ + TOptional TotalSupply; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTBundle.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTBundle.h new file mode 100644 index 0000000..ceb3113 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTBundle.h @@ -0,0 +1,41 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIListing.h" +#include "APIMarket.h" +#include "APINFTWithStack.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTBundle + * + * NFT bundle includes NFT with stack, markets and listings + */ +class IMMUTABLEZKEVMAPI_API APINFTBundle : public Model +{ +public: + virtual ~APINFTBundle() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APINFTWithStack NftWithStack; + TOptional Market; + /* List of open listings for the stack. */ + TArray Listings; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTContractType.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTContractType.h new file mode 100644 index 0000000..30936af --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTContractType.h @@ -0,0 +1,44 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTContractType + * + * The contract type for an NFT + */ +class IMMUTABLEZKEVMAPI_API APINFTContractType : public Model +{ +public: + virtual ~APINFTContractType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + ERC721, + ERC1155, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTMetadataAttribute.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTMetadataAttribute.h new file mode 100644 index 0000000..811e010 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTMetadataAttribute.h @@ -0,0 +1,55 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTMetadataAttributeValue.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTMetadataAttribute + * + * + */ +class IMMUTABLEZKEVMAPI_API APINFTMetadataAttribute : public Model +{ +public: + virtual ~APINFTMetadataAttribute() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class DisplayTypeEnum + { + Number, + BoostPercentage, + BoostNumber, + Date, + }; + + static FString EnumToString(const DisplayTypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, DisplayTypeEnum& EnumValue); + /* Display type for this attribute */ + TOptional DisplayType; + /* The metadata trait type */ + FString TraitType; + + // -- DIVERGE + //APINFTMetadataAttributeValue Value; + // NOTE! Edited to FString but has to be OpenAPINFTMetadataAttributeValue; Currently OpenAPI generates empty OpenAPINFTMetadataAttributeValue structure + FString Value; + // -- DIVERGE +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTMetadataAttributeValue.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTMetadataAttributeValue.h new file mode 100644 index 0000000..8ca2d1e --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTMetadataAttributeValue.h @@ -0,0 +1,34 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTMetadataAttributeValue + * + * The metadata trait value + */ +class IMMUTABLEZKEVMAPI_API APINFTMetadataAttributeValue : public Model +{ +public: + virtual ~APINFTMetadataAttributeValue() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTMetadataRequest.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTMetadataRequest.h new file mode 100644 index 0000000..b7fe8c8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTMetadataRequest.h @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTMetadataAttribute.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTMetadataRequest + * + * The NFT metadata. Total size of this object should not exceed 16 KiB + */ +class IMMUTABLEZKEVMAPI_API APINFTMetadataRequest : public Model +{ +public: + virtual ~APINFTMetadataRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The name of the NFT */ + TOptional Name; + /* The description of the NFT */ + TOptional Description; + /* The image url of the NFT */ + TOptional Image; + /* The external link of the NFT */ + TOptional ExternalUrl; + /* The animation url of the NFT */ + TOptional AnimationUrl; + /* The youtube link of the NFT */ + TOptional YoutubeUrl; + /* List of Metadata attributes */ + TOptional> Attributes; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTOwner.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTOwner.h new file mode 100644 index 0000000..34c6d56 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTOwner.h @@ -0,0 +1,46 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTOwner + * + * + */ +class IMMUTABLEZKEVMAPI_API APINFTOwner : public Model +{ +public: + virtual ~APINFTOwner() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* The address of NFT contract */ + FString ContractAddress; + /* An `uint256` token id as string */ + FString TokenId; + /* The account address of the owner of the NFT */ + FString AccountAddress; + /* The amount of owned tokens (uint256 as string) */ + FString Balance; + /* When the NFT owner was last updated */ + TOptional UpdatedAt; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTQuoteResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTQuoteResult.h new file mode 100644 index 0000000..b09d35c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTQuoteResult.h @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIMarket.h" +#include "APIMarketNft.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTQuoteResult + * + * NFT quote result + */ +class IMMUTABLEZKEVMAPI_API APINFTQuoteResult : public Model +{ +public: + virtual ~APINFTQuoteResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* Token id of NFT (uint256 as string) */ + FString TokenId; + APIMarket MarketStack; + APIMarketNft MarketNft; + APIMarket MarketCollection; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTSale.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTSale.h new file mode 100644 index 0000000..2deeb62 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTSale.h @@ -0,0 +1,44 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityNFT.h" +#include "APISalePayment.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTSale + * + * The NFT Sale activity details + */ +class IMMUTABLEZKEVMAPI_API APINFTSale : public Model +{ +public: + virtual ~APINFTSale() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The id of order */ + FString OrderId; + /* The account address of buyer */ + FString To; + /* The account address of seller */ + FString From; + TArray Asset; + APISalePayment Payment; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTWithBalance.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTWithBalance.h new file mode 100644 index 0000000..a3cf968 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTWithBalance.h @@ -0,0 +1,67 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APINFTContractType.h" +#include "APINFTMetadataAttribute.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTWithBalance + * + * + */ +class IMMUTABLEZKEVMAPI_API APINFTWithBalance : public Model +{ +public: + virtual ~APINFTWithBalance() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* An `uint256` token id as string */ + FString TokenId; + /* The contract address of the NFT */ + FString ContractAddress; + APINFTContractType ContractType; + /* When the NFT was first indexed */ + FDateTime IndexedAt; + /* When the NFT owner was last updated */ + FDateTime UpdatedAt; + /* When NFT metadata was last synced */ + TOptional MetadataSyncedAt; + /* The id of the metadata of this NFT */ + TOptional MetadataId; + /* The name of the NFT */ + TOptional Name; + /* The description of the NFT */ + TOptional Description; + /* The image url of the NFT */ + TOptional Image; + /* The external website link of NFT */ + TOptional ExternalLink; + /* The animation url of the NFT */ + TOptional AnimationUrl; + /* The youtube URL of NFT */ + TOptional YoutubeUrl; + /* List of Metadata attributes */ + TArray Attributes; + /* The amount of this NFT this account owns */ + FString Balance; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTWithOwner.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTWithOwner.h new file mode 100644 index 0000000..ede42b2 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTWithOwner.h @@ -0,0 +1,46 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTWithOwner + * + * + */ +class IMMUTABLEZKEVMAPI_API APINFTWithOwner : public Model +{ +public: + virtual ~APINFTWithOwner() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* The address of NFT contract */ + FString ContractAddress; + /* An `uint256` token id as string */ + FString TokenId; + /* The account address of the owner of the NFT */ + FString AccountAddress; + /* The amount of owned tokens (uint256 as string) */ + FString Balance; + /* When the owner last changed for the given NFT */ + FDateTime UpdatedAt; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTWithStack.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTWithStack.h new file mode 100644 index 0000000..e6cabae --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINFTWithStack.h @@ -0,0 +1,65 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIMarketplaceContractType.h" +#include "APINFTMetadataAttribute.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINFTWithStack + * + * Stack + */ +class IMMUTABLEZKEVMAPI_API APINFTWithStack : public Model +{ +public: + virtual ~APINFTWithStack() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Token id of NFT (uint256 as string) */ + FString TokenId; + /* Stack ID */ + FGuid StackId; + APIChain Chain; + /* Contract address */ + FString ContractAddress; + APIMarketplaceContractType ContractType; + /* When the metadata was created */ + FDateTime CreatedAt; + /* When the metadata was last updated */ + FDateTime UpdatedAt; + /* The name of the NFT */ + TOptional Name; + /* The description of the NFT */ + TOptional Description; + /* The image url of the NFT */ + TOptional Image; + /* The external website link of NFT */ + TOptional ExternalUrl; + /* The animation url of the NFT */ + TOptional AnimationUrl; + /* The youtube URL of NFT */ + TOptional YoutubeUrl; + /* List of Metadata attributes */ + TOptional> Attributes; + /* Balance of NFT */ + TOptional Balance; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINativeItem.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINativeItem.h new file mode 100644 index 0000000..8f7549a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINativeItem.h @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APINativeItem + * + * + */ +class IMMUTABLEZKEVMAPI_API APINativeItem : public Model +{ +public: + virtual ~APINativeItem() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class TypeEnum + { + Native, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Token type user is offering, which in this case is the native IMX token */ + TypeEnum Type; + /* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum). */ + FString Amount; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINftOwnersApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINftOwnersApi.h new file mode 100644 index 0000000..ef194e2 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINftOwnersApi.h @@ -0,0 +1,71 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APINftOwnersApi +{ +public: + APINftOwnersApi(); + ~APINftOwnersApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class ListAllNFTOwnersRequest; + class ListAllNFTOwnersResponse; + class ListNFTOwnersRequest; + class ListNFTOwnersResponse; + class ListOwnersByContractAddressRequest; + class ListOwnersByContractAddressResponse; + + DECLARE_DELEGATE_OneParam(FListAllNFTOwnersDelegate, const ListAllNFTOwnersResponse&); + DECLARE_DELEGATE_OneParam(FListNFTOwnersDelegate, const ListNFTOwnersResponse&); + DECLARE_DELEGATE_OneParam(FListOwnersByContractAddressDelegate, const ListOwnersByContractAddressResponse&); + + FHttpRequestPtr ListAllNFTOwners(const ListAllNFTOwnersRequest& Request, const FListAllNFTOwnersDelegate& Delegate = FListAllNFTOwnersDelegate()) const; + FHttpRequestPtr ListNFTOwners(const ListNFTOwnersRequest& Request, const FListNFTOwnersDelegate& Delegate = FListNFTOwnersDelegate()) const; + FHttpRequestPtr ListOwnersByContractAddress(const ListOwnersByContractAddressRequest& Request, const FListOwnersByContractAddressDelegate& Delegate = FListOwnersByContractAddressDelegate()) const; + +private: + void OnListAllNFTOwnersResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListAllNFTOwnersDelegate Delegate) const; + void OnListNFTOwnersResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListNFTOwnersDelegate Delegate) const; + void OnListOwnersByContractAddressResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListOwnersByContractAddressDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINftOwnersApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINftOwnersApiOperations.h new file mode 100644 index 0000000..d63cdfe --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINftOwnersApiOperations.h @@ -0,0 +1,126 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINftOwnersApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError404.h" +#include "APIAPIError500.h" +#include "APIListCollectionOwnersResult.h" +#include "APIListNFTOwnersResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* List all NFT owners + * + * List all NFT owners on a chain +*/ +class IMMUTABLEZKEVMAPI_API APINftOwnersApi::ListAllNFTOwnersRequest : public Request +{ +public: + virtual ~ListAllNFTOwnersRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* Datetime to use as the oldest updated timestamp */ + TOptional FromUpdatedAt; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APINftOwnersApi::ListAllNFTOwnersResponse : public Response +{ +public: + virtual ~ListAllNFTOwnersResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListNFTOwnersResult Content; +}; + +/* List NFT owners by token ID + * + * List NFT owners by token ID +*/ +class IMMUTABLEZKEVMAPI_API APINftOwnersApi::ListNFTOwnersRequest : public Request +{ +public: + virtual ~ListNFTOwnersRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address of contract */ + FString ContractAddress; + /* An `uint256` token id as string */ + FString TokenId; + /* The name of chain */ + FString ChainName; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APINftOwnersApi::ListNFTOwnersResponse : public Response +{ +public: + virtual ~ListNFTOwnersResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListNFTOwnersResult Content; +}; + +/* List owners by contract address + * + * List owners by contract address +*/ +class IMMUTABLEZKEVMAPI_API APINftOwnersApi::ListOwnersByContractAddressRequest : public Request +{ +public: + virtual ~ListOwnersByContractAddressRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address of contract */ + FString ContractAddress; + /* The name of chain */ + FString ChainName; + /* List of account addresses to filter by */ + TOptional> AccountAddress; + /* Datetime to use as the oldest updated timestamp */ + TOptional FromUpdatedAt; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APINftOwnersApi::ListOwnersByContractAddressResponse : public Response +{ +public: + virtual ~ListOwnersByContractAddressResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListCollectionOwnersResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINftsApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINftsApi.h new file mode 100644 index 0000000..b029ebe --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINftsApi.h @@ -0,0 +1,91 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APINftsApi +{ +public: + APINftsApi(); + ~APINftsApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class CreateMintRequestRequest; + class CreateMintRequestResponse; + class GetMintRequestRequest; + class GetMintRequestResponse; + class GetNFTRequest; + class GetNFTResponse; + class ListAllNFTsRequest; + class ListAllNFTsResponse; + class ListMintRequestsRequest; + class ListMintRequestsResponse; + class ListNFTsRequest; + class ListNFTsResponse; + class ListNFTsByAccountAddressRequest; + class ListNFTsByAccountAddressResponse; + + DECLARE_DELEGATE_OneParam(FCreateMintRequestDelegate, const CreateMintRequestResponse&); + DECLARE_DELEGATE_OneParam(FGetMintRequestDelegate, const GetMintRequestResponse&); + DECLARE_DELEGATE_OneParam(FGetNFTDelegate, const GetNFTResponse&); + DECLARE_DELEGATE_OneParam(FListAllNFTsDelegate, const ListAllNFTsResponse&); + DECLARE_DELEGATE_OneParam(FListMintRequestsDelegate, const ListMintRequestsResponse&); + DECLARE_DELEGATE_OneParam(FListNFTsDelegate, const ListNFTsResponse&); + DECLARE_DELEGATE_OneParam(FListNFTsByAccountAddressDelegate, const ListNFTsByAccountAddressResponse&); + + FHttpRequestPtr CreateMintRequest(const CreateMintRequestRequest& Request, const FCreateMintRequestDelegate& Delegate = FCreateMintRequestDelegate()) const; + FHttpRequestPtr GetMintRequest(const GetMintRequestRequest& Request, const FGetMintRequestDelegate& Delegate = FGetMintRequestDelegate()) const; + FHttpRequestPtr GetNFT(const GetNFTRequest& Request, const FGetNFTDelegate& Delegate = FGetNFTDelegate()) const; + FHttpRequestPtr ListAllNFTs(const ListAllNFTsRequest& Request, const FListAllNFTsDelegate& Delegate = FListAllNFTsDelegate()) const; + FHttpRequestPtr ListMintRequests(const ListMintRequestsRequest& Request, const FListMintRequestsDelegate& Delegate = FListMintRequestsDelegate()) const; + FHttpRequestPtr ListNFTs(const ListNFTsRequest& Request, const FListNFTsDelegate& Delegate = FListNFTsDelegate()) const; + FHttpRequestPtr ListNFTsByAccountAddress(const ListNFTsByAccountAddressRequest& Request, const FListNFTsByAccountAddressDelegate& Delegate = FListNFTsByAccountAddressDelegate()) const; + +private: + void OnCreateMintRequestResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateMintRequestDelegate Delegate) const; + void OnGetMintRequestResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetMintRequestDelegate Delegate) const; + void OnGetNFTResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetNFTDelegate Delegate) const; + void OnListAllNFTsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListAllNFTsDelegate Delegate) const; + void OnListMintRequestsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListMintRequestsDelegate Delegate) const; + void OnListNFTsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListNFTsDelegate Delegate) const; + void OnListNFTsByAccountAddressResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListNFTsByAccountAddressDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APINftsApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APINftsApiOperations.h new file mode 100644 index 0000000..4a9a2de --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APINftsApiOperations.h @@ -0,0 +1,259 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINftsApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError401.h" +#include "APIAPIError403.h" +#include "APIAPIError404.h" +#include "APIAPIError409.h" +#include "APIAPIError429.h" +#include "APIAPIError500.h" +#include "APICreateMintRequestRequest.h" +#include "APICreateMintRequestResult.h" +#include "APIGetNFTResult.h" +#include "APIListMintRequestsResult.h" +#include "APIListNFTsByOwnerResult.h" +#include "APIListNFTsResult.h" +#include "APIMintRequestStatus.h" + +namespace ImmutablezkEVMAPI +{ + +/* Mint NFTs + * + * Create a mint request to mint a set of NFTs for a given collection +*/ +class IMMUTABLEZKEVMAPI_API APINftsApi::CreateMintRequestRequest : public Request +{ +public: + virtual ~CreateMintRequestRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address of contract */ + FString ContractAddress; + /* The name of chain */ + FString ChainName; + /* Create Mint Request Body */ + APICreateMintRequestRequest APICreateMintRequestRequest; +}; + +class IMMUTABLEZKEVMAPI_API APINftsApi::CreateMintRequestResponse : public Response +{ +public: + virtual ~CreateMintRequestResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APICreateMintRequestResult Content; +}; + +/* Get mint request by reference ID + * + * Retrieve the status of a mint request identified by its reference_id +*/ +class IMMUTABLEZKEVMAPI_API APINftsApi::GetMintRequestRequest : public Request +{ +public: + virtual ~GetMintRequestRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address of contract */ + FString ContractAddress; + /* The name of chain */ + FString ChainName; + /* The id of the mint request */ + FString ReferenceId; +}; + +class IMMUTABLEZKEVMAPI_API APINftsApi::GetMintRequestResponse : public Response +{ +public: + virtual ~GetMintRequestResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListMintRequestsResult Content; +}; + +/* Get NFT by token ID + * + * Get NFT by token ID +*/ +class IMMUTABLEZKEVMAPI_API APINftsApi::GetNFTRequest : public Request +{ +public: + virtual ~GetNFTRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address of NFT contract */ + FString ContractAddress; + /* An `uint256` token id as string */ + FString TokenId; + /* The name of chain */ + FString ChainName; +}; + +class IMMUTABLEZKEVMAPI_API APINftsApi::GetNFTResponse : public Response +{ +public: + virtual ~GetNFTResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIGetNFTResult Content; +}; + +/* List all NFTs + * + * List all NFTs on a chain +*/ +class IMMUTABLEZKEVMAPI_API APINftsApi::ListAllNFTsRequest : public Request +{ +public: + virtual ~ListAllNFTsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* Datetime to use as the oldest updated timestamp */ + TOptional FromUpdatedAt; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APINftsApi::ListAllNFTsResponse : public Response +{ +public: + virtual ~ListAllNFTsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListNFTsResult Content; +}; + +/* List mint requests + * + * Retrieve the status of all mints for a given contract address +*/ +class IMMUTABLEZKEVMAPI_API APINftsApi::ListMintRequestsRequest : public Request +{ +public: + virtual ~ListMintRequestsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address of contract */ + FString ContractAddress; + /* The name of chain */ + FString ChainName; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; + /* The status of the mint request */ + TOptional Status; +}; + +class IMMUTABLEZKEVMAPI_API APINftsApi::ListMintRequestsResponse : public Response +{ +public: + virtual ~ListMintRequestsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListMintRequestsResult Content; +}; + +/* List NFTs by contract address + * + * List NFTs by contract address +*/ +class IMMUTABLEZKEVMAPI_API APINftsApi::ListNFTsRequest : public Request +{ +public: + virtual ~ListNFTsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Contract address */ + FString ContractAddress; + /* The name of chain */ + FString ChainName; + /* List of token IDs to filter by */ + TOptional> TokenId; + /* Datetime to use as the oldest updated timestamp */ + TOptional FromUpdatedAt; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APINftsApi::ListNFTsResponse : public Response +{ +public: + virtual ~ListNFTsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListNFTsResult Content; +}; + +/* List NFTs by account address + * + * List NFTs by account address +*/ +class IMMUTABLEZKEVMAPI_API APINftsApi::ListNFTsByAccountAddressRequest : public Request +{ +public: + virtual ~ListNFTsByAccountAddressRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Account address */ + FString AccountAddress; + /* The name of chain */ + FString ChainName; + /* The address of contract */ + TOptional ContractAddress; + /* List of token IDs to filter by */ + TOptional> TokenId; + /* Datetime to use as the oldest updated timestamp */ + TOptional FromUpdatedAt; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APINftsApi::ListNFTsByAccountAddressResponse : public Response +{ +public: + virtual ~ListNFTsByAccountAddressResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListNFTsByOwnerResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistContractStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistContractStatus.h new file mode 100644 index 0000000..a8f7746 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistContractStatus.h @@ -0,0 +1,46 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIOperatorAllowlistStatus.h" +#include "APIOperatorAllowlistStatusDetails.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOperatorAllowlistContractStatus + * + * + */ +class IMMUTABLEZKEVMAPI_API APIOperatorAllowlistContractStatus : public Model +{ +public: + virtual ~APIOperatorAllowlistContractStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* The address of the contract */ + FString ContractAddress; + APIOperatorAllowlistStatus Status; + APIOperatorAllowlistStatusDetails Details; + /* When the contract status was created */ + FDateTime CreatedAt; + /* Who created the status */ + FString CreatedBy; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistContractStatusInternal.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistContractStatusInternal.h new file mode 100644 index 0000000..4a48ab7 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistContractStatusInternal.h @@ -0,0 +1,50 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIOperatorAllowlistStatus.h" +#include "APIOperatorAllowlistStatusDetails.h" +#include "APIOrganisationTier.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOperatorAllowlistContractStatusInternal + * + * + */ +class IMMUTABLEZKEVMAPI_API APIOperatorAllowlistContractStatusInternal : public Model +{ +public: + virtual ~APIOperatorAllowlistContractStatusInternal() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* The address of the contract */ + FString ContractAddress; + APIOperatorAllowlistStatus Status; + APIOperatorAllowlistStatusDetails Details; + /* When the contract status was created */ + FDateTime CreatedAt; + /* Who created the status */ + FString CreatedBy; + /* The name of the organisation associated with this contract */ + TOptional OrgName; + TOptional OrgTier; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatus.h new file mode 100644 index 0000000..bd00c8c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatus.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOperatorAllowlistStatus + * + * The status of a contract on the operator allowlist + */ +class IMMUTABLEZKEVMAPI_API APIOperatorAllowlistStatus : public Model +{ +public: + virtual ~APIOperatorAllowlistStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + Requested, + Approved, + Rejected, + Removed, + Added, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatusDetails.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatusDetails.h new file mode 100644 index 0000000..1b61e09 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatusDetails.h @@ -0,0 +1,42 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOperatorAllowlistStatusRequested.h" +#include "APIOperatorAllowlistStatusUpdated.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOperatorAllowlistStatusDetails + * + * The operator allowlist status details + */ +class IMMUTABLEZKEVMAPI_API APIOperatorAllowlistStatusDetails : public Model +{ +public: + virtual ~APIOperatorAllowlistStatusDetails() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Reason this contract needs to be added */ + FString Purpose; + /* Attestation of whether this contract is a settlement contract */ + bool IsSettlementContract = false; + /* Why this action was performed */ + FString Reason; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatusRequested.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatusRequested.h new file mode 100644 index 0000000..c808ed5 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatusRequested.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOperatorAllowlistStatusRequested + * + * The request details + */ +class IMMUTABLEZKEVMAPI_API APIOperatorAllowlistStatusRequested : public Model +{ +public: + virtual ~APIOperatorAllowlistStatusRequested() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Reason this contract needs to be added */ + FString Purpose; + /* Attestation of whether this contract is a settlement contract */ + bool IsSettlementContract = false; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatusUpdated.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatusUpdated.h new file mode 100644 index 0000000..38564e7 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOperatorAllowlistStatusUpdated.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOperatorAllowlistStatusUpdated + * + * The update details + */ +class IMMUTABLEZKEVMAPI_API APIOperatorAllowlistStatusUpdated : public Model +{ +public: + virtual ~APIOperatorAllowlistStatusUpdated() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Why this action was performed */ + FString Reason; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrder.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrder.h new file mode 100644 index 0000000..4336e52 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrder.h @@ -0,0 +1,74 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIFee.h" +#include "APIFillStatus.h" +#include "APIItem.h" +#include "APIOrderStatus.h" +#include "APIProtocolData.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOrder + * + * + */ +class IMMUTABLEZKEVMAPI_API APIOrder : public Model +{ +public: + virtual ~APIOrder() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString AccountAddress; + TArray Buy; + TArray Fees; + APIChain Chain; + /* Time the Order is created */ + FDateTime CreatedAt; + /* Time after which the Order is considered expired */ + FDateTime EndAt; + /* Global Order identifier */ + FString Id; + FString OrderHash; + APIProtocolData ProtocolData; + /* A random value added to the create Order request */ + FString Salt; + TArray Sell; + /* Digital signature generated by the user for the specific Order */ + FString Signature; + /* Time after which Order is considered active */ + FDateTime StartAt; + APIOrderStatus Status; + enum class TypeEnum + { + Listing, + Bid, + CollectionBid, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Order type */ + TypeEnum Type; + /* Time the Order is last updated */ + FDateTime UpdatedAt; + APIFillStatus FillStatus; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrderStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrderStatus.h new file mode 100644 index 0000000..3629c2f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrderStatus.h @@ -0,0 +1,70 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActiveOrderStatus.h" +#include "APICancelledOrderStatus.h" +#include "APIExpiredOrderStatus.h" +#include "APIFilledOrderStatus.h" +#include "APIInactiveOrderStatus.h" +#include "APIPendingOrderStatus.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOrderStatus + * + * The Order status + */ +class IMMUTABLEZKEVMAPI_API APIOrderStatus : public Model +{ +public: + virtual ~APIOrderStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Expired, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* A terminal order status indicating that an order cannot be fulfilled due to expiry. */ + NameEnum Name; + /* Whether the cancellation of the order is pending */ + bool Pending = false; + enum class CancellationTypeEnum + { + OnChain, + OffChain, + Underfunded, + }; + + static FString EnumToString(const CancellationTypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, CancellationTypeEnum& EnumValue); + /* Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account */ + CancellationTypeEnum CancellationType; + /* Whether the order has been evaluated after its creation */ + bool Evaluated = false; + /* Whether the order has reached its specified start time */ + bool Started = false; + /* Whether the order offerer has sufficient approvals */ + bool SufficientApprovals = false; + /* Whether the order offerer still has sufficient balance to complete the order */ + bool SufficientBalances = false; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrderStatusName.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrderStatusName.h new file mode 100644 index 0000000..51d6c07 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrderStatusName.h @@ -0,0 +1,48 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOrderStatusName + * + * The Order status + */ +class IMMUTABLEZKEVMAPI_API APIOrderStatusName : public Model +{ +public: + virtual ~APIOrderStatusName() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + Pending, + Active, + Inactive, + Filled, + Expired, + Cancelled, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrdersApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrdersApi.h new file mode 100644 index 0000000..5f41d86 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrdersApi.h @@ -0,0 +1,121 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APIOrdersApi +{ +public: + APIOrdersApi(); + ~APIOrdersApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class CancelOrdersRequest; + class CancelOrdersResponse; + class CreateBidRequest; + class CreateBidResponse; + class CreateCollectionBidRequest; + class CreateCollectionBidResponse; + class CreateListingRequest; + class CreateListingResponse; + class FulfillmentDataRequest; + class FulfillmentDataResponse; + class GetBidRequest; + class GetBidResponse; + class GetCollectionBidRequest; + class GetCollectionBidResponse; + class GetListingRequest; + class GetListingResponse; + class GetTradeRequest; + class GetTradeResponse; + class ListBidsRequest; + class ListBidsResponse; + class ListCollectionBidsRequest; + class ListCollectionBidsResponse; + class ListListingsRequest; + class ListListingsResponse; + class ListTradesRequest; + class ListTradesResponse; + + DECLARE_DELEGATE_OneParam(FCancelOrdersDelegate, const CancelOrdersResponse&); + DECLARE_DELEGATE_OneParam(FCreateBidDelegate, const CreateBidResponse&); + DECLARE_DELEGATE_OneParam(FCreateCollectionBidDelegate, const CreateCollectionBidResponse&); + DECLARE_DELEGATE_OneParam(FCreateListingDelegate, const CreateListingResponse&); + DECLARE_DELEGATE_OneParam(FFulfillmentDataDelegate, const FulfillmentDataResponse&); + DECLARE_DELEGATE_OneParam(FGetBidDelegate, const GetBidResponse&); + DECLARE_DELEGATE_OneParam(FGetCollectionBidDelegate, const GetCollectionBidResponse&); + DECLARE_DELEGATE_OneParam(FGetListingDelegate, const GetListingResponse&); + DECLARE_DELEGATE_OneParam(FGetTradeDelegate, const GetTradeResponse&); + DECLARE_DELEGATE_OneParam(FListBidsDelegate, const ListBidsResponse&); + DECLARE_DELEGATE_OneParam(FListCollectionBidsDelegate, const ListCollectionBidsResponse&); + DECLARE_DELEGATE_OneParam(FListListingsDelegate, const ListListingsResponse&); + DECLARE_DELEGATE_OneParam(FListTradesDelegate, const ListTradesResponse&); + + FHttpRequestPtr CancelOrders(const CancelOrdersRequest& Request, const FCancelOrdersDelegate& Delegate = FCancelOrdersDelegate()) const; + FHttpRequestPtr CreateBid(const CreateBidRequest& Request, const FCreateBidDelegate& Delegate = FCreateBidDelegate()) const; + FHttpRequestPtr CreateCollectionBid(const CreateCollectionBidRequest& Request, const FCreateCollectionBidDelegate& Delegate = FCreateCollectionBidDelegate()) const; + FHttpRequestPtr CreateListing(const CreateListingRequest& Request, const FCreateListingDelegate& Delegate = FCreateListingDelegate()) const; + FHttpRequestPtr FulfillmentData(const FulfillmentDataRequest& Request, const FFulfillmentDataDelegate& Delegate = FFulfillmentDataDelegate()) const; + FHttpRequestPtr GetBid(const GetBidRequest& Request, const FGetBidDelegate& Delegate = FGetBidDelegate()) const; + FHttpRequestPtr GetCollectionBid(const GetCollectionBidRequest& Request, const FGetCollectionBidDelegate& Delegate = FGetCollectionBidDelegate()) const; + FHttpRequestPtr GetListing(const GetListingRequest& Request, const FGetListingDelegate& Delegate = FGetListingDelegate()) const; + FHttpRequestPtr GetTrade(const GetTradeRequest& Request, const FGetTradeDelegate& Delegate = FGetTradeDelegate()) const; + FHttpRequestPtr ListBids(const ListBidsRequest& Request, const FListBidsDelegate& Delegate = FListBidsDelegate()) const; + FHttpRequestPtr ListCollectionBids(const ListCollectionBidsRequest& Request, const FListCollectionBidsDelegate& Delegate = FListCollectionBidsDelegate()) const; + FHttpRequestPtr ListListings(const ListListingsRequest& Request, const FListListingsDelegate& Delegate = FListListingsDelegate()) const; + FHttpRequestPtr ListTrades(const ListTradesRequest& Request, const FListTradesDelegate& Delegate = FListTradesDelegate()) const; + +private: + void OnCancelOrdersResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCancelOrdersDelegate Delegate) const; + void OnCreateBidResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateBidDelegate Delegate) const; + void OnCreateCollectionBidResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateCollectionBidDelegate Delegate) const; + void OnCreateListingResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateListingDelegate Delegate) const; + void OnFulfillmentDataResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFulfillmentDataDelegate Delegate) const; + void OnGetBidResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetBidDelegate Delegate) const; + void OnGetCollectionBidResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetCollectionBidDelegate Delegate) const; + void OnGetListingResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetListingDelegate Delegate) const; + void OnGetTradeResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetTradeDelegate Delegate) const; + void OnListBidsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListBidsDelegate Delegate) const; + void OnListCollectionBidsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListCollectionBidsDelegate Delegate) const; + void OnListListingsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListListingsDelegate Delegate) const; + void OnListTradesResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListTradesDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrdersApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrdersApiOperations.h new file mode 100644 index 0000000..b7db730 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrdersApiOperations.h @@ -0,0 +1,519 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIOrdersApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError401.h" +#include "APIAPIError404.h" +#include "APIAPIError429.h" +#include "APIAPIError500.h" +#include "APIAPIError501.h" +#include "APIBidResult.h" +#include "APICancelOrdersRequestBody.h" +#include "APICancelOrdersResult.h" +#include "APICollectionBidResult.h" +#include "APICreateBidRequestBody.h" +#include "APICreateCollectionBidRequestBody.h" +#include "APICreateListingRequestBody.h" +#include "APIFulfillmentData200Response.h" +#include "APIFulfillmentDataRequest.h" +#include "APIListBidsResult.h" +#include "APIListCollectionBidsResult.h" +#include "APIListListingsResult.h" +#include "APIListTradeResult.h" +#include "APIListingResult.h" +#include "APIOrderStatusName.h" +#include "APITradeResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* Cancel one or more orders + * + * Cancel one or more orders +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::CancelOrdersRequest : public Request +{ +public: + virtual ~CancelOrdersRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + APICancelOrdersRequestBody APICancelOrdersRequestBody; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::CancelOrdersResponse : public Response +{ +public: + virtual ~CancelOrdersResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APICancelOrdersResult Content; +}; + +/* Create a bid + * + * Create a bid +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::CreateBidRequest : public Request +{ +public: + virtual ~CreateBidRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + APICreateBidRequestBody APICreateBidRequestBody; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::CreateBidResponse : public Response +{ +public: + virtual ~CreateBidResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIBidResult Content; +}; + +/* Create a collection bid + * + * Create a collection bid +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::CreateCollectionBidRequest : public Request +{ +public: + virtual ~CreateCollectionBidRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + APICreateCollectionBidRequestBody APICreateCollectionBidRequestBody; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::CreateCollectionBidResponse : public Response +{ +public: + virtual ~CreateCollectionBidResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APICollectionBidResult Content; +}; + +/* Create a listing + * + * Create a listing +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::CreateListingRequest : public Request +{ +public: + virtual ~CreateListingRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + APICreateListingRequestBody APICreateListingRequestBody; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::CreateListingResponse : public Response +{ +public: + virtual ~CreateListingResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListingResult Content; +}; + +/* Retrieve fulfillment data for orders + * + * Retrieve signed fulfillment data based on the list of order IDs and corresponding fees. +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::FulfillmentDataRequest : public Request +{ +public: + virtual ~FulfillmentDataRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + TArray APIFulfillmentDataRequest; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::FulfillmentDataResponse : public Response +{ +public: + virtual ~FulfillmentDataResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIFulfillmentData200Response Content; +}; + +/* Get a single bid by ID + * + * Get a single bid by ID +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::GetBidRequest : public Request +{ +public: + virtual ~GetBidRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + /* Global Bid identifier */ + FGuid BidId; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::GetBidResponse : public Response +{ +public: + virtual ~GetBidResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIBidResult Content; +}; + +/* Get a single collection bid by ID + * + * Get a single collection bid by ID +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::GetCollectionBidRequest : public Request +{ +public: + virtual ~GetCollectionBidRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + /* Global Collection Bid identifier */ + FGuid CollectionBidId; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::GetCollectionBidResponse : public Response +{ +public: + virtual ~GetCollectionBidResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APICollectionBidResult Content; +}; + +/* Get a single listing by ID + * + * Get a single listing by ID +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::GetListingRequest : public Request +{ +public: + virtual ~GetListingRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + /* Global Order identifier */ + FGuid ListingId; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::GetListingResponse : public Response +{ +public: + virtual ~GetListingResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListingResult Content; +}; + +/* Get a single trade by ID + * + * Get a single trade by ID +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::GetTradeRequest : public Request +{ +public: + virtual ~GetTradeRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + /* Global Trade identifier */ + FGuid TradeId; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::GetTradeResponse : public Response +{ +public: + virtual ~GetTradeResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APITradeResult Content; +}; + +/* List all bids + * + * List all bids +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::ListBidsRequest : public Request +{ +public: + virtual ~ListBidsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + /* Order status to filter by */ + TOptional Status; + /* Buy item contract address to filter by */ + TOptional BuyItemContractAddress; + /* Sell item contract address to filter by */ + TOptional SellItemContractAddress; + /* The account address of the user who created the bid */ + TOptional AccountAddress; + /* The metadata_id of the buy item */ + TOptional BuyItemMetadataId; + /* buy item token identifier to filter by */ + TOptional BuyItemTokenId; + /* From updated at including given date */ + TOptional FromUpdatedAt; + /* Maximum number of orders to return per page */ + TOptional PageSize; + enum class SortByEnum + { + CreatedAt, + UpdatedAt, + SellItemAmount, + }; + + static FString EnumToString(const SortByEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, SortByEnum& EnumValue); + /* Order field to sort by. `sell_item_amount` sorts by per token price, for example if 10eth is offered for 5 ERC1155 items, it’s sorted as 2eth for `sell_item_amount`. */ + TOptional SortBy; + enum class SortDirectionEnum + { + Asc, + Desc, + }; + + static FString EnumToString(const SortDirectionEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, SortDirectionEnum& EnumValue); + /* Ascending or descending direction for sort */ + TOptional SortDirection; + /* Page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::ListBidsResponse : public Response +{ +public: + virtual ~ListBidsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListBidsResult Content; +}; + +/* List all collection bids + * + * List all collection bids +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::ListCollectionBidsRequest : public Request +{ +public: + virtual ~ListCollectionBidsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + /* Order status to filter by */ + TOptional Status; + /* Buy item contract address to filter by */ + TOptional BuyItemContractAddress; + /* Sell item contract address to filter by */ + TOptional SellItemContractAddress; + /* The account address of the user who created the bid */ + TOptional AccountAddress; + /* From updated at including given date */ + TOptional FromUpdatedAt; + /* Maximum number of orders to return per page */ + TOptional PageSize; + enum class SortByEnum + { + CreatedAt, + UpdatedAt, + SellItemAmount, + }; + + static FString EnumToString(const SortByEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, SortByEnum& EnumValue); + /* Order field to sort by. `sell_item_amount` sorts by per token price, for example if 10eth is offered for 5 ERC1155 items, it’s sorted as 2eth for `sell_item_amount`. */ + TOptional SortBy; + enum class SortDirectionEnum + { + Asc, + Desc, + }; + + static FString EnumToString(const SortDirectionEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, SortDirectionEnum& EnumValue); + /* Ascending or descending direction for sort */ + TOptional SortDirection; + /* Page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::ListCollectionBidsResponse : public Response +{ +public: + virtual ~ListCollectionBidsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListCollectionBidsResult Content; +}; + +/* List all listings + * + * List all listings +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::ListListingsRequest : public Request +{ +public: + virtual ~ListListingsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + /* Order status to filter by */ + TOptional Status; + /* Sell item contract address to filter by */ + TOptional SellItemContractAddress; + enum class BuyItemTypeEnum + { + Native, + ERC20, + }; + + static FString EnumToString(const BuyItemTypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, BuyItemTypeEnum& EnumValue); + /* Buy item type to filter by */ + TOptional BuyItemType; + /* Buy item contract address to filter by */ + TOptional BuyItemContractAddress; + /* The account address of the user who created the listing */ + TOptional AccountAddress; + /* The metadata_id of the sell item */ + TOptional SellItemMetadataId; + /* Sell item token identifier to filter by */ + TOptional SellItemTokenId; + /* From updated at including given date */ + TOptional FromUpdatedAt; + /* Maximum number of orders to return per page */ + TOptional PageSize; + enum class SortByEnum + { + CreatedAt, + UpdatedAt, + BuyItemAmount, + }; + + static FString EnumToString(const SortByEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, SortByEnum& EnumValue); + /* Order field to sort by. `buy_item_amount` sorts by per token price, for example if 5 ERC-1155s are on sale for 10eth, it’s sorted as 2eth for `buy_item_amount`. */ + TOptional SortBy; + enum class SortDirectionEnum + { + Asc, + Desc, + }; + + static FString EnumToString(const SortDirectionEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, SortDirectionEnum& EnumValue); + /* Ascending or descending direction for sort */ + TOptional SortDirection; + /* Page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::ListListingsResponse : public Response +{ +public: + virtual ~ListListingsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListListingsResult Content; +}; + +/* List all trades + * + * List all trades +*/ +class IMMUTABLEZKEVMAPI_API APIOrdersApi::ListTradesRequest : public Request +{ +public: + virtual ~ListTradesRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + FString ChainName; + TOptional AccountAddress; + TOptional SellItemContractAddress; + /* From indexed at including given date */ + TOptional FromIndexedAt; + /* Maximum number of trades to return per page */ + TOptional PageSize; + enum class SortByEnum + { + IndexedAt, + }; + + static FString EnumToString(const SortByEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, SortByEnum& EnumValue); + /* Trade field to sort by */ + TOptional SortBy; + enum class SortDirectionEnum + { + Asc, + Desc, + }; + + static FString EnumToString(const SortDirectionEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, SortDirectionEnum& EnumValue); + /* Ascending or descending direction for sort */ + TOptional SortDirection; + /* Page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; +}; + +class IMMUTABLEZKEVMAPI_API APIOrdersApi::ListTradesResponse : public Response +{ +public: + virtual ~ListTradesResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListTradeResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrganisationTier.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrganisationTier.h new file mode 100644 index 0000000..22a56db --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIOrganisationTier.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIOrganisationTier + * + * The tier of the organisation + */ +class IMMUTABLEZKEVMAPI_API APIOrganisationTier : public Model +{ +public: + virtual ~APIOrganisationTier() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + Common, + Uncommon, + Rare, + Epic, + Legendary, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIPage.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPage.h new file mode 100644 index 0000000..3b9acfb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPage.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIPage + * + * Pagination properties + */ +class IMMUTABLEZKEVMAPI_API APIPage : public Model +{ +public: + virtual ~APIPage() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* First item as an encoded string */ + TOptional PreviousCursor; + /* Last item as an encoded string */ + TOptional NextCursor; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportApi.h new file mode 100644 index 0000000..ca5043f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportApi.h @@ -0,0 +1,61 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APIPassportApi +{ +public: + APIPassportApi(); + ~APIPassportApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class GetLinkedAddressesRequest; + class GetLinkedAddressesResponse; + + DECLARE_DELEGATE_OneParam(FGetLinkedAddressesDelegate, const GetLinkedAddressesResponse&); + + FHttpRequestPtr GetLinkedAddresses(const GetLinkedAddressesRequest& Request, const FGetLinkedAddressesDelegate& Delegate = FGetLinkedAddressesDelegate()) const; + +private: + void OnGetLinkedAddressesResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetLinkedAddressesDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportApiOperations.h new file mode 100644 index 0000000..73cd4c8 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportApiOperations.h @@ -0,0 +1,55 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIPassportApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError401.h" +#include "APIAPIError403.h" +#include "APIAPIError429.h" +#include "APIAPIError500.h" +#include "APIBasicAPIError.h" +#include "APIGetLinkedAddressesRes.h" + +namespace ImmutablezkEVMAPI +{ + +/* Get Ethereum linked addresses for a user + * + * This API has been deprecated, please use https://docs.immutable.com/zkevm/api/reference/#/operations/getUserInfo instead to get a list of linked addresses. +*/ +class IMMUTABLEZKEVMAPI_API APIPassportApi::GetLinkedAddressesRequest : public Request +{ +public: + virtual ~GetLinkedAddressesRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The user's userId */ + FString UserId; + FString ChainName; +}; + +class IMMUTABLEZKEVMAPI_API APIPassportApi::GetLinkedAddressesResponse : public Response +{ +public: + virtual ~GetLinkedAddressesResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIGetLinkedAddressesRes Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportProfileApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportProfileApi.h new file mode 100644 index 0000000..675dc5d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportProfileApi.h @@ -0,0 +1,66 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APIPassportProfileApi +{ +public: + APIPassportProfileApi(); + ~APIPassportProfileApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class GetUserInfoRequest; + class GetUserInfoResponse; + class LinkWalletV2Request; + class LinkWalletV2Response; + + DECLARE_DELEGATE_OneParam(FGetUserInfoDelegate, const GetUserInfoResponse&); + DECLARE_DELEGATE_OneParam(FLinkWalletV2Delegate, const LinkWalletV2Response&); + + FHttpRequestPtr GetUserInfo(const GetUserInfoRequest& Request, const FGetUserInfoDelegate& Delegate = FGetUserInfoDelegate()) const; + FHttpRequestPtr LinkWalletV2(const LinkWalletV2Request& Request, const FLinkWalletV2Delegate& Delegate = FLinkWalletV2Delegate()) const; + +private: + void OnGetUserInfoResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserInfoDelegate Delegate) const; + void OnLinkWalletV2Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLinkWalletV2Delegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportProfileApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportProfileApiOperations.h new file mode 100644 index 0000000..f337b16 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPassportProfileApiOperations.h @@ -0,0 +1,77 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIPassportProfileApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError401.h" +#include "APIAPIError403.h" +#include "APIAPIError500.h" +#include "APIBasicAPIError.h" +#include "APILinkWalletV2Request.h" +#include "APIUserInfo.h" +#include "APIWallet.h" + +namespace ImmutablezkEVMAPI +{ + +/* Get all info for a Passport user + * + * Get all the info for an authenticated Passport user +*/ +class IMMUTABLEZKEVMAPI_API APIPassportProfileApi::GetUserInfoRequest : public Request +{ +public: + virtual ~GetUserInfoRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + +}; + +class IMMUTABLEZKEVMAPI_API APIPassportProfileApi::GetUserInfoResponse : public Response +{ +public: + virtual ~GetUserInfoResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIUserInfo Content; +}; + +/* Link wallet v2 + * + * Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature. +*/ +class IMMUTABLEZKEVMAPI_API APIPassportProfileApi::LinkWalletV2Request : public Request +{ +public: + virtual ~LinkWalletV2Request() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + TOptional APILinkWalletV2Request; +}; + +class IMMUTABLEZKEVMAPI_API APIPassportProfileApi::LinkWalletV2Response : public Response +{ +public: + virtual ~LinkWalletV2Response() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIWallet Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIPendingOrderStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPendingOrderStatus.h new file mode 100644 index 0000000..56bf591 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPendingOrderStatus.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIPendingOrderStatus + * + * + */ +class IMMUTABLEZKEVMAPI_API APIPendingOrderStatus : public Model +{ +public: + virtual ~APIPendingOrderStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class NameEnum + { + Pending, + }; + + static FString EnumToString(const NameEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, NameEnum& EnumValue); + /* The order status that indicates the order is yet to be active due to various reasons. */ + NameEnum Name; + /* Whether the order has been evaluated after its creation */ + bool Evaluated = false; + /* Whether the order has reached its specified start time */ + bool Started = false; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIPricingApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPricingApi.h new file mode 100644 index 0000000..b53dc4c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPricingApi.h @@ -0,0 +1,66 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APIPricingApi +{ +public: + APIPricingApi(); + ~APIPricingApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class QuotesForNFTsRequest; + class QuotesForNFTsResponse; + class QuotesForStacksRequest; + class QuotesForStacksResponse; + + DECLARE_DELEGATE_OneParam(FQuotesForNFTsDelegate, const QuotesForNFTsResponse&); + DECLARE_DELEGATE_OneParam(FQuotesForStacksDelegate, const QuotesForStacksResponse&); + + FHttpRequestPtr QuotesForNFTs(const QuotesForNFTsRequest& Request, const FQuotesForNFTsDelegate& Delegate = FQuotesForNFTsDelegate()) const; + FHttpRequestPtr QuotesForStacks(const QuotesForStacksRequest& Request, const FQuotesForStacksDelegate& Delegate = FQuotesForStacksDelegate()) const; + +private: + void OnQuotesForNFTsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FQuotesForNFTsDelegate Delegate) const; + void OnQuotesForStacksResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FQuotesForStacksDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIPricingApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPricingApiOperations.h new file mode 100644 index 0000000..ae2dfb3 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIPricingApiOperations.h @@ -0,0 +1,92 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIPricingApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError401.h" +#include "APIAPIError403.h" +#include "APIAPIError404.h" +#include "APIAPIError429.h" +#include "APIAPIError500.h" +#include "APIQuotesForNFTsResult.h" +#include "APIQuotesForStacksResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* Experimental: Get pricing data for a list of token ids + * + * ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get pricing data for a list of token ids +*/ +class IMMUTABLEZKEVMAPI_API APIPricingApi::QuotesForNFTsRequest : public Request +{ +public: + virtual ~QuotesForNFTsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* Contract address for collection that these token ids are on */ + FString ContractAddress; + /* List of token ids to get pricing data for */ + TArray TokenId; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; +}; + +class IMMUTABLEZKEVMAPI_API APIPricingApi::QuotesForNFTsResponse : public Response +{ +public: + virtual ~QuotesForNFTsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIQuotesForNFTsResult Content; +}; + +/* Experimental: Get pricing data for a list of stack ids + * + * ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get pricing data for a list of stack ids +*/ +class IMMUTABLEZKEVMAPI_API APIPricingApi::QuotesForStacksRequest : public Request +{ +public: + virtual ~QuotesForStacksRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* Contract address for collection that these stacks are on */ + FString ContractAddress; + /* List of stack ids to get pricing data for */ + TArray StackId; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; +}; + +class IMMUTABLEZKEVMAPI_API APIPricingApi::QuotesForStacksResponse : public Response +{ +public: + virtual ~QuotesForStacksResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIQuotesForStacksResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIProtocolData.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIProtocolData.h new file mode 100644 index 0000000..5f8072c --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIProtocolData.h @@ -0,0 +1,52 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIProtocolData + * + * + */ +class IMMUTABLEZKEVMAPI_API APIProtocolData : public Model +{ +public: + virtual ~APIProtocolData() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class OrderTypeEnum + { + FullRestricted, + PartialRestricted, + }; + + static FString EnumToString(const OrderTypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, OrderTypeEnum& EnumValue); + /* Seaport order type. Orders containing ERC721 tokens will need to pass in the order type as FULL_RESTRICTED while orders with ERC1155 tokens will need to pass in the order_type as PARTIAL_RESTRICTED */ + OrderTypeEnum OrderType; + /* big.Int or uint256 string for order counter */ + FString Counter; + /* Immutable zone address */ + FString ZoneAddress; + /* Immutable Seaport contract address */ + FString SeaportAddress; + /* Immutable Seaport contract version */ + FString SeaportVersion; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIQuotesForNFTsResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIQuotesForNFTsResult.h new file mode 100644 index 0000000..6451bd1 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIQuotesForNFTsResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTQuoteResult.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIQuotesForNFTsResult + * + * Quotes for NFTs result + */ +class IMMUTABLEZKEVMAPI_API APIQuotesForNFTsResult : public Model +{ +public: + virtual ~APIQuotesForNFTsResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of quotes */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIQuotesForStacksResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIQuotesForStacksResult.h new file mode 100644 index 0000000..0a71440 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIQuotesForStacksResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIPage.h" +#include "APIStackQuoteResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIQuotesForStacksResult + * + * Quotes for stacks result + */ +class IMMUTABLEZKEVMAPI_API APIQuotesForStacksResult : public Model +{ +public: + virtual ~APIQuotesForStacksResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of quotes */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshCollectionMetadataRequest.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshCollectionMetadataRequest.h new file mode 100644 index 0000000..07a5d51 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshCollectionMetadataRequest.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICollectionMetadata.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIRefreshCollectionMetadataRequest + * + * + */ +class IMMUTABLEZKEVMAPI_API APIRefreshCollectionMetadataRequest : public Model +{ +public: + virtual ~APIRefreshCollectionMetadataRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APICollectionMetadata CollectionMetadata; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshCollectionMetadataResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshCollectionMetadataResult.h new file mode 100644 index 0000000..21c0eae --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshCollectionMetadataResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APICollectionMetadata.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIRefreshCollectionMetadataResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APIRefreshCollectionMetadataResult : public Model +{ +public: + virtual ~APIRefreshCollectionMetadataResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + FString ContractAddress; + APIChain Chain; + APICollectionMetadata CollectionMetadata; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshMetadataByID.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshMetadataByID.h new file mode 100644 index 0000000..5a70150 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshMetadataByID.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTMetadataAttribute.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIRefreshMetadataByID + * + * + */ +class IMMUTABLEZKEVMAPI_API APIRefreshMetadataByID : public Model +{ +public: + virtual ~APIRefreshMetadataByID() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The name of the NFT */ + TOptional Name; + /* The description of the NFT */ + TOptional Description; + /* The image url of the NFT */ + TOptional Image; + /* The external link of the NFT */ + TOptional ExternalUrl; + /* The animation url of the NFT */ + TOptional AnimationUrl; + /* The youtube link of the NFT */ + TOptional YoutubeUrl; + /* List of Metadata attributes */ + TOptional> Attributes; + /* Metadata id in UUIDv4 format */ + FGuid MetadataId; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshMetadataByIDRequest.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshMetadataByIDRequest.h new file mode 100644 index 0000000..71fe558 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshMetadataByIDRequest.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIRefreshMetadataByID.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIRefreshMetadataByIDRequest + * + * Request body for refreshing metadata by id. Total size of this list should not exceed 228 KiB + */ +class IMMUTABLEZKEVMAPI_API APIRefreshMetadataByIDRequest : public Model +{ +public: + virtual ~APIRefreshMetadataByIDRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + TArray Metadata; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshMetadataByTokenID.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshMetadataByTokenID.h new file mode 100644 index 0000000..20c2752 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshMetadataByTokenID.h @@ -0,0 +1,51 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTMetadataAttribute.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIRefreshMetadataByTokenID + * + * + */ +class IMMUTABLEZKEVMAPI_API APIRefreshMetadataByTokenID : public Model +{ +public: + virtual ~APIRefreshMetadataByTokenID() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The name of the NFT */ + TOptional Name; + /* The description of the NFT */ + TOptional Description; + /* The image url of the NFT */ + TOptional Image; + /* The external link of the NFT */ + TOptional ExternalUrl; + /* The animation url of the NFT */ + TOptional AnimationUrl; + /* The youtube link of the NFT */ + TOptional YoutubeUrl; + /* List of Metadata attributes */ + TOptional> Attributes; + /* An `uint256` token id as string */ + FString TokenId; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshNFTMetadataByTokenIDRequest.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshNFTMetadataByTokenIDRequest.h new file mode 100644 index 0000000..e93ada1 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshNFTMetadataByTokenIDRequest.h @@ -0,0 +1,37 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIRefreshMetadataByTokenID.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIRefreshNFTMetadataByTokenIDRequest + * + * + */ +class IMMUTABLEZKEVMAPI_API APIRefreshNFTMetadataByTokenIDRequest : public Model +{ +public: + virtual ~APIRefreshNFTMetadataByTokenIDRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of nft metadata to be refreshed. Total size of the list should not exceed 228 KiB */ + TArray NftMetadata; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshableNFTAttributes.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshableNFTAttributes.h new file mode 100644 index 0000000..44b85cb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIRefreshableNFTAttributes.h @@ -0,0 +1,49 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTMetadataAttribute.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIRefreshableNFTAttributes + * + * + */ +class IMMUTABLEZKEVMAPI_API APIRefreshableNFTAttributes : public Model +{ +public: + virtual ~APIRefreshableNFTAttributes() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The name of the NFT */ + TOptional Name; + /* The description of the NFT */ + TOptional Description; + /* The image url of the NFT */ + TOptional Image; + /* The external link of the NFT */ + TOptional ExternalUrl; + /* The animation url of the NFT */ + TOptional AnimationUrl; + /* The youtube link of the NFT */ + TOptional YoutubeUrl; + /* List of Metadata attributes */ + TOptional> Attributes; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APISaleFee.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APISaleFee.h new file mode 100644 index 0000000..71c9141 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APISaleFee.h @@ -0,0 +1,47 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APISaleFee + * + * + */ +class IMMUTABLEZKEVMAPI_API APISaleFee : public Model +{ +public: + virtual ~APISaleFee() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Fee payable to recipient upon settlement */ + TOptional Amount; + enum class TypeEnum + { + Royalty, + }; + + static FString EnumToString(const TypeEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, TypeEnum& EnumValue); + /* Fee type */ + TOptional Type; + /* Wallet address of fee recipient */ + TOptional Recipient; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APISalePayment.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APISalePayment.h new file mode 100644 index 0000000..b2a16ec --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APISalePayment.h @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APISaleFee.h" +#include "APISalePaymentToken.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APISalePayment + * + * + */ +class IMMUTABLEZKEVMAPI_API APISalePayment : public Model +{ +public: + virtual ~APISalePayment() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APISalePaymentToken Token; + /* The base price of the sale not including any fees */ + FString PriceExcludingFees; + /* The total price of the sale. Includes the sum of all fees */ + FString PriceIncludingFees; + /* The fees associated with this sale */ + TArray Fees; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APISalePaymentToken.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APISalePaymentToken.h new file mode 100644 index 0000000..eec5668 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APISalePaymentToken.h @@ -0,0 +1,42 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityNativeToken.h" +#include "APIActivityToken.h" +#include "APITokenContractType.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APISalePaymentToken + * + * The type of payment token + */ +class IMMUTABLEZKEVMAPI_API APISalePaymentToken : public Model +{ +public: + virtual ~APISalePaymentToken() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APITokenContractType ContractType; + /* The contract address */ + FString ContractAddress; + /* The token symbol */ + FString Symbol; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APISearchNFTsResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APISearchNFTsResult.h new file mode 100644 index 0000000..1f9331b --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APISearchNFTsResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APINFTBundle.h" +#include "APIPage.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APISearchNFTsResult + * + * Search NFTs result + */ +class IMMUTABLEZKEVMAPI_API APISearchNFTsResult : public Model +{ +public: + virtual ~APISearchNFTsResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of nft bundles */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APISearchStacksResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APISearchStacksResult.h new file mode 100644 index 0000000..05be3e0 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APISearchStacksResult.h @@ -0,0 +1,39 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIPage.h" +#include "APIStackBundle.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APISearchStacksResult + * + * Search stacks result + */ +class IMMUTABLEZKEVMAPI_API APISearchStacksResult : public Model +{ +public: + virtual ~APISearchStacksResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* List of stack bundles */ + TArray Result; + APIPage Page; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APISignCraftingRequest.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APISignCraftingRequest.h new file mode 100644 index 0000000..c6185a1 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APISignCraftingRequest.h @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APICall.h" +#include "APISignCraftingRequestMultiCaller.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APISignCraftingRequest + * + * + */ +class IMMUTABLEZKEVMAPI_API APISignCraftingRequest : public Model +{ +public: + virtual ~APISignCraftingRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APISignCraftingRequestMultiCaller MultiCaller; + /* The id of this request in the system that originates the crafting request, specified as a 32 byte hex string */ + FString ReferenceId; + /* The calls to be signed */ + TArray Calls; + /* The expiration time of the request */ + FDateTime ExpiresAt; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APISignCraftingRequestMultiCaller.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APISignCraftingRequestMultiCaller.h new file mode 100644 index 0000000..ec37653 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APISignCraftingRequestMultiCaller.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APISignCraftingRequestMultiCaller + * + * + */ +class IMMUTABLEZKEVMAPI_API APISignCraftingRequestMultiCaller : public Model +{ +public: + virtual ~APISignCraftingRequestMultiCaller() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* An Ethereum address */ + FString Address; + /* The name of the multicaller contract */ + FString Name; + /* The version of the multicaller contract */ + FString Version; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APISignCraftingResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APISignCraftingResult.h new file mode 100644 index 0000000..a5a6fd1 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APISignCraftingResult.h @@ -0,0 +1,38 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APISignCraftingResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APISignCraftingResult : public Model +{ +public: + virtual ~APISignCraftingResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* An Ethereum address */ + FString SignerAddress; + /* The signature of the request */ + FString Signature; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIStack.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStack.h new file mode 100644 index 0000000..3834579 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStack.h @@ -0,0 +1,61 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIMarketplaceContractType.h" +#include "APINFTMetadataAttribute.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIStack + * + * Stack + */ +class IMMUTABLEZKEVMAPI_API APIStack : public Model +{ +public: + virtual ~APIStack() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Stack ID */ + FGuid StackId; + APIChain Chain; + /* Contract address */ + FString ContractAddress; + APIMarketplaceContractType ContractType; + /* When the metadata was created */ + FDateTime CreatedAt; + /* When the metadata was last updated */ + FDateTime UpdatedAt; + /* The name of the NFT */ + TOptional Name; + /* The description of the NFT */ + TOptional Description; + /* The image url of the NFT */ + TOptional Image; + /* The external website link of NFT */ + TOptional ExternalUrl; + /* The animation url of the NFT */ + TOptional AnimationUrl; + /* The youtube URL of NFT */ + TOptional YoutubeUrl; + /* List of Metadata attributes */ + TOptional> Attributes; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIStackBundle.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStackBundle.h new file mode 100644 index 0000000..a3d849a --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStackBundle.h @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIListing.h" +#include "APIMarket.h" +#include "APIStack.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIStackBundle + * + * Stack bundle includes stacks, markets and listings + */ +class IMMUTABLEZKEVMAPI_API APIStackBundle : public Model +{ +public: + virtual ~APIStackBundle() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIStack Stack; + /* Total count of NFTs in the stack matching the filter params */ + int32 StackCount = 0; + TOptional Market; + /* List of open listings for the stack. */ + TArray Listings; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIStackQuoteResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStackQuoteResult.h new file mode 100644 index 0000000..da8c742 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStackQuoteResult.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIMarket.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIStackQuoteResult + * + * Stack quote result + */ +class IMMUTABLEZKEVMAPI_API APIStackQuoteResult : public Model +{ +public: + virtual ~APIStackQuoteResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + FGuid StackId; + APIMarket MarketStack; + APIMarket MarketCollection; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIStacksApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStacksApi.h new file mode 100644 index 0000000..6f1f71f --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStacksApi.h @@ -0,0 +1,71 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APIStacksApi +{ +public: + APIStacksApi(); + ~APIStacksApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class ListStacksRequest; + class ListStacksResponse; + class SearchNFTsRequest; + class SearchNFTsResponse; + class SearchStacksRequest; + class SearchStacksResponse; + + DECLARE_DELEGATE_OneParam(FListStacksDelegate, const ListStacksResponse&); + DECLARE_DELEGATE_OneParam(FSearchNFTsDelegate, const SearchNFTsResponse&); + DECLARE_DELEGATE_OneParam(FSearchStacksDelegate, const SearchStacksResponse&); + + FHttpRequestPtr ListStacks(const ListStacksRequest& Request, const FListStacksDelegate& Delegate = FListStacksDelegate()) const; + FHttpRequestPtr SearchNFTs(const SearchNFTsRequest& Request, const FSearchNFTsDelegate& Delegate = FSearchNFTsDelegate()) const; + FHttpRequestPtr SearchStacks(const SearchStacksRequest& Request, const FSearchStacksDelegate& Delegate = FSearchStacksDelegate()) const; + +private: + void OnListStacksResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListStacksDelegate Delegate) const; + void OnSearchNFTsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSearchNFTsDelegate Delegate) const; + void OnSearchStacksResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FSearchStacksDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIStacksApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStacksApiOperations.h new file mode 100644 index 0000000..6749189 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIStacksApiOperations.h @@ -0,0 +1,145 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIStacksApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError401.h" +#include "APIAPIError403.h" +#include "APIAPIError404.h" +#include "APIAPIError429.h" +#include "APIAPIError500.h" +#include "APISearchNFTsResult.h" +#include "APISearchStacksResult.h" +#include "APIStackBundle.h" + +namespace ImmutablezkEVMAPI +{ + +/* Experimental: List NFT stacks by stack_id + * + * ![Experimental](https://img.shields.io/badge/status-experimental-yellow) NFT stacks +*/ +class IMMUTABLEZKEVMAPI_API APIStacksApi::ListStacksRequest : public Request +{ +public: + virtual ~ListStacksRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* List of stack_id to filter by */ + TArray StackId; +}; + +class IMMUTABLEZKEVMAPI_API APIStacksApi::ListStacksResponse : public Response +{ +public: + virtual ~ListStacksResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + TArray Content; +}; + +/* Experimental: Search NFTs + * + * ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Search NFTs +*/ +class IMMUTABLEZKEVMAPI_API APIStacksApi::SearchNFTsRequest : public Request +{ +public: + virtual ~SearchNFTsRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* List of contract addresses to filter by */ + TArray ContractAddress; + /* Account address to filter by */ + TOptional AccountAddress; + /* Filters NFTs that belong to any of these stacks */ + TOptional> StackId; + /* Whether the listings should include only the owner created listings */ + TOptional OnlyIncludeOwnerListings; + /* Number of results to return per page */ + TOptional PageSize; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; +}; + +class IMMUTABLEZKEVMAPI_API APIStacksApi::SearchNFTsResponse : public Response +{ +public: + virtual ~SearchNFTsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APISearchNFTsResult Content; +}; + +/* Experimental: Search NFT stacks + * + * ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Search NFT stacks +*/ +class IMMUTABLEZKEVMAPI_API APIStacksApi::SearchStacksRequest : public Request +{ +public: + virtual ~SearchStacksRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* List of contract addresses to filter by */ + TArray ContractAddress; + /* Account address to filter by */ + TOptional AccountAddress; + /* Whether to the listings should include only the owner created listings */ + TOptional OnlyIncludeOwnerListings; + /* Filters results to include only stacks that have a current active listing. False and 'null' return all unfiltered stacks. */ + TOptional OnlyIfHasActiveListings; + /* JSON encoded traits to filter by. e.g. encodeURIComponent(JSON.stringify({\"rarity\": {\"values\": [\"common\", \"rare\"], \"condition\": \"eq\"}})) */ + TOptional Trait; + /* Keyword to search NFT name and description. Alphanumeric characters only. */ + TOptional Keyword; + enum class SortByEnum + { + CheapestFirst, + }; + + static FString EnumToString(const SortByEnum& EnumValue); + static bool EnumFromString(const FString& EnumAsString, SortByEnum& EnumValue); + /* Sort results in a specific order */ + TOptional SortBy; + /* Number of results to return per page */ + TOptional PageSize; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; +}; + +class IMMUTABLEZKEVMAPI_API APIStacksApi::SearchStacksResponse : public Response +{ +public: + virtual ~SearchStacksResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APISearchStacksResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIToken.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIToken.h new file mode 100644 index 0000000..7d781e1 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIToken.h @@ -0,0 +1,58 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIAssetVerificationStatus.h" +#include "APIChain.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIToken + * + * + */ +class IMMUTABLEZKEVMAPI_API APIToken : public Model +{ +public: + virtual ~APIToken() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APIChain Chain; + /* The address of token contract */ + FString ContractAddress; + /* The address of root token contract */ + TOptional RootContractAddress; + /* The id of the root chain for a bridged token */ + TOptional RootChainId; + /* The name of the bridge, for bridged tokens only */ + TOptional BridgeUsed; + /* The symbol of token */ + TOptional Symbol; + /* The decimals of token */ + TOptional Decimals; + /* The image url of token */ + TOptional ImageUrl; + /* The name of token */ + TOptional Name; + APIAssetVerificationStatus VerificationStatus; + /* When the collection was last updated */ + FDateTime UpdatedAt; + /* Indicates whether the token is canonical or not */ + bool IsCanonical = false; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APITokenContractType.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APITokenContractType.h new file mode 100644 index 0000000..dc22019 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APITokenContractType.h @@ -0,0 +1,43 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APITokenContractType + * + * The contract type for a token + */ +class IMMUTABLEZKEVMAPI_API APITokenContractType : public Model +{ +public: + virtual ~APITokenContractType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + ERC20, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APITokensApi.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APITokensApi.h new file mode 100644 index 0000000..5d5f3f2 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APITokensApi.h @@ -0,0 +1,66 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +class IMMUTABLEZKEVMAPI_API APITokensApi +{ +public: + APITokensApi(); + ~APITokensApi(); + + /* Sets the URL Endpoint. + * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ + void SetURL(const FString& Url); + + /* Adds global header params to all requests */ + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * See also: Request::SetShouldRetry */ + void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); + FHttpRetrySystem::FManager& GetHttpRetryManager(); + + class GetERC20TokenRequest; + class GetERC20TokenResponse; + class ListERC20TokensRequest; + class ListERC20TokensResponse; + + DECLARE_DELEGATE_OneParam(FGetERC20TokenDelegate, const GetERC20TokenResponse&); + DECLARE_DELEGATE_OneParam(FListERC20TokensDelegate, const ListERC20TokensResponse&); + + FHttpRequestPtr GetERC20Token(const GetERC20TokenRequest& Request, const FGetERC20TokenDelegate& Delegate = FGetERC20TokenDelegate()) const; + FHttpRequestPtr ListERC20Tokens(const ListERC20TokensRequest& Request, const FListERC20TokensDelegate& Delegate = FListERC20TokensDelegate()) const; + +private: + void OnGetERC20TokenResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetERC20TokenDelegate Delegate) const; + void OnListERC20TokensResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FListERC20TokensDelegate Delegate) const; + + FHttpRequestRef CreateHttpRequest(const Request& Request) const; + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; + mutable FHttpRetrySystem::FManager* RetryManager = nullptr; + mutable TUniquePtr DefaultRetryManager; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APITokensApiOperations.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APITokensApiOperations.h new file mode 100644 index 0000000..afc2209 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APITokensApiOperations.h @@ -0,0 +1,90 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APITokensApi.h" + +#include "APIAPIError400.h" +#include "APIAPIError404.h" +#include "APIAPIError500.h" +#include "APIAssetVerificationStatus.h" +#include "APIGetTokenResult.h" +#include "APIListTokensResult.h" + +namespace ImmutablezkEVMAPI +{ + +/* Get single ERC20 token + * + * Get single ERC20 token +*/ +class IMMUTABLEZKEVMAPI_API APITokensApi::GetERC20TokenRequest : public Request +{ +public: + virtual ~GetERC20TokenRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The address of contract */ + FString ContractAddress; + /* The name of chain */ + FString ChainName; +}; + +class IMMUTABLEZKEVMAPI_API APITokensApi::GetERC20TokenResponse : public Response +{ +public: + virtual ~GetERC20TokenResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIGetTokenResult Content; +}; + +/* List ERC20 tokens + * + * List ERC20 tokens +*/ +class IMMUTABLEZKEVMAPI_API APITokensApi::ListERC20TokensRequest : public Request +{ +public: + virtual ~ListERC20TokensRequest() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name of chain */ + FString ChainName; + /* Datetime to use as the oldest updated timestamp */ + TOptional FromUpdatedAt; + /* List of verification status to filter by */ + TOptional> VerificationStatus; + /* [Experimental - Canonical token data may be updated] Filter by canonical or non-canonical tokens. */ + TOptional IsCanonical; + /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ + TOptional PageCursor; + /* Maximum number of items to return */ + TOptional PageSize; +}; + +class IMMUTABLEZKEVMAPI_API APITokensApi::ListERC20TokensResponse : public Response +{ +public: + virtual ~ListERC20TokensResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonValue) final; + + APIListTokensResult Content; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APITrade.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APITrade.h new file mode 100644 index 0000000..db29ed5 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APITrade.h @@ -0,0 +1,58 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIFee.h" +#include "APIItem.h" +#include "APITradeBlockchainMetadata.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APITrade + * + * + */ +class IMMUTABLEZKEVMAPI_API APITrade : public Model +{ +public: + virtual ~APITrade() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Buy items are transferred from the taker to the maker. */ + TArray Buy; + /* Deprecated. Use maker and taker addresses instead of buyer and seller addresses. */ + FString BuyerAddress; + /* Deprecated. Use fees instead. The taker always pays the fees. */ + TArray BuyerFees; + TArray Fees; + APIChain Chain; + FString OrderId; + TOptional BlockchainMetadata; + /* Time the on-chain trade event is indexed by the order book system */ + FDateTime IndexedAt; + /* Global Trade identifier */ + FString Id; + /* Sell items are transferred from the maker to the taker. */ + TArray Sell; + /* Deprecated. Use maker and taker addresses instead of buyer and seller addresses. */ + FString SellerAddress; + FString MakerAddress; + FString TakerAddress; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APITradeBlockchainMetadata.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APITradeBlockchainMetadata.h new file mode 100644 index 0000000..034aefb --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APITradeBlockchainMetadata.h @@ -0,0 +1,42 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APITradeBlockchainMetadata + * + * The metadata related to the transaction in which the activity occurred + */ +class IMMUTABLEZKEVMAPI_API APITradeBlockchainMetadata : public Model +{ +public: + virtual ~APITradeBlockchainMetadata() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The transaction hash of the trade */ + FString TransactionHash; + /* EVM block number (uint64 as string) */ + FString BlockNumber; + /* Transaction index in a block (uint32 as string) */ + FString TransactionIndex; + /* The log index of the fulfillment event in a block (uint32 as string) */ + FString LogIndex; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APITradeResult.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APITradeResult.h new file mode 100644 index 0000000..3a2a861 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APITradeResult.h @@ -0,0 +1,36 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APITrade.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APITradeResult + * + * + */ +class IMMUTABLEZKEVMAPI_API APITradeResult : public Model +{ +public: + virtual ~APITradeResult() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + APITrade Result; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APITransfer.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APITransfer.h new file mode 100644 index 0000000..c94de77 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APITransfer.h @@ -0,0 +1,42 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityAsset.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APITransfer + * + * The transfer activity details + */ +class IMMUTABLEZKEVMAPI_API APITransfer : public Model +{ +public: + virtual ~APITransfer() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The account address the asset was transferred from */ + FString From; + /* The account address the asset was transferred to */ + FString To; + /* The amount of assets transferred */ + FString Amount; + APIActivityAsset Asset; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIUnfulfillableOrder.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIUnfulfillableOrder.h new file mode 100644 index 0000000..6ce55df --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIUnfulfillableOrder.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIUnfulfillableOrder + * + * + */ +class IMMUTABLEZKEVMAPI_API APIUnfulfillableOrder : public Model +{ +public: + virtual ~APIUnfulfillableOrder() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* OrderID for the requested but unfulfillable order */ + FString OrderId; + /* Token ID for the ERC721 or ERC1155 token when fulfilling a collection order */ + TOptional TokenId; + /* Nullable string containing error reason if the signing is unsuccessful for the order */ + FString Reason; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIUserInfo.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIUserInfo.h new file mode 100644 index 0000000..41d91a6 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIUserInfo.h @@ -0,0 +1,42 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIUserInfo + * + * + */ +class IMMUTABLEZKEVMAPI_API APIUserInfo : public Model +{ +public: + virtual ~APIUserInfo() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The user's id */ + FString Sub; + /* The user's email address */ + TOptional Email; + /* The user's Passport address if it has been registered */ + TOptional PassportAddress; + /* The user's list of linked addresses */ + TArray LinkedAddresses; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequest.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequest.h new file mode 100644 index 0000000..4d04f6d --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequest.h @@ -0,0 +1,56 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIVerificationRequestContractType.h" +#include "APIVerificationRequestStatus.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIVerificationRequest + * + * The verification request + */ +class IMMUTABLEZKEVMAPI_API APIVerificationRequest : public Model +{ +public: + virtual ~APIVerificationRequest() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The id of the verification request */ + FGuid Id; + APIChain Chain; + /* The contract address */ + FString ContractAddress; + /* The name of the organisation associated with this contract */ + TOptional OrgName; + /* The name of the collection */ + TOptional Name; + /* The symbol of contract */ + TOptional Symbol; + /* The description of collection */ + TOptional Description; + /* The id of the organisation associated with this contract */ + TOptional OrgId; + /* The email address of the user who requested the contract to be verified */ + TOptional RequesterEmail; + APIVerificationRequestContractType ContractType; + APIVerificationRequestStatus VerificationRequestStatus; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequestContractType.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequestContractType.h new file mode 100644 index 0000000..45b7c03 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequestContractType.h @@ -0,0 +1,45 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIVerificationRequestContractType + * + * The contract type associated with the given request + */ +class IMMUTABLEZKEVMAPI_API APIVerificationRequestContractType : public Model +{ +public: + virtual ~APIVerificationRequestContractType() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + ERC20, + ERC721, + ERC1155, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequestInternal.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequestInternal.h new file mode 100644 index 0000000..b204265 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequestInternal.h @@ -0,0 +1,58 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIChain.h" +#include "APIOrganisationTier.h" +#include "APIVerificationRequestContractType.h" +#include "APIVerificationRequestStatus.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIVerificationRequestInternal + * + * The verification request (internal) + */ +class IMMUTABLEZKEVMAPI_API APIVerificationRequestInternal : public Model +{ +public: + virtual ~APIVerificationRequestInternal() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The id of the verification request */ + FGuid Id; + APIChain Chain; + /* The contract address */ + FString ContractAddress; + /* The name of the organisation associated with this contract */ + TOptional OrgName; + /* The name of the collection */ + TOptional Name; + /* The symbol of contract */ + TOptional Symbol; + /* The description of collection */ + TOptional Description; + /* The id of the organisation associated with this contract */ + TOptional OrgId; + /* The email address of the user who requested the contract to be verified */ + TOptional RequesterEmail; + APIVerificationRequestContractType ContractType; + APIVerificationRequestStatus VerificationRequestStatus; + TOptional OrgTier; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequestStatus.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequestStatus.h new file mode 100644 index 0000000..6cfb855 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIVerificationRequestStatus.h @@ -0,0 +1,44 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIVerificationRequestStatus + * + * The status of the verification request + */ +class IMMUTABLEZKEVMAPI_API APIVerificationRequestStatus : public Model +{ +public: + virtual ~APIVerificationRequestStatus() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + enum class Values + { + Completed, + Pending, + }; + + Values Value; + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIWallet.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIWallet.h new file mode 100644 index 0000000..7775eec --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIWallet.h @@ -0,0 +1,46 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIWallet + * + * Linked wallet + */ +class IMMUTABLEZKEVMAPI_API APIWallet : public Model +{ +public: + virtual ~APIWallet() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Ethereum address */ + FString Address; + /* Wallet type */ + FString Type; + /* Created at */ + FDateTime CreatedAt; + /* Created at */ + FDateTime UpdatedAt; + /* Name */ + TOptional Name; + /* Name of client that linked the wallet */ + FString ClientName; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/Public/APIWithdrawal.h b/Source/Experimental/ImmutablezkEVMAPI/Public/APIWithdrawal.h new file mode 100644 index 0000000..4ab0db4 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/Public/APIWithdrawal.h @@ -0,0 +1,40 @@ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * OpenAPI spec version: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "APIBaseModel.h" +#include "APIActivityAsset.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIWithdrawal + * + * The withdrawal activity details + */ +class IMMUTABLEZKEVMAPI_API APIWithdrawal : public Model +{ +public: + virtual ~APIWithdrawal() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* The account address the asset was withdrawn from */ + FString From; + /* The amount of assets withdrawn */ + FString Amount; + APIActivityAsset Asset; +}; + +} diff --git a/Source/Experimental/ImmutablezkEVMAPI/README.md b/Source/Experimental/ImmutablezkEVMAPI/README.md new file mode 100644 index 0000000..5879fec --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/README.md @@ -0,0 +1,8 @@ +# Usage + +TO generate OpenAPI locally: + + ``` + openapi-generator-cli generate -i openapi.json -g cpp-ue4 -o . --additional-properties=modelNamePrefix="API",cppNamespace=ImmutableOrderbook,unrealModuleName=ImmutableOrderbook + + ``` \ No newline at end of file diff --git a/Source/Experimental/ImmutablezkEVMAPI/openapi.json b/Source/Experimental/ImmutablezkEVMAPI/openapi.json new file mode 100644 index 0000000..00be343 --- /dev/null +++ b/Source/Experimental/ImmutablezkEVMAPI/openapi.json @@ -0,0 +1,9827 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Immutable zkEVM API", + "version": "1.0.0", + "description": "Immutable Multi Rollup API", + "contact": { + "name": "Immutable API Support", + "email": "support@immutable.com", + "url": "https://support.immutable.com" + } + }, + "servers": [ + { + "url": "https://api.sandbox.immutable.com" + } + ], + "tags": [ + { + "name": "activities", + "description": "Activities Endpoints", + "x-displayName": "activities" + }, + { + "name": "chains", + "description": "Chains Endpoints", + "x-displayName": "chains" + }, + { + "name": "collections", + "description": "Collections Endpoints", + "x-displayName": "collections" + }, + { + "name": "nfts", + "description": "NFTs Endpoints", + "x-displayName": "nfts" + }, + { + "name": "nft owners", + "description": "NFT Owner Endpoints", + "x-displayName": "nft owners" + }, + { + "name": "metadata", + "description": "NFT Metadata Endpoints", + "x-displayName": "metadata" + }, + { + "name": "tokens", + "description": "ERC20 Token Endpoints", + "x-displayName": "tokens" + }, + { + "name": "demopage", + "description": "Temporary HTML endpoint for demo purposes", + "x-displayName": "demopage" + }, + { + "name": "verification", + "x-displayName": "verification" + }, + { + "name": "operatorallowlist", + "x-displayName": "operatorallowlist" + }, + { + "name": "crafting", + "x-displayName": "crafting" + }, + { + "name": "listings", + "description": "Listings Endpoints", + "x-displayName": "listings" + }, + { + "name": "orders", + "x-displayName": "orders" + }, + { + "name": "passport", + "description": "Passport operations", + "x-displayName": "passport" + }, + { + "name": "passport profile", + "description": "Passport Profile endpoints", + "x-displayName": "passport profile" + }, + { + "name": "guardian", + "description": "Guardian endpoints", + "x-displayName": "guardian" + }, + { + "name": "pricing", + "description": "Pricing Endpoints", + "x-displayName": "pricing" + }, + { + "name": "stacks", + "description": "Stacks Endpoints", + "x-displayName": "stacks" + } + ], + "paths": { + "/v1/chains/{chain_name}/activity-history": { + "get": { + "tags": [ + "activities" + ], + "operationId": "ListActivityHistory", + "summary": "List history of activities", + "description": "List activities sorted by updated_at timestamp ascending, useful for time based data replication", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "in": "path", + "required": true, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "From indexed at including given date", + "required": true, + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "to_updated_at", + "in": "query", + "required": false, + "description": "To indexed at including given date", + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "contract_address", + "in": "query", + "description": "The contract address of the collection", + "required": false, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "activity_type", + "in": "query", + "description": "The activity type", + "required": false, + "example": "burn", + "schema": { + "$ref": "#/components/schemas/ActivityType" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListActivitiesResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/activities": { + "get": { + "tags": [ + "activities" + ], + "operationId": "ListActivities", + "summary": "List all activities", + "description": "List all activities", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "in": "path", + "required": true, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "contract_address", + "in": "query", + "description": "The contract address of NFT or ERC20 Token", + "required": false, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "token_id", + "in": "query", + "description": "An `uint256` token id as string", + "required": false, + "schema": { + "type": "string" + }, + "example": "1" + }, + { + "name": "account_address", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3", + "description": "The account address activity contains" + }, + { + "name": "activity_type", + "in": "query", + "description": "The activity type", + "required": false, + "example": "burn", + "schema": { + "$ref": "#/components/schemas/ActivityType" + } + }, + { + "name": "transaction_hash", + "in": "query", + "description": "The transaction hash of activity", + "required": false, + "schema": { + "type": "string" + }, + "example": "0x68d9eac5e3b3c3580404989a4030c948a78e1b07b2b5ea5688d8c38a6c61c93e" + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListActivitiesResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/activities/{activity_id}": { + "get": { + "tags": [ + "activities" + ], + "operationId": "GetActivity", + "summary": "Get a single activity by ID", + "description": "Get a single activity by ID", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "in": "path", + "required": true, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "activity_id", + "description": "The id of activity", + "schema": { + "$ref": "#/components/schemas/ActivityID" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetActivityResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections": { + "get": { + "description": "List all collections", + "tags": [ + "collections" + ], + "operationId": "ListCollections", + "summary": "List all collections", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "description": "The name of chain", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "contract_address", + "in": "query", + "required": false, + "description": "List of contract addresses to filter by", + "schema": { + "type": "array", + "items": { + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + } + } + }, + { + "name": "verification_status", + "in": "query", + "required": false, + "description": "List of verification status to filter by", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AssetVerificationStatus" + } + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "Datetime to use as the oldest updated timestamp", + "required": false, + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCollectionsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}": { + "get": { + "description": "Get collection by contract address", + "tags": [ + "collections" + ], + "operationId": "GetCollection", + "summary": "Get collection by contract address", + "parameters": [ + { + "name": "contract_address", + "in": "path", + "description": "The address contract", + "required": true, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCollectionResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/refresh-metadata": { + "post": { + "description": "Refresh collection metadata", + "summary": "Refresh collection metadata", + "tags": [ + "collections" + ], + "operationId": "RefreshCollectionMetadata", + "security": [ + { + "ImmutableApiKey": [ + "refresh:metadata" + ] + }, + { + "BearerAuth": [ + "refresh:metadata" + ] + } + ], + "parameters": [ + { + "name": "contract_address", + "in": "path", + "description": "The address contract", + "required": true, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + } + ], + "requestBody": { + "description": "The request body", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RefreshCollectionMetadataRequest" + } + } + } + }, + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RefreshCollectionMetadataResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/accounts/{account_address}/collections": { + "get": { + "description": "List collections by NFT owner account address", + "tags": [ + "collections" + ], + "operationId": "ListCollectionsByNFTOwner", + "summary": "List collections by NFT owner", + "parameters": [ + { + "name": "account_address", + "in": "path", + "description": "Account address", + "required": true, + "schema": { + "type": "string" + }, + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCollectionsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}": { + "get": { + "description": "Get NFT by token ID", + "tags": [ + "nfts" + ], + "summary": "Get NFT by token ID", + "operationId": "GetNFT", + "parameters": [ + { + "name": "contract_address", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The address of NFT contract", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + { + "name": "token_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "An `uint256` token id as string", + "example": "1" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetNFTResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/metadata/{metadata_id}": { + "get": { + "description": "Get metadata by ID", + "tags": [ + "metadata" + ], + "summary": "Get metadata by ID", + "operationId": "GetMetadata", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "contract_address", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The address of metadata contract", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + { + "name": "metadata_id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/MetadataID" + }, + "description": "The id of the metadata" + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetMetadataResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/metadata": { + "get": { + "description": "Get a list of metadata from the given contract", + "tags": [ + "metadata" + ], + "summary": "Get a list of metadata from the given contract", + "operationId": "ListMetadata", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "contract_address", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The address of metadata contract", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + { + "name": "from_updated_at", + "in": "query", + "description": "Datetime to use as the oldest updated timestamp", + "required": false, + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMetadataResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/metadata": { + "get": { + "description": "Get a list of metadata from the given chain", + "tags": [ + "metadata" + ], + "summary": "Get a list of metadata from the given chain", + "operationId": "ListMetadataForChain", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "Datetime to use as the oldest updated timestamp", + "required": false, + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMetadataResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/metadata/refresh-metadata": { + "post": { + "x-go-name": "RefreshMetadataByID", + "operationId": "RefreshMetadataByID", + "description": "Refresh stacked metadata", + "summary": "Refresh stacked metadata", + "tags": [ + "metadata" + ], + "parameters": [ + { + "$ref": "#/components/parameters/ChainName" + }, + { + "$ref": "#/components/parameters/ContractAddress" + } + ], + "security": [ + { + "ImmutableApiKey": [ + "refresh:metadata" + ] + } + ], + "requestBody": { + "description": "NFT Metadata Refresh Request", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RefreshMetadataByIDRequest" + } + } + } + }, + "responses": { + "202": { + "description": "Accepted", + "headers": { + "imx-refreshes-limit": { + "$ref": "#/components/headers/MetadataRefreshLimit" + }, + "imx-refresh-limit-reset": { + "$ref": "#/components/headers/MetadataRefreshLimitReset" + }, + "imx-remaining-refreshes": { + "$ref": "#/components/headers/MetadataRefreshLimitRemaining" + }, + "retry-after": { + "$ref": "#/components/headers/MetadataRefreshRetryAfter" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataRefreshRateLimitResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/TooManyMetadataRefreshes" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/nfts": { + "get": { + "description": "List NFTs by contract address", + "tags": [ + "nfts" + ], + "summary": "List NFTs by contract address", + "operationId": "ListNFTs", + "parameters": [ + { + "name": "contract_address", + "in": "path", + "required": true, + "description": "Contract address", + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "token_id", + "in": "query", + "required": false, + "description": "List of token IDs to filter by", + "schema": { + "type": "array", + "maxItems": 30, + "items": { + "type": "string", + "example": "1" + } + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "Datetime to use as the oldest updated timestamp", + "required": false, + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListNFTsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/accounts/{account_address}/nfts": { + "get": { + "description": "List NFTs by account address", + "tags": [ + "nfts" + ], + "operationId": "ListNFTsByAccountAddress", + "summary": "List NFTs by account address", + "parameters": [ + { + "name": "account_address", + "in": "path", + "description": "Account address", + "required": true, + "schema": { + "type": "string" + }, + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "contract_address", + "in": "query", + "description": "The address of contract", + "required": false, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "token_id", + "in": "query", + "required": false, + "description": "List of token IDs to filter by", + "schema": { + "type": "array", + "maxItems": 30, + "items": { + "type": "string", + "example": "1" + } + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "Datetime to use as the oldest updated timestamp", + "required": false, + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListNFTsByOwnerResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners": { + "get": { + "description": "List NFT owners by token ID", + "tags": [ + "nft owners" + ], + "operationId": "ListNFTOwners", + "summary": "List NFT owners by token ID", + "parameters": [ + { + "name": "contract_address", + "in": "path", + "description": "The address of contract", + "required": true, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "token_id", + "in": "path", + "description": "An `uint256` token id as string", + "required": true, + "schema": { + "type": "string" + }, + "example": "1" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListNFTOwnersResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/nfts": { + "get": { + "description": "List all NFTs on a chain", + "tags": [ + "nfts" + ], + "operationId": "ListAllNFTs", + "summary": "List all NFTs", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "Datetime to use as the oldest updated timestamp", + "required": false, + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListNFTsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/nft-owners": { + "get": { + "description": "List all NFT owners on a chain", + "tags": [ + "nft owners" + ], + "operationId": "ListAllNFTOwners", + "summary": "List all NFT owners", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "Datetime to use as the oldest updated timestamp", + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListNFTOwnersResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/owners": { + "get": { + "description": "List owners by contract address", + "tags": [ + "nft owners" + ], + "operationId": "ListOwnersByContractAddress", + "summary": "List owners by contract address", + "parameters": [ + { + "name": "contract_address", + "in": "path", + "description": "The address of contract", + "required": true, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "account_address", + "in": "query", + "required": false, + "description": "List of account addresses to filter by", + "schema": { + "type": "array", + "maxItems": 30, + "items": { + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + } + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "Datetime to use as the oldest updated timestamp", + "required": false, + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCollectionOwnersResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/tokens": { + "get": { + "description": "List ERC20 tokens", + "tags": [ + "tokens" + ], + "operationId": "ListERC20Tokens", + "summary": "List ERC20 tokens", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "Datetime to use as the oldest updated timestamp", + "required": false, + "schema": { + "type": "string", + "example": "2022-08-16T17:43:26.991388Z", + "format": "date-time" + } + }, + { + "name": "verification_status", + "in": "query", + "required": false, + "description": "List of verification status to filter by", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AssetVerificationStatus" + } + } + }, + { + "name": "is_canonical", + "in": "query", + "required": false, + "description": "[Experimental - Canonical token data may be updated] Filter by canonical or non-canonical tokens.", + "schema": { + "type": "boolean" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTokensResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/tokens/{contract_address}": { + "get": { + "description": "Get single ERC20 token", + "tags": [ + "tokens" + ], + "operationId": "GetERC20Token", + "summary": "Get single ERC20 token", + "parameters": [ + { + "name": "contract_address", + "in": "path", + "description": "The address of contract", + "required": true, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTokenResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains": { + "get": { + "description": "List supported chains", + "summary": "List supported chains", + "tags": [ + "chains" + ], + "operationId": "ListChains", + "parameters": [ + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListChainsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/nfts/refresh-metadata": { + "post": { + "description": "Refresh NFT metadata", + "summary": "Refresh NFT metadata", + "tags": [ + "metadata" + ], + "operationId": "RefreshNFTMetadataByTokenID", + "security": [ + { + "ImmutableApiKey": [ + "refresh:metadata" + ] + } + ], + "parameters": [ + { + "name": "contract_address", + "in": "path", + "description": "The address of contract", + "required": true, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + } + ], + "requestBody": { + "description": "the request body", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RefreshNFTMetadataByTokenIDRequest" + } + } + } + }, + "responses": { + "202": { + "description": "Accepted", + "headers": { + "imx-refreshes-limit": { + "$ref": "#/components/headers/MetadataRefreshLimit" + }, + "imx-refresh-limit-reset": { + "$ref": "#/components/headers/MetadataRefreshLimitReset" + }, + "imx-remaining-refreshes": { + "$ref": "#/components/headers/MetadataRefreshLimitRemaining" + }, + "retry-after": { + "$ref": "#/components/headers/MetadataRefreshRetryAfter" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataRefreshRateLimitResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/TooManyMetadataRefreshes" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests": { + "post": { + "description": "Create a mint request to mint a set of NFTs for a given collection", + "summary": "Mint NFTs", + "security": [ + { + "ImmutableApiKey": [ + "write:mint-request" + ] + } + ], + "tags": [ + "nfts" + ], + "operationId": "CreateMintRequest", + "parameters": [ + { + "name": "contract_address", + "in": "path", + "description": "The address of contract", + "required": true, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + } + ], + "requestBody": { + "description": "Create Mint Request Body", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMintRequestRequest" + } + } + } + }, + "responses": { + "202": { + "description": "Accepted", + "headers": { + "imx-mint-requests-limit": { + "$ref": "#/components/headers/MintRequestsLimit" + }, + "imx-mint-requests-limit-reset": { + "$ref": "#/components/headers/MintRequestsLimitReset" + }, + "imx-remaining-mint-requests": { + "$ref": "#/components/headers/MintRequestsLimitRemaining" + }, + "imx-mint-requests-retry-after": { + "$ref": "#/components/headers/MintRequestsRetryAfter" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMintRequestResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "409": { + "$ref": "#/components/responses/Conflict" + }, + "429": { + "$ref": "#/components/responses/TooManyMintRequests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "get": { + "description": "Retrieve the status of all mints for a given contract address", + "summary": "List mint requests", + "security": [ + { + "ImmutableApiKey": [ + "write:mint-request" + ] + } + ], + "tags": [ + "nfts" + ], + "operationId": "ListMintRequests", + "parameters": [ + { + "name": "contract_address", + "in": "path", + "description": "The address of contract", + "required": true, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + }, + { + "name": "page_size", + "description": "Maximum number of items to return", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageSize" + } + }, + { + "name": "status", + "description": "The status of the mint request", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/MintRequestStatus" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMintRequestsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests/{reference_id}": { + "get": { + "description": "Retrieve the status of a mint request identified by its reference_id", + "summary": "Get mint request by reference ID", + "security": [ + { + "ImmutableApiKey": [ + "write:mint-request" + ] + } + ], + "tags": [ + "nfts" + ], + "operationId": "GetMintRequest", + "parameters": [ + { + "name": "contract_address", + "in": "path", + "description": "The address of contract", + "required": true, + "schema": { + "type": "string" + }, + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "reference_id", + "description": "The id of the mint request", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "example": "67f7d464-b8f0-4f6a-9a3b-8d3cb4a21af0" + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMintRequestsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/crafting/sign": { + "post": { + "description": "Sign a crafting payload", + "tags": [ + "crafting" + ], + "operationId": "SignCraftingPayload", + "summary": "Sign a crafting payload", + "security": [ + { + "ImmutableApiKey": [ + "create:collections" + ] + } + ], + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + } + ], + "requestBody": { + "description": "The request body", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignCraftingRequest" + } + } + } + }, + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignCraftingResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/orders/cancel": { + "post": { + "tags": [ + "orders" + ], + "summary": "Cancel one or more orders", + "description": "Cancel one or more orders", + "operationId": "CancelOrders", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelOrdersRequestBody" + } + } + } + }, + "responses": { + "200": { + "description": "Orders cancellation response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelOrdersResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + }, + "501": { + "$ref": "#/components/responses/NotImplementedError" + } + } + } + }, + "/v1/chains/{chain_name}/orders/listings": { + "get": { + "tags": [ + "orders" + ], + "summary": "List all listings", + "description": "List all listings", + "operationId": "ListListings", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "status", + "in": "query", + "description": "Order status to filter by", + "required": false, + "schema": { + "$ref": "#/components/schemas/OrderStatusName" + } + }, + { + "name": "sell_item_contract_address", + "in": "query", + "description": "Sell item contract address to filter by", + "required": false, + "schema": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "buy_item_type", + "in": "query", + "description": "Buy item type to filter by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "NATIVE", + "ERC20" + ], + "example": "NATIVE" + } + }, + { + "name": "buy_item_contract_address", + "in": "query", + "description": "Buy item contract address to filter by", + "required": false, + "schema": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "account_address", + "in": "query", + "description": "The account address of the user who created the listing", + "required": false, + "schema": { + "type": "string", + "example": "0xc49Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "sell_item_metadata_id", + "in": "query", + "description": "The metadata_id of the sell item", + "required": false, + "schema": { + "type": "string", + "format": "uuid", + "example": "020792C9-4AD7-8EC4-4038-9E05C598535B" + } + }, + { + "name": "sell_item_token_id", + "in": "query", + "description": "Sell item token identifier to filter by", + "required": false, + "schema": { + "type": "string", + "example": "1", + "pattern": "\\d+" + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "From updated at including given date", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + } + }, + { + "name": "page_size", + "in": "query", + "description": "Maximum number of orders to return per page", + "schema": { + "$ref": "#/components/schemas/PageSize" + } + }, + { + "name": "sort_by", + "in": "query", + "description": "Order field to sort by. `buy_item_amount` sorts by per token price, for example if 5 ERC-1155s are on sale for 10eth, it’s sorted as 2eth for `buy_item_amount`.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "created_at", + "updated_at", + "buy_item_amount" + ], + "description": "Order field to sort by", + "example": "created_at" + }, + "example": "created_at" + }, + { + "name": "sort_direction", + "in": "query", + "description": "Ascending or descending direction for sort", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "description": "Ascending or descending direction for sort", + "example": "asc" + }, + "example": "asc" + }, + { + "name": "page_cursor", + "in": "query", + "description": "Page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + } + ], + "responses": { + "200": { + "description": "OK response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListListingsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "tags": [ + "orders" + ], + "summary": "Create a listing", + "description": "Create a listing", + "operationId": "CreateListing", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateListingRequestBody" + } + } + } + }, + "responses": { + "201": { + "description": "Created response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/orders/bids": { + "get": { + "tags": [ + "orders" + ], + "summary": "List all bids", + "description": "List all bids", + "operationId": "ListBids", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "status", + "in": "query", + "description": "Order status to filter by", + "required": false, + "schema": { + "$ref": "#/components/schemas/OrderStatusName" + } + }, + { + "name": "buy_item_contract_address", + "in": "query", + "description": "Buy item contract address to filter by", + "required": false, + "schema": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "sell_item_contract_address", + "in": "query", + "description": "Sell item contract address to filter by", + "required": false, + "schema": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "account_address", + "in": "query", + "description": "The account address of the user who created the bid", + "required": false, + "schema": { + "type": "string", + "example": "0xc49Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "buy_item_metadata_id", + "in": "query", + "description": "The metadata_id of the buy item", + "required": false, + "schema": { + "type": "string", + "format": "uuid", + "example": "020792C9-4AD7-8EC4-4038-9E05C598535B" + } + }, + { + "name": "buy_item_token_id", + "in": "query", + "description": "buy item token identifier to filter by", + "required": false, + "schema": { + "type": "string", + "example": "1", + "pattern": "\\d+" + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "From updated at including given date", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + } + }, + { + "name": "page_size", + "in": "query", + "description": "Maximum number of orders to return per page", + "schema": { + "$ref": "#/components/schemas/PageSize" + } + }, + { + "name": "sort_by", + "in": "query", + "description": "Order field to sort by. `sell_item_amount` sorts by per token price, for example if 10eth is offered for 5 ERC1155 items, it’s sorted as 2eth for `sell_item_amount`.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "created_at", + "updated_at", + "sell_item_amount" + ], + "description": "Order field to sort by", + "example": "created_at" + }, + "example": "created_at" + }, + { + "name": "sort_direction", + "in": "query", + "description": "Ascending or descending direction for sort", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "description": "Ascending or descending direction for sort", + "example": "asc" + }, + "example": "asc" + }, + { + "name": "page_cursor", + "in": "query", + "description": "Page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + } + ], + "responses": { + "200": { + "description": "OK response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBidsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "tags": [ + "orders" + ], + "summary": "Create a bid", + "description": "Create a bid", + "operationId": "CreateBid", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBidRequestBody" + } + } + } + }, + "responses": { + "201": { + "description": "Created response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BidResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + }, + "501": { + "$ref": "#/components/responses/NotImplementedError" + } + } + } + }, + "/v1/chains/{chain_name}/orders/collection-bids": { + "get": { + "tags": [ + "orders" + ], + "summary": "List all collection bids", + "description": "List all collection bids", + "operationId": "ListCollectionBids", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "status", + "in": "query", + "description": "Order status to filter by", + "required": false, + "schema": { + "$ref": "#/components/schemas/OrderStatusName" + } + }, + { + "name": "buy_item_contract_address", + "in": "query", + "description": "Buy item contract address to filter by", + "required": false, + "schema": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "sell_item_contract_address", + "in": "query", + "description": "Sell item contract address to filter by", + "required": false, + "schema": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "account_address", + "in": "query", + "description": "The account address of the user who created the bid", + "required": false, + "schema": { + "type": "string", + "example": "0xc49Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "from_updated_at", + "in": "query", + "description": "From updated at including given date", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + } + }, + { + "name": "page_size", + "in": "query", + "description": "Maximum number of orders to return per page", + "schema": { + "$ref": "#/components/schemas/PageSize" + } + }, + { + "name": "sort_by", + "in": "query", + "description": "Order field to sort by. `sell_item_amount` sorts by per token price, for example if 10eth is offered for 5 ERC1155 items, it’s sorted as 2eth for `sell_item_amount`.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "created_at", + "updated_at", + "sell_item_amount" + ], + "description": "Order field to sort by", + "example": "created_at" + }, + "example": "created_at" + }, + { + "name": "sort_direction", + "in": "query", + "description": "Ascending or descending direction for sort", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "description": "Ascending or descending direction for sort", + "example": "asc" + }, + "example": "asc" + }, + { + "name": "page_cursor", + "in": "query", + "description": "Page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + } + ], + "responses": { + "200": { + "description": "OK response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCollectionBidsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + }, + "post": { + "tags": [ + "orders" + ], + "summary": "Create a collection bid", + "description": "Create a collection bid", + "operationId": "CreateCollectionBid", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCollectionBidRequestBody" + } + } + } + }, + "responses": { + "201": { + "description": "Created response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionBidResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + }, + "501": { + "$ref": "#/components/responses/NotImplementedError" + } + } + } + }, + "/v1/chains/{chain_name}/orders/listings/{listing_id}": { + "get": { + "tags": [ + "orders" + ], + "summary": "Get a single listing by ID", + "description": "Get a single listing by ID", + "operationId": "GetListing", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "listing_id", + "in": "path", + "description": "Global Order identifier", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Global Order identifier", + "example": "018792C9-4AD7-8EC4-4038-9E05C598534A" + } + } + ], + "responses": { + "200": { + "description": "OK response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/orders/bids/{bid_id}": { + "get": { + "tags": [ + "orders" + ], + "summary": "Get a single bid by ID", + "description": "Get a single bid by ID", + "operationId": "GetBid", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "bid_id", + "in": "path", + "description": "Global Bid identifier", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Global Bid identifier", + "example": "018792C9-4AD7-8EC4-4038-9E05C598534A" + } + } + ], + "responses": { + "200": { + "description": "OK response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BidResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/orders/collection-bids/{collection_bid_id}": { + "get": { + "tags": [ + "orders" + ], + "summary": "Get a single collection bid by ID", + "description": "Get a single collection bid by ID", + "operationId": "GetCollectionBid", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "collection_bid_id", + "in": "path", + "description": "Global Collection Bid identifier", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Global Collection Bid identifier", + "example": "018792C9-4AD7-8EC4-4038-9E05C598534A" + } + } + ], + "responses": { + "200": { + "description": "OK response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionBidResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/orders/fulfillment-data": { + "post": { + "tags": [ + "orders" + ], + "summary": "Retrieve fulfillment data for orders", + "description": "Retrieve signed fulfillment data based on the list of order IDs and corresponding fees.", + "operationId": "fulfillment_data", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentDataRequest" + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "result": { + "type": "object", + "properties": { + "fulfillable_orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillableOrder" + } + }, + "unfulfillable_orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UnfulfillableOrder" + } + } + }, + "required": [ + "fulfillable_orders", + "unfulfillable_orders" + ] + } + }, + "required": [ + "result" + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/trades": { + "get": { + "tags": [ + "orders" + ], + "summary": "List all trades", + "description": "List all trades", + "operationId": "ListTrades", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "account_address", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "Account address to filter trades by (includes buy and sell wallet address)", + "example": "0x784578949A4A50DeA641Fb15dd2B11C72E76919a", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "sell_item_contract_address", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "Sell item contract address to filter by", + "example": "0x784578949A4A50DeA641Fb15dd2B11C72E76919a", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "from_indexed_at", + "in": "query", + "description": "From indexed at including given date", + "required": false, + "schema": { + "type": "string", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + } + }, + { + "name": "page_size", + "in": "query", + "description": "Maximum number of trades to return per page", + "schema": { + "$ref": "#/components/schemas/PageSize" + } + }, + { + "name": "sort_by", + "in": "query", + "description": "Trade field to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "indexed_at" + ], + "description": "Trade field to sort by", + "example": "indexed_at" + }, + "example": "indexed_at" + }, + { + "name": "sort_direction", + "in": "query", + "description": "Ascending or descending direction for sort", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "description": "Ascending or descending direction for sort", + "example": "asc" + }, + "example": "asc" + }, + { + "name": "page_cursor", + "in": "query", + "description": "Page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + } + ], + "responses": { + "200": { + "description": "OK response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTradeResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/trades/{trade_id}": { + "get": { + "tags": [ + "orders" + ], + "summary": "Get a single trade by ID", + "description": "Get a single trade by ID", + "operationId": "GetTrade", + "parameters": [ + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + }, + { + "name": "trade_id", + "in": "path", + "description": "Global Trade identifier", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "description": "Global Trade identifier", + "example": "018792C9-4AD7-8EC4-4038-9E05C598534A" + } + } + ], + "responses": { + "200": { + "description": "OK response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TradeResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/v1/chains/{chain_name}/passport/users/{user_id}/linked-addresses": { + "get": { + "deprecated": true, + "summary": "Get Ethereum linked addresses for a user", + "description": "This API has been deprecated, please use https://docs.immutable.com/zkevm/api/reference/#/operations/getUserInfo instead to get a list of linked addresses.", + "tags": [ + "passport" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The user's userId", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "chain_name", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + } + } + ], + "operationId": "getLinkedAddresses", + "security": [ + { + "BearerAuth": [ + "openid" + ] + } + ], + "responses": { + "200": { + "description": "User's list of linked addresses response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetLinkedAddressesRes" + } + } + } + }, + "400": { + "description": "BadRequestError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError400" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError401" + } + } + } + }, + "403": { + "description": "ForbiddenError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError403" + } + } + } + }, + "429": { + "description": "TooManyRequestsError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError429" + } + } + } + }, + "500": { + "description": "InternalServerError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError500" + } + } + } + }, + "default": { + "description": "unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BasicAPIError" + } + } + } + } + } + } + }, + "/passport-profile/v2/linked-wallets": { + "post": { + "tags": [ + "passport profile" + ], + "summary": "Link wallet v2", + "description": "Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature.", + "operationId": "link-wallet-v2", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LinkWalletV2Request" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Wallet" + } + } + } + }, + "400": { + "description": "BadRequestError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError400" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError401" + } + } + } + }, + "403": { + "description": "ForbiddenError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError403" + } + } + } + }, + "500": { + "description": "InternalServerError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError500" + } + } + } + } + }, + "security": [ + { + "BearerAuth": [ + "openid" + ] + } + ] + } + }, + "/passport-profile/v1/user/info": { + "get": { + "summary": "Get all info for a Passport user", + "description": "Get all the info for an authenticated Passport user", + "tags": [ + "passport profile" + ], + "operationId": "getUserInfo", + "security": [ + { + "BearerAuth": [ + "openid" + ] + } + ], + "responses": { + "200": { + "description": "Passport user's info", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserInfo" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError401" + } + } + } + }, + "500": { + "description": "InternalServerError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError500" + } + } + } + }, + "default": { + "description": "unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BasicAPIError" + } + } + } + } + } + } + }, + "/experimental/chains/{chain_name}/search/nfts": { + "get": { + "x-hide-from-sdk": true, + "tags": [ + "stacks" + ], + "operationId": "SearchNFTs", + "summary": "Experimental: Search NFTs", + "description": "![Experimental](https://img.shields.io/badge/status-experimental-yellow) Search NFTs", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "in": "path", + "required": true, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "contract_address", + "in": "query", + "required": true, + "description": "List of contract addresses to filter by", + "schema": { + "type": "array", + "items": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "maxItems": 20, + "minItems": 1 + } + }, + { + "name": "account_address", + "in": "query", + "required": false, + "description": "Account address to filter by", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + } + }, + { + "name": "stack_id", + "in": "query", + "required": false, + "description": "Filters NFTs that belong to any of these stacks", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid", + "example": "7053e765-c119-4efb-b5cf-405ccccaf6c4" + }, + "minItems": 1, + "maxItems": 20 + } + }, + { + "name": "only_include_owner_listings", + "in": "query", + "required": false, + "description": "Whether the listings should include only the owner created listings", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "page_size", + "in": "query", + "required": false, + "description": "Number of results to return per page", + "schema": { + "$ref": "#/components/schemas/PageSize" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchNFTsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/experimental/chains/{chain_name}/search/stacks": { + "get": { + "x-hide-from-sdk": true, + "tags": [ + "stacks" + ], + "operationId": "SearchStacks", + "summary": "Experimental: Search NFT stacks", + "description": "![Experimental](https://img.shields.io/badge/status-experimental-yellow) Search NFT stacks", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "in": "path", + "required": true, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "contract_address", + "in": "query", + "required": true, + "description": "List of contract addresses to filter by", + "schema": { + "type": "array", + "items": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "maxItems": 20, + "minItems": 1 + } + }, + { + "name": "account_address", + "in": "query", + "required": false, + "description": "Account address to filter by", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + } + }, + { + "name": "only_include_owner_listings", + "in": "query", + "required": false, + "description": "Whether to the listings should include only the owner created listings", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "only_if_has_active_listings", + "in": "query", + "required": false, + "description": "Filters results to include only stacks that have a current active listing. False and 'null' return all unfiltered stacks.", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "trait", + "in": "query", + "required": false, + "description": "JSON encoded traits to filter by. e.g. encodeURIComponent(JSON.stringify({\"rarity\": {\"values\": [\"common\", \"rare\"], \"condition\": \"eq\"}}))", + "schema": { + "type": "string" + } + }, + { + "name": "keyword", + "in": "query", + "required": false, + "description": "Keyword to search NFT name and description. Alphanumeric characters only.", + "schema": { + "type": "string", + "example": "sword" + } + }, + { + "name": "sort_by", + "in": "query", + "required": false, + "description": "Sort results in a specific order", + "schema": { + "type": "string", + "nullable": false, + "enum": [ + "cheapest_first" + ] + } + }, + { + "name": "page_size", + "in": "query", + "required": false, + "description": "Number of results to return per page", + "schema": { + "$ref": "#/components/schemas/PageSize" + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchStacksResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/experimental/chains/{chain_name}/stacks": { + "get": { + "x-hide-from-sdk": true, + "tags": [ + "stacks" + ], + "operationId": "ListStacks", + "summary": "Experimental: List NFT stacks by stack_id", + "description": "![Experimental](https://img.shields.io/badge/status-experimental-yellow) NFT stacks", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "in": "path", + "required": true, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "stack_id", + "in": "query", + "required": true, + "description": "List of stack_id to filter by", + "schema": { + "type": "array", + "items": { + "format": "uuid", + "type": "string", + "example": "7053e765-c119-4efb-b5cf-405ccccaf6c4" + }, + "maxItems": 20, + "minItems": 1 + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "List of stack bundles", + "items": { + "$ref": "#/components/schemas/StackBundle" + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/experimental/chains/{chain_name}/quotes/{contract_address}/stacks": { + "get": { + "x-hide-from-sdk": true, + "tags": [ + "pricing" + ], + "operationId": "QuotesForStacks", + "summary": "Experimental: Get pricing data for a list of stack ids", + "description": "![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get pricing data for a list of stack ids", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "in": "path", + "required": true, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "contract_address", + "in": "path", + "required": true, + "description": "Contract address for collection that these stacks are on", + "schema": { + "pattern": "^0x[a-fA-F0-9]{40}$", + "type": "string" + } + }, + { + "name": "stack_id", + "in": "query", + "required": true, + "description": "List of stack ids to get pricing data for", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid", + "example": "7053e765-c119-4efb-b5cf-405ccccaf6c4" + }, + "minItems": 1, + "maxItems": 20 + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuotesForStacksResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + }, + "/experimental/chains/{chain_name}/quotes/{contract_address}/nfts": { + "get": { + "x-hide-from-sdk": true, + "tags": [ + "pricing" + ], + "operationId": "QuotesForNFTs", + "summary": "Experimental: Get pricing data for a list of token ids", + "description": "![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get pricing data for a list of token ids", + "parameters": [ + { + "name": "chain_name", + "description": "The name of chain", + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "in": "path", + "required": true, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + { + "name": "contract_address", + "in": "path", + "required": true, + "description": "Contract address for collection that these token ids are on", + "schema": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + { + "name": "token_id", + "in": "query", + "required": true, + "description": "List of token ids to get pricing data for", + "schema": { + "type": "array", + "items": { + "type": "string", + "example": "1337" + }, + "minItems": 1, + "maxItems": 20 + } + }, + { + "name": "page_cursor", + "in": "query", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "required": false, + "schema": { + "$ref": "#/components/schemas/PageCursor" + } + } + ], + "responses": { + "200": { + "description": "200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuotesForNFTsResult" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/UnauthorisedRequest" + }, + "403": { + "$ref": "#/components/responses/ForbiddenRequest" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + } + } + } + } + }, + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + }, + "ImmutableApiKey": { + "x-go-name": "ImmutableApiKey", + "type": "apiKey", + "in": "header", + "name": "x-immutable-api-key" + } + }, + "parameters": { + "ChainName": { + "name": "chain_name", + "description": "The name of chain", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChainName" + }, + "examples": { + "testnet": { + "value": "imtbl-zkevm-testnet", + "summary": "Immutable zkEVM Public Testnet" + } + } + }, + "ContractAddress": { + "name": "contract_address", + "in": "path", + "required": true, + "description": "Contract address", + "schema": { + "$ref": "#/components/schemas/Address" + } + } + }, + "responses": { + "NotFound": { + "description": "The specified resource was not found (404)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError404" + } + } + } + }, + "BadRequest": { + "description": "Bad Request (400)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError400" + } + } + } + }, + "UnauthorisedRequest": { + "description": "Unauthorised Request (401)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError401" + } + } + } + }, + "ForbiddenRequest": { + "description": "Forbidden Request (403)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError403" + } + } + } + }, + "Conflict": { + "description": "Conflict (409)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError409" + } + } + } + }, + "TooManyRequests": { + "description": "Too Many Requests (429)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError429" + } + } + }, + "headers": { + "Retry-After": { + "$ref": "#/components/headers/RetryAfter" + } + } + }, + "TooManyMetadataRefreshes": { + "description": "Too Many Metadata refreshes (429)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError429" + } + } + }, + "headers": { + "imx-refreshes-limit": { + "$ref": "#/components/headers/MetadataRefreshLimit" + }, + "imx-refresh-limit-reset": { + "$ref": "#/components/headers/MetadataRefreshLimitReset" + }, + "imx-remaining-refreshes": { + "$ref": "#/components/headers/MetadataRefreshLimitRemaining" + }, + "Retry-After": { + "$ref": "#/components/headers/MetadataRefreshRetryAfter" + } + } + }, + "TooManyMintRequests": { + "description": "Too Many mint requests (429)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError429" + } + } + }, + "headers": { + "imx-mint-requests-limit": { + "$ref": "#/components/headers/MintRequestsLimit" + }, + "imx-mint-requests-limit-reset": { + "$ref": "#/components/headers/MintRequestsLimitReset" + }, + "imx-remaining-mint-requests": { + "$ref": "#/components/headers/MintRequestsLimitRemaining" + }, + "imx-mint-requests-retry-after": { + "$ref": "#/components/headers/MintRequestsRetryAfter" + }, + "Retry-After": { + "$ref": "#/components/headers/MintRequestsRetryAfter" + } + } + }, + "InternalServerError": { + "description": "Internal Server Error (500)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError500" + } + } + } + }, + "NotImplementedError": { + "description": "Not Implemented Error (501)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError501" + } + } + } + } + }, + "headers": { + "MetadataRefreshLimit": { + "description": "The refresh request limit available to the project for each one-hour window.", + "schema": { + "type": "string" + } + }, + "MetadataRefreshLimitReset": { + "description": "The expiry date of the current one-hour window.", + "schema": { + "type": "string" + } + }, + "MetadataRefreshLimitRemaining": { + "description": "The number of refresh requests remaining in the current window.", + "schema": { + "type": "string" + } + }, + "MetadataRefreshRetryAfter": { + "description": "The number of seconds until the next refresh request can be made.", + "schema": { + "type": "string" + } + }, + "RetryAfter": { + "description": "The number of seconds until the next request can be made.", + "schema": { + "type": "string" + } + }, + "MintRequestsLimit": { + "description": "The mint requests limit available to the project for each time window.", + "schema": { + "type": "string" + } + }, + "MintRequestsLimitReset": { + "description": "The expiry date of the current time window.", + "schema": { + "type": "string" + } + }, + "MintRequestsLimitRemaining": { + "description": "The number of mint requests remaining in the current window.", + "schema": { + "type": "string" + } + }, + "MintRequestsRetryAfter": { + "description": "The number of seconds until the next refresh request can be made.", + "schema": { + "type": "string" + } + } + }, + "schemas": { + "PageSize": { + "type": "integer", + "format": "int32", + "description": "Maximum number of items to return", + "minimum": 1, + "default": 100, + "maximum": 200, + "example": 10 + }, + "PageCursor": { + "type": "string", + "description": "Encoded page cursor to retrieve previous or next page. Use the value returned in the response.", + "example": "ewogICJ0eXBlIjogInByZXYiLAogICJpdGVtIjogewogICAgImlkIjogNjI3NTEzMCwKICAgICJjcmVhdGVkX2F0IjogIjIwMjItMDktMTNUMTc6MDQ6MTIuMDI0MTI2WiIKICB9Cn0=" + }, + "Page": { + "type": "object", + "description": "Pagination properties", + "properties": { + "previous_cursor": { + "type": "string", + "nullable": true, + "description": "First item as an encoded string", + "example": "ewogICJ0eXBlIjogInByZXYiLAogICJpdGVtIjogewogICAgImlkIjogNjI3NTEzMCwKICAgICJjcmVhdGVkX2F0IjogIjIwMjItMDktMTNUMTc6MDQ6MTIuMDI0MTI2WiIKICB9Cn0=" + }, + "next_cursor": { + "type": "string", + "nullable": true, + "description": "Last item as an encoded string", + "example": "ewogICJ0eXBlIjogInByZXYiLAogICJpdGVtIjogewogICAgImlkIjogNjI3NTEzMCwKICAgICJjcmVhdGVkX2F0IjogIjIwMjItMDktMTNUMTc6MDQ6MTIuMDI0MTI2WiIKICB9Cn0=" + } + }, + "required": [ + "previous_cursor", + "next_cursor" + ] + }, + "ActivityType": { + "description": "The activity type", + "example": "mint", + "type": "string", + "enum": [ + "mint", + "burn", + "transfer", + "sale", + "deposit", + "withdrawal" + ] + }, + "ActivityNFT": { + "type": "object", + "properties": { + "contract_type": { + "$ref": "#/components/schemas/NFTContractType" + }, + "contract_address": { + "description": "The token contract address", + "type": "string", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + "token_id": { + "description": "An `uint256` token id as string", + "type": "string", + "example": "1" + }, + "amount": { + "description": "(deprecated - will never be filled, use amount on Activity instead) The amount of tokens exchanged", + "type": "string", + "example": "1", + "deprecated": true + } + }, + "required": [ + "contract_type", + "contract_address", + "token_id", + "amount" + ] + }, + "ActivityToken": { + "type": "object", + "properties": { + "contract_type": { + "$ref": "#/components/schemas/TokenContractType" + }, + "contract_address": { + "description": "The contract address", + "type": "string", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + } + }, + "required": [ + "contract_type", + "contract_address" + ] + }, + "ActivityAsset": { + "description": "The contract and asset details for this activity", + "oneOf": [ + { + "$ref": "#/components/schemas/ActivityNFT" + }, + { + "$ref": "#/components/schemas/ActivityToken" + } + ], + "discriminator": { + "propertyName": "contract_type" + } + }, + "Address": { + "x-go-type": "common.Address", + "x-go-type-import": { + "path": "github.com/ethereum/go-ethereum/common", + "name": "common" + }, + "description": "An Ethereum address", + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "Mint": { + "type": "object", + "description": "The mint activity details", + "properties": { + "to": { + "description": "The account address the asset was minted to", + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "amount": { + "description": "The minted amount", + "type": "string", + "example": "1" + }, + "asset": { + "$ref": "#/components/schemas/ActivityAsset" + } + }, + "required": [ + "to", + "amount", + "asset" + ] + }, + "Deposit": { + "type": "object", + "description": "The deposit activity details", + "properties": { + "to": { + "description": "The account address the asset was deposited to", + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "amount": { + "description": "The deposited amount", + "type": "string", + "example": "1" + }, + "asset": { + "$ref": "#/components/schemas/ActivityAsset" + } + }, + "required": [ + "to", + "amount", + "asset" + ] + }, + "Burn": { + "description": "The burn activity details", + "type": "object", + "properties": { + "from": { + "description": "The account address the asset was transferred from", + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "amount": { + "description": "The amount of assets burnt", + "type": "string", + "example": "1" + }, + "asset": { + "$ref": "#/components/schemas/ActivityAsset" + } + }, + "required": [ + "from", + "amount", + "asset" + ] + }, + "Withdrawal": { + "description": "The withdrawal activity details", + "type": "object", + "properties": { + "from": { + "description": "The account address the asset was withdrawn from", + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "amount": { + "description": "The amount of assets withdrawn", + "type": "string", + "example": "1" + }, + "asset": { + "$ref": "#/components/schemas/ActivityAsset" + } + }, + "required": [ + "from", + "amount", + "asset" + ] + }, + "Transfer": { + "type": "object", + "description": "The transfer activity details", + "properties": { + "from": { + "description": "The account address the asset was transferred from", + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "to": { + "description": "The account address the asset was transferred to", + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "amount": { + "description": "The amount of assets transferred", + "type": "string", + "example": "1" + }, + "asset": { + "$ref": "#/components/schemas/ActivityAsset" + } + }, + "required": [ + "activity_type", + "from", + "to", + "amount", + "asset" + ] + }, + "ActivityNativeToken": { + "type": "object", + "properties": { + "symbol": { + "description": "The token symbol", + "type": "string", + "example": "ETH" + } + }, + "required": [ + "symbol" + ] + }, + "SalePayment": { + "type": "object", + "properties": { + "token": { + "description": "The type of payment token", + "oneOf": [ + { + "$ref": "#/components/schemas/ActivityToken" + }, + { + "$ref": "#/components/schemas/ActivityNativeToken" + } + ] + }, + "price_excluding_fees": { + "description": "The base price of the sale not including any fees", + "type": "string", + "example": "180" + }, + "price_including_fees": { + "description": "The total price of the sale. Includes the sum of all fees", + "type": "string", + "example": "200" + }, + "fees": { + "description": "The fees associated with this sale", + "type": "array", + "items": { + "$ref": "#/components/schemas/SaleFee" + }, + "example": [ + { + "address": "0xB0F3749458169B7Ad51B5503CC3649DE55c2D0D2", + "amount": "20", + "type": "ROYALTY" + } + ], + "minItems": 0 + } + }, + "required": [ + "token", + "price_excluding_fees", + "price_including_fees", + "fees" + ] + }, + "SaleFee": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "description": "Fee payable to recipient upon settlement", + "example": "200" + }, + "type": { + "type": "string", + "description": "Fee type", + "example": "ROYALTY", + "enum": [ + "ROYALTY" + ] + }, + "recipient": { + "type": "string", + "description": "Wallet address of fee recipient", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233" + } + } + }, + "NFTSale": { + "description": "The NFT Sale activity details", + "type": "object", + "properties": { + "order_id": { + "description": "The id of order", + "type": "string", + "example": "ARZ3NDEKTSV4RRFFQ69G5FAV" + }, + "to": { + "description": "The account address of buyer", + "type": "string", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "from": { + "description": "The account address of seller", + "type": "string", + "example": "0xbD6cFcf93474De653d7B42b346c7c25d1F9c559C" + }, + "asset": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityNFT" + } + }, + "payment": { + "$ref": "#/components/schemas/SalePayment" + } + }, + "required": [ + "order_id", + "to", + "from", + "asset", + "payment" + ] + }, + "ActivityDetails": { + "description": "The activity details", + "oneOf": [ + { + "$ref": "#/components/schemas/Mint" + }, + { + "$ref": "#/components/schemas/Burn" + }, + { + "$ref": "#/components/schemas/Transfer" + }, + { + "$ref": "#/components/schemas/NFTSale" + }, + { + "$ref": "#/components/schemas/Deposit" + }, + { + "$ref": "#/components/schemas/Withdrawal" + } + ] + }, + "BlockchainMetadata": { + "description": "The metadata related to blockchain transaction", + "nullable": true, + "type": "object", + "properties": { + "transaction_hash": { + "type": "string", + "description": "The transaction hash of the activity", + "example": "0x68d9eac5e3b3c3580404989a4030c948a78e1b07b2b5ea5688d8c38a6c61c93e" + }, + "block_number": { + "description": "EVM block number (uint64 as string)", + "type": "string", + "example": "1" + }, + "transaction_index": { + "description": "Transaction index in a block (uint32 as string)", + "type": "string", + "example": "1" + }, + "log_index": { + "description": "The log index of activity in a block (uint32 as string)", + "type": "string", + "nullable": true, + "example": "1" + } + }, + "required": [ + "transaction_hash", + "block_number", + "transaction_index", + "log_index" + ] + }, + "Activity": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/ActivityID" + }, + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "type": { + "$ref": "#/components/schemas/ActivityType" + }, + "details": { + "$ref": "#/components/schemas/ActivityDetails" + }, + "updated_at": { + "type": "string", + "description": "The time activity was updated at", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z" + }, + "indexed_at": { + "type": "string", + "description": "The time activity was indexed", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z" + }, + "blockchain_metadata": { + "$ref": "#/components/schemas/BlockchainMetadata" + } + }, + "required": [ + "id", + "chain", + "type", + "details", + "indexed_at", + "updated_at", + "blockchain_metadata" + ] + }, + "ListActivitiesResult": { + "type": "object", + "description": "List activities response", + "properties": { + "result": { + "type": "array", + "description": "List of activities", + "items": { + "$ref": "#/components/schemas/Activity" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "GetActivityResult": { + "type": "object", + "description": "Single activity", + "properties": { + "result": { + "$ref": "#/components/schemas/Activity" + } + }, + "required": [ + "result" + ] + }, + "Collection": { + "type": "object", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "name": { + "type": "string", + "nullable": true, + "description": "The name of the collection", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + "symbol": { + "type": "string", + "nullable": true, + "description": "The symbol of contract", + "example": "BASP" + }, + "contract_type": { + "$ref": "#/components/schemas/CollectionContractType" + }, + "contract_address": { + "type": "string", + "description": "The address of the contract", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + "description": { + "type": "string", + "nullable": true, + "description": "The description of collection", + "example": "Some description" + }, + "image": { + "type": "string", + "description": "The url of the collection image", + "example": "https://some-url", + "nullable": true + }, + "external_link": { + "type": "string", + "description": "The url of external link", + "example": "https://some-url", + "nullable": true + }, + "contract_uri": { + "type": "string", + "description": "The uri for the metadata of the collection", + "example": "https://some-url", + "nullable": true + }, + "base_uri": { + "type": "string", + "nullable": true, + "description": "The metadata uri for nft", + "example": "https://some-url" + }, + "verification_status": { + "$ref": "#/components/schemas/AssetVerificationStatus" + }, + "indexed_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the collection was first indexed" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the collection was last updated" + }, + "metadata_synced_at": { + "type": "string", + "format": "date-time", + "nullable": true, + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the collection metadata was last synced" + } + }, + "required": [ + "chain", + "name", + "symbol", + "contract_type", + "contract_address", + "description", + "image", + "external_link", + "base_uri", + "metadata_uri", + "indexed_at", + "updated_at", + "metadata_synced_at", + "verification_status" + ] + }, + "ListCollectionsResult": { + "type": "object", + "properties": { + "result": { + "description": "List of collections", + "type": "array", + "items": { + "$ref": "#/components/schemas/Collection" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "GetCollectionResult": { + "type": "object", + "description": "Single Collection", + "properties": { + "result": { + "$ref": "#/components/schemas/Collection" + } + }, + "required": [ + "result" + ] + }, + "GetMetadataResult": { + "type": "object", + "description": "Single metadata", + "properties": { + "result": { + "$ref": "#/components/schemas/Metadata" + } + }, + "required": [ + "result" + ] + }, + "ListMetadataResult": { + "type": "object", + "properties": { + "result": { + "description": "List of metadata", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "Metadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/MetadataID" + }, + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "contract_address": { + "type": "string", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e", + "description": "The contract address of the metadata" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the metadata was created" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "nullable": true, + "description": "When the metadata was last updated", + "example": "2022-08-16T17:43:26.991388Z" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Sword", + "description": "The name of the NFT" + }, + "description": { + "type": "string", + "nullable": true, + "example": "2022-08-16T17:43:26.991388Z", + "description": "The description of the NFT" + }, + "image": { + "type": "string", + "nullable": true, + "description": "The image url of the NFT", + "example": "https://some-url" + }, + "external_url": { + "type": "string", + "nullable": true, + "description": "The external website link of NFT", + "example": "https://some-url" + }, + "animation_url": { + "type": "string", + "nullable": true, + "description": "The animation url of the NFT", + "example": "https://some-url" + }, + "youtube_url": { + "type": "string", + "nullable": true, + "description": "The youtube URL of NFT", + "example": "https://some-url" + }, + "attributes": { + "type": "array", + "description": "List of Metadata attributes", + "nullable": true, + "items": { + "$ref": "#/components/schemas/NFTMetadataAttribute" + } + } + }, + "required": [ + "id", + "chain", + "contract_address", + "created_at", + "updated_at", + "name", + "description", + "image", + "external_link", + "animation_url", + "youtube_url", + "attributes" + ] + }, + "RefreshMetadataByIDRequest": { + "type": "object", + "description": "Request body for refreshing metadata by id. Total size of this list should not exceed 228 KiB", + "properties": { + "metadata": { + "type": "array", + "maxItems": 10, + "minItems": 1, + "items": { + "$ref": "#/components/schemas/RefreshMetadataByID" + } + } + }, + "required": [ + "metadata" + ] + }, + "NFT": { + "type": "object", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "token_id": { + "type": "string", + "example": "1", + "description": "An `uint256` token id as string" + }, + "contract_address": { + "type": "string", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e", + "description": "The contract address of the NFT" + }, + "contract_type": { + "$ref": "#/components/schemas/NFTContractType" + }, + "indexed_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the NFT was first indexed" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the NFT owner was last updated" + }, + "metadata_synced_at": { + "type": "string", + "format": "date-time", + "nullable": true, + "description": "When NFT metadata was last synced", + "example": "2022-08-16T17:43:26.991388Z" + }, + "metadata_id": { + "type": "string", + "format": "uuid", + "nullable": true, + "description": "The id of the metadata of this NFT", + "example": "ae83bc80-4dd5-11ee-be56-0242ac120002" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Sword", + "description": "The name of the NFT" + }, + "description": { + "type": "string", + "nullable": true, + "example": "2022-08-16T17:43:26.991388Z", + "description": "The description of the NFT" + }, + "image": { + "type": "string", + "nullable": true, + "description": "The image url of the NFT", + "example": "https://some-url" + }, + "external_link": { + "deprecated": true, + "type": "string", + "nullable": true, + "description": "(deprecated - use external_url instead) The external website link of NFT", + "example": "https://some-url" + }, + "external_url": { + "type": "string", + "nullable": true, + "description": "The external website link of NFT", + "example": "https://some-url" + }, + "animation_url": { + "type": "string", + "nullable": true, + "description": "The animation url of the NFT", + "example": "https://some-url" + }, + "youtube_url": { + "type": "string", + "nullable": true, + "description": "The youtube URL of NFT", + "example": "https://some-url" + }, + "attributes": { + "type": "array", + "description": "List of NFT Metadata attributes", + "items": { + "$ref": "#/components/schemas/NFTMetadataAttribute" + } + }, + "total_supply": { + "type": "string", + "nullable": true, + "description": "The total supply of NFT", + "example": "100" + } + }, + "required": [ + "chain", + "token_id", + "contract_address", + "indexed_at", + "updated_at", + "metadata_synced_at", + "name", + "description", + "image", + "external_link", + "external_url", + "animation_url", + "youtube_url", + "attributes", + "contract_type" + ] + }, + "NFTWithBalance": { + "type": "object", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "token_id": { + "type": "string", + "example": "1", + "description": "An `uint256` token id as string" + }, + "contract_address": { + "type": "string", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e", + "description": "The contract address of the NFT" + }, + "contract_type": { + "$ref": "#/components/schemas/NFTContractType" + }, + "indexed_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the NFT was first indexed" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the NFT owner was last updated" + }, + "metadata_synced_at": { + "type": "string", + "format": "date-time", + "nullable": true, + "description": "When NFT metadata was last synced", + "example": "2022-08-16T17:43:26.991388Z" + }, + "metadata_id": { + "type": "string", + "format": "uuid", + "nullable": true, + "description": "The id of the metadata of this NFT", + "example": "ae83bc80-4dd5-11ee-be56-0242ac120002" + }, + "name": { + "type": "string", + "nullable": true, + "description": "The name of the NFT", + "example": "Sword" + }, + "description": { + "type": "string", + "nullable": true, + "description": "The description of the NFT", + "example": "This is a super awesome sword" + }, + "image": { + "type": "string", + "nullable": true, + "description": "The image url of the NFT", + "example": "https://some-url" + }, + "external_link": { + "type": "string", + "nullable": true, + "description": "The external website link of NFT", + "example": "https://some-url" + }, + "animation_url": { + "type": "string", + "nullable": true, + "description": "The animation url of the NFT", + "example": "https://some-url" + }, + "youtube_url": { + "type": "string", + "nullable": true, + "description": "The youtube URL of NFT", + "example": "https://some-url" + }, + "attributes": { + "type": "array", + "description": "List of Metadata attributes", + "nullable": false, + "items": { + "$ref": "#/components/schemas/NFTMetadataAttribute" + } + }, + "balance": { + "type": "string", + "nullable": false, + "description": "The amount of this NFT this account owns", + "example": "11" + } + }, + "required": [ + "chain", + "token_id", + "contract_address", + "indexed_at", + "updated_at", + "metadata_synced_at", + "name", + "description", + "image", + "external_link", + "animation_url", + "youtube_url", + "balance", + "contract_type", + "attributes" + ] + }, + "NFTMetadataAttribute": { + "type": "object", + "properties": { + "display_type": { + "description": "Display type for this attribute", + "type": "string", + "nullable": true, + "enum": [ + "number", + "boost_percentage", + "boost_number", + "date" + ], + "example": "number" + }, + "trait_type": { + "description": "The metadata trait type", + "type": "string", + "example": "Aqua Power" + }, + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ], + "description": "The metadata trait value", + "example": "Happy" + } + }, + "required": [ + "trait_type", + "value" + ] + }, + "ChainName": { + "type": "string", + "description": "The name of chain", + "example": "imtbl-zkevm-testnet" + }, + "ActivityID": { + "description": "Activity id in UUIDv4 format", + "type": "string", + "format": "uuid", + "example": "4e28df8d-f65c-4c11-ba04-6a9dd47b179b" + }, + "MetadataID": { + "description": "Metadata id in UUIDv4 format", + "type": "string", + "format": "uuid", + "example": "4e28df8d-f65c-4c11-ba04-6a9dd47b179b" + }, + "CollectionContractType": { + "description": "The collection contract type", + "type": "string", + "enum": [ + "ERC721", + "ERC1155" + ] + }, + "NFTContractType": { + "description": "The contract type for an NFT", + "type": "string", + "enum": [ + "ERC721", + "ERC1155" + ] + }, + "TokenContractType": { + "description": "The contract type for a token", + "type": "string", + "enum": [ + "ERC20" + ] + }, + "AssetVerificationStatus": { + "description": "The verification status for a given contract", + "type": "string", + "enum": [ + "verified", + "unverified", + "spam", + "inactive" + ] + }, + "VerificationRequestStatus": { + "description": "The status of the verification request", + "type": "string", + "enum": [ + "completed", + "pending" + ] + }, + "GetNFTResult": { + "type": "object", + "description": "Single NFT", + "properties": { + "result": { + "$ref": "#/components/schemas/NFT" + } + }, + "required": [ + "result" + ] + }, + "ListNFTsResult": { + "type": "object", + "properties": { + "result": { + "description": "List of NFTs", + "type": "array", + "items": { + "$ref": "#/components/schemas/NFT" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "ListNFTsByOwnerResult": { + "type": "object", + "properties": { + "result": { + "description": "List of NFTs by owner", + "type": "array", + "items": { + "$ref": "#/components/schemas/NFTWithBalance" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "NFTOwner": { + "type": "object", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "contract_address": { + "type": "string", + "description": "The address of NFT contract", + "example": "0x5a019874f4fae314b0eaa4606be746366e661306" + }, + "token_id": { + "type": "string", + "description": "An `uint256` token id as string", + "example": "1" + }, + "account_address": { + "type": "string", + "description": "The account address of the owner of the NFT", + "example": "0x5a019874f4fae314b0eaa4606be746366e661306" + }, + "balance": { + "type": "string", + "description": "The amount of owned tokens (uint256 as string)", + "example": "1" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the NFT owner was last updated" + } + }, + "required": [ + "chain", + "contract_address", + "token_id", + "account_address", + "balance" + ] + }, + "NFTWithOwner": { + "type": "object", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "contract_address": { + "type": "string", + "description": "The address of NFT contract", + "example": "0x5a019874f4fae314b0eaa4606be746366e661306" + }, + "token_id": { + "type": "string", + "description": "An `uint256` token id as string", + "example": "1" + }, + "account_address": { + "type": "string", + "description": "The account address of the owner of the NFT", + "example": "0x5a019874f4fae314b0eaa4606be746366e661306" + }, + "balance": { + "type": "string", + "description": "The amount of owned tokens (uint256 as string)", + "example": "1" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the owner last changed for the given NFT" + } + }, + "required": [ + "chain", + "contract_address", + "token_id", + "account_address", + "balance", + "updated_at" + ] + }, + "GetTokenResult": { + "type": "object", + "description": "Single Token", + "properties": { + "result": { + "$ref": "#/components/schemas/Token" + } + }, + "required": [ + "result" + ] + }, + "ListNFTOwnersResult": { + "type": "object", + "properties": { + "result": { + "description": "List of nft owners", + "type": "array", + "items": { + "$ref": "#/components/schemas/NFTOwner" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "ListCollectionOwnersResult": { + "type": "object", + "properties": { + "result": { + "description": "List of NFT owners", + "type": "array", + "items": { + "$ref": "#/components/schemas/NFTWithOwner" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "ChainWithDetails": { + "allOf": [ + { + "$ref": "#/components/schemas/Chain" + }, + { + "type": "object", + "properties": { + "rpc_url": { + "type": "string", + "nullable": true, + "description": "URL for RPC node" + } + }, + "required": [ + "rpc_url" + ] + } + ] + }, + "Chain": { + "type": "object", + "description": "The chain details", + "properties": { + "id": { + "type": "string", + "description": "The id of chain", + "example": "eip155:13372" + }, + "name": { + "type": "string", + "description": "The name of chain", + "example": "imtbl-zkevm-testnet" + } + }, + "required": [ + "id", + "name" + ] + }, + "ListChainsResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "description": "List of chains", + "items": { + "$ref": "#/components/schemas/ChainWithDetails" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "ListTokensResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "description": "List of tokens", + "items": { + "$ref": "#/components/schemas/Token" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "RefreshMetadataByID": { + "allOf": [ + { + "$ref": "#/components/schemas/RefreshableNFTAttributes" + }, + { + "type": "object", + "properties": { + "metadata_id": { + "$ref": "#/components/schemas/MetadataID" + } + }, + "required": [ + "metadata_id" + ] + } + ] + }, + "RefreshMetadataByTokenID": { + "allOf": [ + { + "$ref": "#/components/schemas/RefreshableNFTAttributes" + }, + { + "type": "object", + "properties": { + "token_id": { + "type": "string", + "description": "An `uint256` token id as string", + "example": "1" + } + }, + "required": [ + "token_id" + ] + } + ] + }, + "RefreshableNFTAttributes": { + "allOf": [ + { + "$ref": "#/components/schemas/NFTMetadataRequest" + } + ], + "required": [ + "name", + "description", + "image", + "external_url", + "animation_url", + "youtube_url", + "attributes" + ] + }, + "NFTMetadataRequest": { + "type": "object", + "description": "The NFT metadata. Total size of this object should not exceed 16 KiB", + "properties": { + "name": { + "type": "string", + "nullable": true, + "example": "Sword", + "description": "The name of the NFT" + }, + "description": { + "type": "string", + "nullable": true, + "example": "2022-08-16T17:43:26.991388Z", + "description": "The description of the NFT" + }, + "image": { + "type": "string", + "nullable": true, + "description": "The image url of the NFT", + "example": "https://some-url" + }, + "external_url": { + "type": "string", + "nullable": true, + "description": "The external link of the NFT", + "example": "https://some-url" + }, + "animation_url": { + "type": "string", + "nullable": true, + "description": "The animation url of the NFT", + "example": "https://some-url" + }, + "youtube_url": { + "type": "string", + "nullable": true, + "description": "The youtube link of the NFT", + "example": "https://some-url" + }, + "attributes": { + "type": "array", + "description": "List of Metadata attributes", + "nullable": true, + "items": { + "$ref": "#/components/schemas/NFTMetadataAttribute" + } + } + } + }, + "RefreshNFTMetadataByTokenIDRequest": { + "type": "object", + "properties": { + "nft_metadata": { + "type": "array", + "description": "List of nft metadata to be refreshed. Total size of the list should not exceed 228 KiB", + "maxItems": 250, + "minItems": 1, + "items": { + "$ref": "#/components/schemas/RefreshMetadataByTokenID" + } + } + }, + "required": [ + "nft_metadata" + ] + }, + "Token": { + "type": "object", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "contract_address": { + "type": "string", + "description": "The address of token contract", + "example": "0xc344c05eef8876e517072f879dae8905aa2b956b" + }, + "root_contract_address": { + "type": "string", + "description": "The address of root token contract", + "example": "0x43e60b30d5bec48c0f5890e3d1e9f1b1296bb4aa", + "nullable": true + }, + "root_chain_id": { + "type": "string", + "description": "The id of the root chain for a bridged token", + "example": "eip155:1", + "nullable": true + }, + "bridge_used": { + "type": "string", + "description": "The name of the bridge, for bridged tokens only", + "example": "axelar", + "nullable": true + }, + "symbol": { + "type": "string", + "description": "The symbol of token", + "example": "AAA", + "nullable": true + }, + "decimals": { + "type": "integer", + "description": "The decimals of token", + "example": 18, + "nullable": true + }, + "image_url": { + "type": "string", + "description": "The image url of token", + "example": "https://some-url", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of token", + "example": "Token A", + "nullable": true + }, + "verification_status": { + "$ref": "#/components/schemas/AssetVerificationStatus" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the collection was last updated" + }, + "is_canonical": { + "type": "boolean", + "example": true, + "description": "Indicates whether the token is canonical or not" + } + }, + "required": [ + "chain", + "contract_address", + "root_contract_address", + "symbol", + "decimals", + "image_url", + "name", + "updated_at", + "verification_status", + "is_canonical" + ] + }, + "CollectionMetadata": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "description": "The name of the collection", + "example": "Gigantic Lizards" + }, + "symbol": { + "type": "string", + "nullable": true, + "description": "The symbol of contract", + "example": "GLZ" + }, + "description": { + "type": "string", + "nullable": true, + "description": "The description of collection", + "example": "This is the Gigantic Lizards collection" + }, + "image": { + "type": "string", + "description": "The url of the collection image", + "example": "https://some-url", + "nullable": true + }, + "external_link": { + "type": "string", + "description": "The url of external link", + "example": "https://some-url", + "nullable": true + }, + "contract_uri": { + "type": "string", + "description": "The uri for the metadata of the collection", + "example": "https://some-url", + "nullable": true + }, + "base_uri": { + "type": "string", + "nullable": true, + "description": "The metadata uri for nft", + "example": "https://some-url" + } + }, + "required": [ + "name", + "image", + "symbol", + "description", + "base_uri", + "external_link", + "contract_uri" + ] + }, + "RefreshCollectionMetadataRequest": { + "type": "object", + "properties": { + "collection_metadata": { + "$ref": "#/components/schemas/CollectionMetadata" + } + }, + "required": [ + "collection_metadata" + ] + }, + "RefreshCollectionMetadataResult": { + "type": "object", + "properties": { + "contract_address": { + "type": "string" + }, + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "collection_metadata": { + "$ref": "#/components/schemas/CollectionMetadata" + } + }, + "required": [ + "contract_address", + "chain", + "collection_metadata" + ] + }, + "MetadataRefreshRateLimitResult": { + "type": "object", + "properties": { + "imx_refreshes_limit": { + "type": "string" + }, + "imx_refresh_limit_reset": { + "type": "string" + }, + "imx_remaining_refreshes": { + "type": "string" + }, + "retry_after": { + "type": "string" + } + }, + "required": [ + "imx_refreshes_limit", + "imx_refresh_limit_reset", + "imx_remaining_refreshes", + "retry_after" + ] + }, + "CreateMintRequestRequest": { + "type": "object", + "properties": { + "assets": { + "type": "array", + "maxItems": 100, + "minItems": 1, + "description": "List of nft to be minted", + "items": { + "$ref": "#/components/schemas/MintAsset" + } + } + }, + "required": [ + "assets" + ] + }, + "VerificationRequestInternal": { + "description": "The verification request (internal)", + "allOf": [ + { + "$ref": "#/components/schemas/VerificationRequest" + }, + { + "type": "object", + "properties": { + "org_tier": { + "$ref": "#/components/schemas/OrganisationTier" + } + }, + "required": [ + "org_tier" + ] + } + ] + }, + "VerificationRequest": { + "description": "The verification request", + "type": "object", + "properties": { + "id": { + "description": "The id of the verification request", + "type": "string", + "format": "uuid", + "example": "4e28df8d-f65c-4c11-ba04-6a9dd47b179b" + }, + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "contract_address": { + "description": "The contract address", + "type": "string", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + "org_name": { + "description": "The name of the organisation associated with this contract", + "nullable": true, + "type": "string", + "example": "Immutable" + }, + "name": { + "type": "string", + "nullable": true, + "description": "The name of the collection", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + "symbol": { + "type": "string", + "nullable": true, + "description": "The symbol of contract", + "example": "BASP" + }, + "description": { + "type": "string", + "nullable": true, + "description": "The description of collection", + "example": "Some description" + }, + "org_id": { + "type": "string", + "nullable": true, + "description": "The id of the organisation associated with this contract", + "example": "753da67a-5d3b-42c7-b87a-eba3d17a6362" + }, + "requester_email": { + "type": "string", + "nullable": true, + "description": "The email address of the user who requested the contract to be verified", + "example": "user@immutable.com" + }, + "contract_type": { + "$ref": "#/components/schemas/VerificationRequestContractType" + }, + "verification_request_status": { + "$ref": "#/components/schemas/VerificationRequestStatus" + } + }, + "required": [ + "id", + "chain", + "contract_address", + "name", + "symbol", + "description", + "contract_type", + "org_name", + "org_id", + "requester_email", + "verification_request_status" + ] + }, + "VerificationRequestContractType": { + "description": "The contract type associated with the given request", + "type": "string", + "enum": [ + "ERC20", + "ERC721", + "ERC1155" + ] + }, + "OrganisationTier": { + "description": "The tier of the organisation", + "type": "string", + "nullable": true, + "enum": [ + "common", + "uncommon", + "rare", + "epic", + "legendary" + ] + }, + "MintAsset": { + "type": "object", + "properties": { + "reference_id": { + "type": "string", + "description": "The id of this asset in the system that originates the mint request", + "example": "67f7d464-b8f0-4f6a-9a3b-8d3cb4a21af0" + }, + "owner_address": { + "type": "string", + "description": "The address of the receiver", + "example": "0xc344c05eef8876e517072f879dae8905aa2b956b" + }, + "token_id": { + "type": "string", + "description": "An optional `uint256` token id as string. Required for ERC1155 collections.", + "example": "1", + "nullable": true + }, + "amount": { + "type": "string", + "description": "Optional mount of tokens to mint. Required for ERC1155 collections. ERC712 collections can omit this field or set it to 1", + "example": "1", + "nullable": true, + "minLength": 1 + }, + "metadata": { + "$ref": "#/components/schemas/NFTMetadataRequest" + } + }, + "required": [ + "reference_id", + "owner_address" + ] + }, + "CreateMintRequestResult": { + "type": "object", + "properties": { + "imx_mint_requests_limit": { + "type": "string" + }, + "imx_mint_requests_limit_reset": { + "type": "string" + }, + "imx_remaining_mint_requests": { + "type": "string" + }, + "imx_mint_requests_retry_after": { + "type": "string" + } + }, + "required": [ + "imx_mint_requests_limit", + "imx_mint_requests_limit_reset", + "imx_remaining_mint_requests", + "imx_mint_requests_retry_after" + ] + }, + "ListMintRequestsResult": { + "type": "object", + "description": "List mint requests", + "properties": { + "result": { + "type": "array", + "description": "List of mint requests", + "items": { + "$ref": "#/components/schemas/GetMintRequestResult" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "GetMintRequestResult": { + "type": "object", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "collection_address": { + "type": "string", + "description": "The address of the contract", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + "reference_id": { + "type": "string", + "description": "The reference id of this mint request" + }, + "owner_address": { + "type": "string", + "description": "The address of the owner of the NFT" + }, + "token_id": { + "type": "string", + "example": "1", + "nullable": true, + "description": "An `uint256` token id as string. Only available when the mint request succeeds" + }, + "amount": { + "type": "string", + "example": "1", + "nullable": true, + "description": "An `uint256` amount as string. Only relevant for mint requests on ERC1155 contracts" + }, + "activity_id": { + "type": "string", + "format": "uuid", + "example": "4e28df8d-f65c-4c11-ba04-6a9dd47b179b", + "nullable": true, + "description": "The id of the mint activity associated with this mint request" + }, + "transaction_hash": { + "type": "string", + "nullable": true, + "description": "The transaction hash of the activity", + "example": "0x68d9eac5e3b3c3580404989a4030c948a78e1b07b2b5ea5688d8c38a6c61c93e" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the mint request was created" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "When the mint request was last updated", + "example": "2022-08-16T17:43:26.991388Z" + }, + "error": { + "$ref": "#/components/schemas/MintRequestErrorMessage" + }, + "status": { + "$ref": "#/components/schemas/MintRequestStatus" + } + }, + "required": [ + "chain", + "collection_address", + "reference_id", + "owner_address", + "status", + "token_id", + "transaction_hash", + "error", + "created_at", + "updated_at" + ] + }, + "MintRequestErrorMessage": { + "type": "object", + "description": "The error details in case the mint request fails", + "nullable": true, + "properties": { + "message": { + "description": "An error message in case the mint request fails", + "type": "string" + } + } + }, + "MintRequestStatus": { + "description": "The status of the mint request", + "example": "pending", + "type": "string", + "enum": [ + "pending", + "succeeded", + "failed" + ] + }, + "OperatorAllowlistStatus": { + "description": "The status of a contract on the operator allowlist", + "example": "requested", + "type": "string", + "enum": [ + "requested", + "approved", + "rejected", + "removed", + "added" + ] + }, + "OperatorAllowlistStatusDetails": { + "description": "The operator allowlist status details", + "oneOf": [ + { + "$ref": "#/components/schemas/OperatorAllowlistStatusRequested" + }, + { + "$ref": "#/components/schemas/OperatorAllowlistStatusUpdated" + } + ] + }, + "OperatorAllowlistStatusRequested": { + "type": "object", + "description": "The request details", + "properties": { + "purpose": { + "description": "Reason this contract needs to be added", + "type": "string", + "example": "Custom crafting contract" + }, + "is_settlement_contract": { + "description": "Attestation of whether this contract is a settlement contract", + "type": "boolean", + "example": false + } + }, + "required": [ + "purpose", + "is_settlement_contract" + ] + }, + "OperatorAllowlistStatusUpdated": { + "type": "object", + "description": "The update details", + "properties": { + "reason": { + "description": "Why this action was performed", + "type": "string", + "example": "Contract meets expectations" + } + }, + "required": [ + "reason" + ] + }, + "OperatorAllowlistContractStatusInternal": { + "allOf": [ + { + "$ref": "#/components/schemas/OperatorAllowlistContractStatus" + }, + { + "type": "object", + "properties": { + "org_name": { + "description": "The name of the organisation associated with this contract", + "nullable": true, + "type": "string", + "example": "Immutable" + }, + "org_tier": { + "$ref": "#/components/schemas/OrganisationTier" + } + }, + "required": [ + "org_name", + "org_tier" + ] + } + ] + }, + "OperatorAllowlistContractStatus": { + "type": "object", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "contract_address": { + "type": "string", + "description": "The address of the contract", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + "status": { + "$ref": "#/components/schemas/OperatorAllowlistStatus" + }, + "details": { + "$ref": "#/components/schemas/OperatorAllowlistStatusDetails" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the contract status was created" + }, + "created_by": { + "type": "string", + "format": "email", + "description": "Who created the status", + "example": "user@immutable.com" + } + }, + "required": [ + "chain", + "contract_address", + "status", + "details", + "created_at", + "created_by" + ] + }, + "Call": { + "type": "object", + "properties": { + "target_address": { + "$ref": "#/components/schemas/Address" + }, + "function_signature": { + "type": "string", + "description": "The function signature", + "example": "mint(address,uint256)" + }, + "function_args": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The function arguments", + "example": [ + "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e", + "1" + ] + } + }, + "required": [ + "target_address", + "function_signature", + "function_args" + ] + }, + "SignCraftingRequest": { + "type": "object", + "properties": { + "multi_caller": { + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/Address" + }, + "name": { + "type": "string", + "description": "The name of the multicaller contract", + "example": "Multicaller" + }, + "version": { + "type": "string", + "description": "The version of the multicaller contract", + "example": "1" + } + }, + "required": [ + "address", + "name", + "version" + ] + }, + "reference_id": { + "type": "string", + "description": "The id of this request in the system that originates the crafting request, specified as a 32 byte hex string", + "example": "67f7d464b8f04f6a9a3b8d3cb4a21af0" + }, + "calls": { + "type": "array", + "description": "The calls to be signed", + "items": { + "$ref": "#/components/schemas/Call" + }, + "minLength": 1, + "maxLength": 100 + }, + "expires_at": { + "type": "string", + "format": "date-time", + "description": "The expiration time of the request", + "example": "2022-08-16T17:43:26.991388Z" + } + }, + "required": [ + "multi_caller", + "reference_id", + "calls", + "expires_at" + ] + }, + "SignCraftingResult": { + "type": "object", + "properties": { + "signer_address": { + "$ref": "#/components/schemas/Address" + }, + "signature": { + "type": "string", + "description": "The signature of the request", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + } + }, + "required": [ + "signer_address", + "signature" + ] + }, + "BasicAPIError": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Error Message", + "example": "all fields must be provided" + }, + "link": { + "type": "string", + "description": "Link to IMX documentation that can help resolve this error", + "example": "https://docs.x.immutable.com/reference/#/" + }, + "trace_id": { + "type": "string", + "description": "Trace ID of the initial request", + "example": "e47634b79a5cd6894ddc9639ec4aad26" + } + }, + "required": [ + "message", + "link", + "trace_id" + ] + }, + "APIError400": { + "allOf": [ + { + "$ref": "#/components/schemas/BasicAPIError" + }, + { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error Code", + "enum": [ + "VALIDATION_ERROR" + ], + "example": "VALIDATION_ERROR" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional details to help resolve the error" + } + }, + "required": [ + "code", + "details" + ] + } + ] + }, + "APIError404": { + "allOf": [ + { + "$ref": "#/components/schemas/BasicAPIError" + }, + { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error Code", + "enum": [ + "RESOURCE_NOT_FOUND" + ], + "example": "RESOURCE_NOT_FOUND" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional details to help resolve the error" + } + }, + "required": [ + "code", + "details" + ] + } + ] + }, + "APIError500": { + "allOf": [ + { + "$ref": "#/components/schemas/BasicAPIError" + }, + { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error Code", + "enum": [ + "INTERNAL_SERVER_ERROR" + ], + "example": "INTERNAL_SERVER_ERROR" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional details to help resolve the error" + } + }, + "required": [ + "code", + "details" + ] + } + ] + }, + "APIError401": { + "allOf": [ + { + "$ref": "#/components/schemas/BasicAPIError" + }, + { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error Code", + "enum": [ + "UNAUTHORISED_REQUEST" + ], + "example": "UNAUTHORISED_REQUEST" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional details to help resolve the error" + } + }, + "required": [ + "code", + "details" + ] + } + ] + }, + "APIError403": { + "allOf": [ + { + "$ref": "#/components/schemas/BasicAPIError" + }, + { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error Code", + "enum": [ + "AUTHENTICATION_ERROR" + ], + "example": "AUTHENTICATION_ERROR" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional details to help resolve the error" + } + }, + "required": [ + "code", + "details" + ] + } + ] + }, + "APIError429": { + "allOf": [ + { + "$ref": "#/components/schemas/BasicAPIError" + }, + { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error Code", + "enum": [ + "TOO_MANY_REQUESTS_ERROR" + ], + "example": "TOO_MANY_REQUESTS_ERROR" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional details to help resolve the error" + } + }, + "required": [ + "code", + "details" + ] + } + ] + }, + "APIError409": { + "allOf": [ + { + "$ref": "#/components/schemas/BasicAPIError" + }, + { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error Code", + "enum": [ + "CONFLICT_ERROR" + ], + "example": "CONFLICT_ERROR" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional details to help resolve the error", + "additionalProperties": true + } + }, + "required": [ + "code", + "details" + ] + } + ] + }, + "Item": { + "oneOf": [ + { + "$ref": "#/components/schemas/NativeItem" + }, + { + "$ref": "#/components/schemas/ERC20Item" + }, + { + "$ref": "#/components/schemas/ERC721Item" + }, + { + "$ref": "#/components/schemas/ERC1155Item" + }, + { + "$ref": "#/components/schemas/ERC721CollectionItem" + }, + { + "$ref": "#/components/schemas/ERC1155CollectionItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "NATIVE": "#/components/schemas/NativeItem", + "ERC20": "#/components/schemas/ERC20Item", + "ERC721": "#/components/schemas/ERC721Item", + "ERC1155": "#/components/schemas/ERC1155Item", + "ERC721_COLLECTION": "#/components/schemas/ERC721CollectionItem", + "ERC1155_COLLECTION": "#/components/schemas/ERC1155CollectionItem" + } + } + }, + "AssetCollectionItem": { + "oneOf": [ + { + "$ref": "#/components/schemas/ERC721CollectionItem" + }, + { + "$ref": "#/components/schemas/ERC1155CollectionItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "ERC721_COLLECTION": "#/components/schemas/ERC721CollectionItem", + "ERC1155_COLLECTION": "#/components/schemas/ERC1155CollectionItem" + } + } + }, + "FulfillmentDataRequest": { + "type": "object", + "properties": { + "order_id": { + "type": "string", + "format": "uuid" + }, + "taker_address": { + "type": "string", + "description": "Address of the intended account fulfilling the order", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "fees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Fee" + }, + "example": [ + { + "type": "TAKER_ECOSYSTEM", + "amount": "2250000000000000000", + "recipient_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233" + } + ], + "minItems": 0, + "maxItems": 2 + }, + "token_id": { + "type": "string", + "description": "Token ID for the ERC721 or ERC1155 token when fulfilling a collection order", + "example": "123", + "pattern": "\\d+" + } + }, + "required": [ + "order_id", + "fees", + "taker_address" + ] + }, + "FulfillableOrder": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/Order" + }, + "token_id": { + "type": "string", + "description": "Token ID for the ERC721 or ERC1155 token when fulfilling a collection order", + "example": "123", + "pattern": "\\d+" + }, + "extra_data": { + "type": "string" + } + }, + "required": [ + "extra_data", + "order" + ] + }, + "UnfulfillableOrder": { + "type": "object", + "properties": { + "order_id": { + "type": "string", + "description": "OrderID for the requested but unfulfillable order", + "example": "7df3e99e-f7b3-459c-bef6-ffb66a18bb59" + }, + "token_id": { + "type": "string", + "description": "Token ID for the ERC721 or ERC1155 token when fulfilling a collection order", + "example": "123", + "pattern": "\\d+" + }, + "reason": { + "type": "string", + "description": "Nullable string containing error reason if the signing is unsuccessful for the order", + "example": "Invalid order status INACTIVE for order 7df3e99e-f7b3-459c-bef6-ffb66a18bb59" + } + }, + "required": [ + "reason", + "order_id" + ] + }, + "NativeItem": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Token type user is offering, which in this case is the native IMX token", + "example": "NATIVE", + "enum": [ + "NATIVE" + ] + }, + "amount": { + "type": "string", + "description": "A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).", + "example": "9750000000000000000", + "pattern": "\\d+" + } + }, + "required": [ + "type", + "amount" + ] + }, + "ERC20Item": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Token type user is offering, which in this case is ERC20", + "example": "ERC20", + "enum": [ + "ERC20" + ] + }, + "contract_address": { + "type": "string", + "description": "Address of ERC20 token", + "example": "0x0165878A594ca255338adfa4d48449f69242Eb8F", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "amount": { + "type": "string", + "description": "A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).", + "example": "9750000000000000000", + "pattern": "\\d+" + } + }, + "required": [ + "type", + "contract_address", + "amount" + ] + }, + "ERC721Item": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Token type user is offering, which in this case is ERC721", + "example": "ERC721", + "enum": [ + "ERC721" + ] + }, + "contract_address": { + "type": "string", + "description": "Address of ERC721 token", + "example": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "token_id": { + "type": "string", + "description": "ID of ERC721 token", + "example": "1", + "pattern": "\\d+" + } + }, + "required": [ + "type", + "contract_address", + "token_id" + ] + }, + "ERC1155Item": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Token type user is offering, which in this case is ERC1155", + "example": "ERC1155", + "enum": [ + "ERC1155" + ] + }, + "contract_address": { + "type": "string", + "description": "Address of ERC1155 token", + "example": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "token_id": { + "type": "string", + "description": "ID of ERC1155 token", + "example": "1", + "pattern": "\\d+" + }, + "amount": { + "type": "string", + "description": "A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).", + "example": "9750000000000000000", + "pattern": "\\d+" + } + }, + "required": [ + "type", + "contract_address", + "token_id", + "amount" + ] + }, + "ERC721CollectionItem": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Token type user is offering, which in this case is ERC721", + "example": "ERC721_COLLECTION", + "enum": [ + "ERC721_COLLECTION" + ] + }, + "contract_address": { + "type": "string", + "description": "Address of ERC721 collection", + "example": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "amount": { + "type": "string", + "description": "A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).", + "example": "9750000000000000000", + "pattern": "\\d+" + } + }, + "required": [ + "type", + "contract_address", + "amount" + ] + }, + "ERC1155CollectionItem": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Token type user is offering, which in this case is ERC1155", + "example": "ERC1155_COLLECTION", + "enum": [ + "ERC1155_COLLECTION" + ] + }, + "contract_address": { + "type": "string", + "description": "Address of ERC1155 collection", + "example": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "amount": { + "type": "string", + "description": "A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).", + "example": "9750000000000000000", + "pattern": "\\d+" + } + }, + "required": [ + "type", + "contract_address", + "amount" + ] + }, + "CancelOrdersRequestBody": { + "type": "object", + "properties": { + "account_address": { + "type": "string", + "description": "Address of the user initiating the cancel request", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "orders": { + "type": "array", + "description": "List of order ids proposed for cancellation", + "items": { + "type": "string", + "format": "uuid" + }, + "uniqueItems": true, + "minItems": 1, + "maxItems": 20 + }, + "signature": { + "type": "string", + "description": "Signature generated by the user for the specific cancellation request", + "example": "0x12345" + } + }, + "required": [ + "account_address", + "orders", + "signature" + ], + "example": { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "ids": [ + "018a8c71-d7e4-e303-a2ef-318871ef7756", + "238a8c71-d7e4-e303-a2ef-318871ef7778", + "458a8c71-d7e4-e303-a2ef-318871ef7790" + ], + "signature": 291 + } + }, + "CreateListingRequestBody": { + "type": "object", + "properties": { + "account_address": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "order_hash": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + }, + "buy": { + "type": "array", + "description": "Buy item for listing should either be NATIVE or ERC20 item", + "items": { + "$ref": "#/components/schemas/Item" + }, + "example": [ + { + "type": "NATIVE", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "fees": { + "type": "array", + "description": "Buy fees should only include maker marketplace fees and should be no more than two entries as more entires will incur more gas. It is best practice to have this as few as possible.", + "items": { + "$ref": "#/components/schemas/Fee" + }, + "example": [], + "minItems": 0, + "maxItems": 2 + }, + "end_at": { + "type": "string", + "description": "Time after which the Order is considered expired", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + }, + "protocol_data": { + "$ref": "#/components/schemas/ProtocolData" + }, + "salt": { + "type": "string", + "description": "A random value added to the create Order request", + "example": "12686911856931635052326433555881236148" + }, + "sell": { + "type": "array", + "description": "Sell item for listing should be an ERC721 item", + "items": { + "$ref": "#/components/schemas/Item" + }, + "example": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "signature": { + "type": "string", + "description": "Digital signature generated by the user for the specific Order", + "example": "0x" + }, + "start_at": { + "type": "string", + "description": "Time after which Order is considered active", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + } + }, + "example": { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "order_hash": "0x0821933d9391bc9bf11a6010fe84776c84b203abff0c1ad781fb4881409c8770", + "buy": [ + { + "type": "NATIVE", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [ + { + "type": "MAKER_ECOSYSTEM", + "amount": "2250000000000000000", + "recipient_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233" + } + ], + "end_at": "2022-03-10T05:00:50.52Z", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.4" + }, + "salt": "12686911856931635052326433555881236148", + "sell": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z" + }, + "required": [ + "account_address", + "order_hash", + "buy", + "sell", + "fees", + "end_at", + "start_at", + "protocol_data", + "salt", + "signature" + ] + }, + "CreateBidRequestBody": { + "type": "object", + "properties": { + "account_address": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "order_hash": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + }, + "buy": { + "type": "array", + "description": "Buy item for bid should either be ERC721 or ERC1155 item", + "items": { + "$ref": "#/components/schemas/Item" + }, + "example": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "fees": { + "type": "array", + "description": "Buy fees should only include maker marketplace fees and should be no more than two entries as more entires will incur more gas. It is best practice to have this as few as possible.", + "items": { + "$ref": "#/components/schemas/Fee" + }, + "example": [], + "minItems": 0, + "maxItems": 2 + }, + "end_at": { + "type": "string", + "description": "Time after which the Order is considered expired", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + }, + "protocol_data": { + "$ref": "#/components/schemas/ProtocolData" + }, + "salt": { + "type": "string", + "description": "A random value added to the create Order request", + "example": "12686911856931635052326433555881236148" + }, + "sell": { + "type": "array", + "description": "Sell item for bid should be an ERC20 item", + "items": { + "$ref": "#/components/schemas/ERC20Item" + }, + "example": [ + { + "type": "ERC20", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "amount": "9750000000000000000" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "signature": { + "type": "string", + "description": "Digital signature generated by the user for the specific Order", + "example": "0x" + }, + "start_at": { + "type": "string", + "description": "Time after which Order is considered active", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + } + }, + "example": { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "order_hash": "0x0821933d9391bc9bf11a6010fe84776c84b203abff0c1ad781fb4881409c8770", + "sell": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [ + { + "type": "MAKER_ECOSYSTEM", + "amount": "2250000000000000000", + "recipient_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233" + } + ], + "end_at": "2022-03-10T05:00:50.52Z", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "buy": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z" + }, + "required": [ + "account_address", + "order_hash", + "buy", + "sell", + "fees", + "end_at", + "start_at", + "protocol_data", + "salt", + "signature" + ] + }, + "CreateCollectionBidRequestBody": { + "type": "object", + "properties": { + "account_address": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "order_hash": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + }, + "buy": { + "type": "array", + "description": "Buy item for collection bid should either be ERC721 or ERC1155 collection item", + "items": { + "$ref": "#/components/schemas/AssetCollectionItem" + }, + "example": [ + { + "type": "ERC721_COLLECTION", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "amount": "1" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "fees": { + "type": "array", + "description": "Buy fees should only include maker marketplace fees and should be no more than two entries as more entires will incur more gas. It is best practice to have this as few as possible.", + "items": { + "$ref": "#/components/schemas/Fee" + }, + "example": [], + "minItems": 0, + "maxItems": 2 + }, + "end_at": { + "type": "string", + "description": "Time after which the Order is considered expired", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + }, + "protocol_data": { + "$ref": "#/components/schemas/ProtocolData" + }, + "salt": { + "type": "string", + "description": "A random value added to the create Order request", + "example": "12686911856931635052326433555881236148" + }, + "sell": { + "type": "array", + "description": "Sell item for collection bid should be an ERC20 item", + "items": { + "$ref": "#/components/schemas/ERC20Item" + }, + "example": [ + { + "type": "ERC20", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "amount": "9750000000000000000" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "signature": { + "type": "string", + "description": "Digital signature generated by the user for the specific Order", + "example": "0x" + }, + "start_at": { + "type": "string", + "description": "Time after which Order is considered active", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + } + }, + "example": { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "order_hash": "0x0821933d9391bc9bf11a6010fe84776c84b203abff0c1ad781fb4881409c8770", + "sell": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [ + { + "type": "MAKER_ECOSYSTEM", + "amount": "2250000000000000000", + "recipient_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233" + } + ], + "end_at": "2022-03-10T05:00:50.52Z", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "buy": [ + { + "type": "ERC721_COLLECTION", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "amount": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z" + }, + "required": [ + "account_address", + "order_hash", + "buy", + "sell", + "fees", + "end_at", + "start_at", + "protocol_data", + "salt", + "signature" + ] + }, + "Fee": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "description": "Fee payable to recipient upon settlement", + "example": "2250000000000000000", + "pattern": "\\d+" + }, + "type": { + "type": "string", + "description": "Fee type", + "example": "ROYALTY", + "enum": [ + "ROYALTY", + "MAKER_ECOSYSTEM", + "TAKER_ECOSYSTEM", + "PROTOCOL" + ] + }, + "recipient_address": { + "type": "string", + "description": "Wallet address of fee recipient", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + "example": { + "amount": "2250000000000000000", + "type": "ROYALTY", + "recipient_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233" + }, + "required": [ + "type", + "amount", + "recipient_address" + ] + }, + "Order": { + "type": "object", + "properties": { + "account_address": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + }, + "buy": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "example": [ + { + "type": "NATIVE", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "fees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Fee" + }, + "example": [], + "minItems": 0 + }, + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "created_at": { + "type": "string", + "description": "Time the Order is created", + "format": "date-time", + "example": "2022-03-07T07:20:50.52Z" + }, + "end_at": { + "type": "string", + "description": "Time after which the Order is considered expired", + "format": "date-time", + "example": "2022-03-10T05:00:50.52Z" + }, + "id": { + "type": "string", + "description": "Global Order identifier", + "example": "018792C9-4AD7-8EC4-4038-9E05C598534A" + }, + "order_hash": { + "type": "string", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + }, + "protocol_data": { + "$ref": "#/components/schemas/ProtocolData" + }, + "salt": { + "type": "string", + "description": "A random value added to the create Order request", + "example": "12686911856931635052326433555881236148" + }, + "sell": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "example": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "signature": { + "type": "string", + "description": "Digital signature generated by the user for the specific Order", + "example": "0x" + }, + "start_at": { + "type": "string", + "description": "Time after which Order is considered active", + "format": "date-time", + "example": "2022-03-09T05:00:50.52Z" + }, + "status": { + "$ref": "#/components/schemas/OrderStatus" + }, + "type": { + "type": "string", + "description": "Order type", + "example": "LISTING", + "enum": [ + "LISTING", + "BID", + "COLLECTION_BID" + ] + }, + "updated_at": { + "type": "string", + "description": "Time the Order is last updated", + "format": "date-time", + "example": "2022-03-07T07:20:50.52Z" + }, + "fill_status": { + "$ref": "#/components/schemas/FillStatus" + } + }, + "example": { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "buy": [ + { + "type": "NATIVE", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.4" + }, + "salt": "12686911856931635052326433555881236148", + "sell": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "ACTIVE" + }, + "fill_status": { + "numerator": 1, + "denominator": 2 + }, + "type": "LISTING", + "updated_at": "2022-03-07T07:20:50.52Z" + }, + "required": [ + "id", + "type", + "account_address", + "buy", + "sell", + "fees", + "chain", + "created_at", + "end_at", + "start_at", + "updated_at", + "order_hash", + "protocol_data", + "salt", + "signature", + "status", + "fill_status" + ] + }, + "Trade": { + "type": "object", + "properties": { + "buy": { + "description": "Buy items are transferred from the taker to the maker.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "example": [ + { + "type": "NATIVE", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "buyer_address": { + "description": "Deprecated. Use maker and taker addresses instead of buyer and seller addresses.", + "type": "string", + "example": "0xFC99a706C0D05B8C71E1fAAC91b3E1343aC34D40" + }, + "buyer_fees": { + "description": "Deprecated. Use fees instead. The taker always pays the fees.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Fee" + }, + "example": [], + "minItems": 0, + "maxItems": 1 + }, + "fees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Fee" + }, + "example": [], + "minItems": 0, + "maxItems": 1 + }, + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "order_id": { + "type": "string", + "example": "7df3e99e-f7b3-459c-bef6-ffb66a18bb59" + }, + "blockchain_metadata": { + "$ref": "#/components/schemas/TradeBlockchainMetadata" + }, + "indexed_at": { + "type": "string", + "description": "Time the on-chain trade event is indexed by the order book system", + "format": "date-time", + "example": "2022-03-07T07:20:50.52Z" + }, + "id": { + "type": "string", + "description": "Global Trade identifier", + "example": "018792C9-4AD7-8EC4-4038-9E05C598534A" + }, + "sell": { + "description": "Sell items are transferred from the maker to the taker.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "example": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "minItems": 1, + "maxItems": 1 + }, + "seller_address": { + "description": "Deprecated. Use maker and taker addresses instead of buyer and seller addresses.", + "type": "string", + "example": "0x002b9B1cbf464782Df5d48870358FA6c09f1b19D" + }, + "maker_address": { + "type": "string", + "example": "0x002b9B1cbf464782Df5d48870358FA6c09f1b19D" + }, + "taker_address": { + "type": "string", + "example": "0xFC99a706C0D05B8C71E1fAAC91b3E1343aC34D40" + } + }, + "example": { + "buy": [ + { + "type": "NATIVE", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "buyer_address": "0xFC99a706C0D05B8C71E1fAAC91b3E1343aC34D40", + "buyer_fees": [], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "indexed_at": "2022-03-07T07:20:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "sell": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "seller_address": "0x002b9B1cbf464782Df5d48870358FA6c09f1b19D", + "maker_address": "0x002b9B1cbf464782Df5d48870358FA6c09f1b19D", + "taker_address": "0xFC99a706C0D05B8C71E1fAAC91b3E1343aC34D40" + }, + "required": [ + "id", + "order_id", + "buy", + "buyer_address", + "sell", + "seller_address", + "buyer_fees", + "fees", + "chain", + "maker_address", + "taker_address", + "indexed_at", + "blockchain_metadata" + ] + }, + "CancelOrdersResult": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/CancelOrdersResultData" + } + }, + "required": [ + "result" + ], + "example": { + "result": { + "successful_cancellations": [ + "018a8c71-d7e4-e303-a2ef-318871ef7756", + "458a8c71-d7e4-e303-a2ef-318871ef7778" + ], + "pending_cancellations": [ + "238a8c71-d7e4-e303-a2ef-318871ef7778", + "898a8c71-d7e4-e303-a2ef-318871ef7735" + ], + "failed_cancellations": [ + { + "order": "458a8c71-d7e4-e303-a2ef-318871ef7790", + "reason_code": "FILLED" + }, + { + "order": "338a8c71-d7e4-e303-a2ef-318871ef7342", + "reason_code": "FILLED" + } + ] + } + } + }, + "CancelOrdersResultData": { + "type": "object", + "properties": { + "successful_cancellations": { + "type": "array", + "description": "Orders which were successfully cancelled", + "items": { + "type": "string" + }, + "minItems": 0, + "maxItems": 10 + }, + "pending_cancellations": { + "type": "array", + "description": "Orders which are marked for cancellation but the cancellation cannot be guaranteed", + "items": { + "type": "string" + }, + "minItems": 0, + "maxItems": 10 + }, + "failed_cancellations": { + "type": "array", + "description": "Orders which failed to be cancelled", + "items": { + "$ref": "#/components/schemas/FailedOrderCancellation" + }, + "minItems": 0, + "maxItems": 10 + } + }, + "required": [ + "successful_cancellations", + "pending_cancellations", + "failed_cancellations" + ] + }, + "FailedOrderCancellation": { + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "ID of the order which failed to be cancelled", + "example": "7df3e99e-f7b3-459c-bef6-ffb66a18bb59" + }, + "reason_code": { + "type": "string", + "enum": [ + "FILLED" + ], + "description": "Reason code indicating why the order failed to be cancelled", + "example": "FILLED" + } + }, + "required": [ + "order", + "reason_code" + ] + }, + "ListingResult": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/Order" + } + }, + "required": [ + "result" + ], + "example": { + "result": { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "buy": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534B", + "order_hash": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "sell": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "EXPIRED" + }, + "type": { + "name": "LISTING" + }, + "updated_at": "2022-03-07T07:20:50.52Z" + } + } + }, + "BidResult": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/Order" + } + }, + "required": [ + "result" + ], + "example": { + "result": { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "sell": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534B", + "order_hash": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "buy": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "EXPIRED" + }, + "type": "BID", + "updated_at": "2022-03-07T07:20:50.52Z" + } + } + }, + "CollectionBidResult": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/Order" + } + }, + "required": [ + "result" + ], + "example": { + "result": { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "sell": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "order_hash": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "protocol_data": { + "order_type": "PARTIAL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "buy": [ + { + "type": "ERC721_COLLECTION", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "amount": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "EXPIRED" + }, + "type": "COLLECTION_BID", + "updated_at": "2022-03-07T07:20:50.52Z" + } + } + }, + "ListListingsResult": { + "type": "object", + "properties": { + "page": { + "$ref": "#/components/schemas/Page" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + }, + "minItems": 0, + "maxItems": 200 + } + }, + "required": [ + "page", + "result" + ], + "example": { + "page": { + "previous_cursor": "MjAyMy0wMS0yM1QwMTo1NToyNy4zNTM2MzA", + "next_cursor": "MjAyMy0wMS0yM1QwMTo1NToyNy4zNTM2MzA" + }, + "result": [ + { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "buy": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "order_hash": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "sell": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "EXPIRED" + }, + "updated_at": "2022-03-07T07:20:50.52Z" + }, + { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "buy": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "order_hash": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "sell": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "EXPIRED" + }, + "updated_at": "2022-03-07T07:20:50.52Z" + } + ] + } + }, + "ListBidsResult": { + "type": "object", + "properties": { + "page": { + "$ref": "#/components/schemas/Page" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + }, + "minItems": 0, + "maxItems": 200 + } + }, + "required": [ + "page", + "result" + ], + "example": { + "page": { + "previous_cursor": "MjAyMy0wMS0yM1QwMTo1NToyNy4zNTM2MzA", + "next_cursor": "MjAyMy0wMS0yM1QwMTo1NToyNy4zNTM2MzA" + }, + "result": [ + { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "sell": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "order_hash": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "buy": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "EXPIRED" + }, + "updated_at": "2022-03-07T07:20:50.52Z" + }, + { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "sell": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "order_hash": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "protocol_data": { + "order_type": "FULL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "buy": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "EXPIRED" + }, + "updated_at": "2022-03-07T07:20:50.52Z" + } + ] + } + }, + "ListCollectionBidsResult": { + "type": "object", + "properties": { + "page": { + "$ref": "#/components/schemas/Page" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + }, + "minItems": 0, + "maxItems": 200 + } + }, + "required": [ + "page", + "result" + ], + "example": { + "page": { + "previous_cursor": "MjAyMy0wMS0yM1QwMTo1NToyNy4zNTM2MzA", + "next_cursor": "MjAyMy0wMS0yM1QwMTo1NToyNy4zNTM2MzA" + }, + "result": [ + { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "sell": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "order_hash": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "protocol_data": { + "order_type": "PARTIAL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "buy": [ + { + "type": "ERC721_COLLECTION", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "amount": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "EXPIRED" + }, + "updated_at": "2022-03-07T07:20:50.52Z" + }, + { + "account_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "sell": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "end_at": "2022-03-10T05:00:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "order_hash": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "protocol_data": { + "order_type": "PARTIAL_RESTRICTED", + "counter": "1", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "salt": "12686911856931635052326433555881236148", + "buy": [ + { + "type": "ERC721_COLLECTION", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "amount": "1" + } + ], + "signature": "0x", + "start_at": "2022-03-09T05:00:50.52Z", + "status": { + "name": "EXPIRED" + }, + "updated_at": "2022-03-07T07:20:50.52Z" + } + ] + } + }, + "TradeResult": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/Trade" + } + }, + "required": [ + "result" + ], + "example": { + "result": { + "buy": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "buyer_address": "0xFC99a706C0D05B8C71E1fAAC91b3E1343aC34D40", + "buyer_fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534B", + "sell": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "seller_address": "0x002b9B1cbf464782Df5d48870358FA6c09f1b19D", + "maker_address": "0x002b9B1cbf464782Df5d48870358FA6c09f1b19D", + "taker_address": "0xFC99a706C0D05B8C71E1fAAC91b3E1343aC34D40", + "updated_at": "2022-03-07T07:20:50.52Z" + } + } + }, + "ListTradeResult": { + "type": "object", + "properties": { + "page": { + "$ref": "#/components/schemas/Page" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Trade" + }, + "minItems": 0, + "maxItems": 200 + } + }, + "required": [ + "page", + "result" + ], + "example": { + "page": { + "previous_cursor": "MjAyMy0wMS0yM1QwMTo1NToyNy4zNTM2MzA", + "next_cursor": "MjAyMy0wMS0yM1QwMTo1NToyNy4zNTM2MzA" + }, + "result": [ + { + "buy": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "buyer_address": "0xFC99a706C0D05B8C71E1fAAC91b3E1343aC34D40", + "buyer_fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "sell": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "seller_address": "0x002b9B1cbf464782Df5d48870358FA6c09f1b19D", + "maker_address": "0x002b9B1cbf464782Df5d48870358FA6c09f1b19D", + "taker_address": "0xFC99a706C0D05B8C71E1fAAC91b3E1343aC34D40", + "updated_at": "2022-03-07T07:20:50.52Z" + }, + { + "buy": [ + { + "type": "ERC20", + "amount": "9750000000000000000", + "contract_address": "0x0165878A594ca255338adfa4d48449f69242Eb8F" + } + ], + "buyer_address": "0x017406f3F27d507a1491976B7835CE5CD0fA647a", + "buyer_fees": [], + "chain": { + "id": "eip155:11155111", + "name": "sepolia" + }, + "created_at": "2022-03-07T07:20:50.52Z", + "id": "018792C9-4AD7-8EC4-4038-9E05C598534A", + "sell": [ + { + "type": "ERC721", + "contract_address": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "token_id": "1" + } + ], + "seller_address": "0xC73349c545C1D757eb650cDc463A2f6dF1Ec41cb", + "maker_address": "0xC73349c545C1D757eb650cDc463A2f6dF1Ec41cb", + "taker_address": "0x017406f3F27d507a1491976B7835CE5CD0fA647a", + "updated_at": "2022-03-07T07:20:50.52Z" + } + ] + } + }, + "OrderStatus": { + "description": "The Order status", + "oneOf": [ + { + "$ref": "#/components/schemas/CancelledOrderStatus" + }, + { + "$ref": "#/components/schemas/PendingOrderStatus" + }, + { + "$ref": "#/components/schemas/ActiveOrderStatus" + }, + { + "$ref": "#/components/schemas/InactiveOrderStatus" + }, + { + "$ref": "#/components/schemas/FilledOrderStatus" + }, + { + "$ref": "#/components/schemas/ExpiredOrderStatus" + } + ], + "discriminator": { + "propertyName": "name", + "mapping": { + "CANCELLED": "#/components/schemas/CancelledOrderStatus", + "PENDING": "#/components/schemas/PendingOrderStatus", + "ACTIVE": "#/components/schemas/ActiveOrderStatus", + "INACTIVE": "#/components/schemas/InactiveOrderStatus", + "FILLED": "#/components/schemas/FilledOrderStatus", + "EXPIRED": "#/components/schemas/ExpiredOrderStatus" + } + } + }, + "CancelledOrderStatus": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The order status indicating a order is has been cancelled or about to be cancelled.", + "enum": [ + "CANCELLED" + ] + }, + "pending": { + "type": "boolean", + "description": "Whether the cancellation of the order is pending", + "example": false + }, + "cancellation_type": { + "type": "string", + "description": "Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account", + "enum": [ + "ON_CHAIN", + "OFF_CHAIN", + "UNDERFUNDED" + ], + "example": "ON_CHAIN" + } + }, + "required": [ + "name", + "pending", + "cancellation_type" + ] + }, + "PendingOrderStatus": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The order status that indicates the order is yet to be active due to various reasons.", + "enum": [ + "PENDING" + ] + }, + "evaluated": { + "type": "boolean", + "description": "Whether the order has been evaluated after its creation", + "example": false + }, + "started": { + "type": "boolean", + "description": "Whether the order has reached its specified start time", + "example": false + } + }, + "required": [ + "name", + "evaluated", + "started" + ] + }, + "ActiveOrderStatus": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The order status that indicates an order can be fulfilled.", + "enum": [ + "ACTIVE" + ] + } + }, + "required": [ + "name" + ] + }, + "InactiveOrderStatus": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The order status that indicates an order cannot be fulfilled.", + "enum": [ + "INACTIVE" + ] + }, + "sufficient_approvals": { + "type": "boolean", + "description": "Whether the order offerer has sufficient approvals", + "example": false + }, + "sufficient_balances": { + "type": "boolean", + "description": "Whether the order offerer still has sufficient balance to complete the order", + "example": false + } + }, + "required": [ + "name", + "sufficient_approvals", + "sufficient_balances" + ] + }, + "ExpiredOrderStatus": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A terminal order status indicating that an order cannot be fulfilled due to expiry.", + "enum": [ + "EXPIRED" + ] + } + }, + "required": [ + "name" + ] + }, + "FilledOrderStatus": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A terminal order status indicating that an order has been fulfilled.", + "enum": [ + "FILLED" + ] + } + }, + "required": [ + "name" + ] + }, + "OrderStatusName": { + "type": "string", + "description": "The Order status", + "enum": [ + "PENDING", + "ACTIVE", + "INACTIVE", + "FILLED", + "EXPIRED", + "CANCELLED" + ] + }, + "ProtocolData": { + "type": "object", + "properties": { + "order_type": { + "type": "string", + "description": "Seaport order type. Orders containing ERC721 tokens will need to pass in the order type as FULL_RESTRICTED while orders with ERC1155 tokens will need to pass in the order_type as PARTIAL_RESTRICTED", + "example": "FULL_RESTRICTED", + "enum": [ + "FULL_RESTRICTED", + "PARTIAL_RESTRICTED" + ] + }, + "counter": { + "type": "string", + "description": "big.Int or uint256 string for order counter", + "example": "92315562" + }, + "zone_address": { + "type": "string", + "description": "Immutable zone address", + "example": "0x12" + }, + "seaport_address": { + "type": "string", + "description": "Immutable Seaport contract address", + "example": "0x12" + }, + "seaport_version": { + "type": "string", + "description": "Immutable Seaport contract version", + "example": "1.5" + } + }, + "example": { + "order_type": "FULL_RESTRICTED", + "counter": "92315562", + "zone_address": "0x12", + "seaport_address": "0x12", + "seaport_version": "1.5" + }, + "required": [ + "order_type", + "counter", + "zone_address", + "seaport_address", + "seaport_version" + ] + }, + "TradeBlockchainMetadata": { + "description": "The metadata related to the transaction in which the activity occurred", + "nullable": true, + "type": "object", + "properties": { + "transaction_hash": { + "type": "string", + "description": "The transaction hash of the trade", + "example": "0x68d9eac5e3b3c3580404989a4030c948a78e1b07b2b5ea5688d8c38a6c61c93e" + }, + "block_number": { + "description": "EVM block number (uint64 as string)", + "type": "string", + "example": "1" + }, + "transaction_index": { + "description": "Transaction index in a block (uint32 as string)", + "type": "string", + "example": "1" + }, + "log_index": { + "description": "The log index of the fulfillment event in a block (uint32 as string)", + "type": "string", + "example": "1" + } + }, + "required": [ + "transaction_hash", + "block_number", + "transaction_index", + "log_index" + ] + }, + "FillStatus": { + "description": "The ratio of the order that has been filled, an order that has been fully filled will have the same numerator and denominator values.", + "type": "object", + "properties": { + "numerator": { + "type": "string", + "description": "The numerator of the fill status", + "example": "1" + }, + "denominator": { + "type": "string", + "description": "The denominator of the fill status", + "example": "2" + } + }, + "required": [ + "numerator", + "denominator" + ] + }, + "APIError501": { + "allOf": [ + { + "$ref": "#/components/schemas/BasicAPIError" + }, + { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error Code", + "enum": [ + "NOT_IMPLEMENTED_ERROR" + ], + "example": "NOT_IMPLEMENTED_ERROR" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional details to help resolve the error" + } + }, + "required": [ + "code", + "details" + ] + } + ] + }, + "GetLinkedAddressesRes": { + "type": "object", + "required": [ + "linked_addresses" + ], + "properties": { + "linked_addresses": { + "type": "array", + "minItems": 0, + "description": "The user's list of linked addresses", + "items": { + "description": "The user's linked address", + "type": "string", + "pattern": "^0x[0-9a-fA-F]*$", + "maxLength": 42 + } + } + } + }, + "EthAddress": { + "description": "Ethereum address", + "type": "string", + "example": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" + }, + "CreatedAt": { + "description": "Created at", + "type": "string", + "format": "date-time", + "example": "2021-08-31T00:00:00Z" + }, + "Name": { + "description": "Name", + "type": "string", + "example": "Test" + }, + "WalletType": { + "description": "Wallet type", + "type": "string", + "example": "MetaMask" + }, + "Wallet": { + "description": "Linked wallet", + "type": "object", + "required": [ + "address", + "type", + "created_at", + "updated_at", + "clientName" + ], + "properties": { + "address": { + "$ref": "#/components/schemas/EthAddress" + }, + "type": { + "$ref": "#/components/schemas/WalletType" + }, + "created_at": { + "$ref": "#/components/schemas/CreatedAt" + }, + "updated_at": { + "$ref": "#/components/schemas/CreatedAt" + }, + "name": { + "$ref": "#/components/schemas/Name" + }, + "clientName": { + "type": "string", + "description": "Name of client that linked the wallet", + "example": "Passport Dashboard" + } + } + }, + "LinkWalletV2Request": { + "description": "Link wallet V2 request", + "type": "object", + "required": [ + "type", + "wallet_address", + "signature", + "nonce" + ], + "properties": { + "type": { + "type": "string", + "description": "This should be the EIP-6963 rdns value, if you're unable to get the rdns value you can provide \"External\". If using WalletConnect then provide \"WalletConnect\".", + "example": "io.metamask", + "maxLength": 32, + "not": { + "enum": [ + "Passport", + "com.immutable.passport" + ] + } + }, + "wallet_address": { + "description": "The address of the external wallet being linked to Passport", + "type": "string", + "example": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "signature": { + "description": "The EIP-712 signature", + "type": "string" + }, + "nonce": { + "description": "A unique identifier for the signature", + "type": "string" + } + } + }, + "UserInfo": { + "type": "object", + "required": [ + "sub", + "linked_addresses" + ], + "properties": { + "sub": { + "type": "string", + "description": "The user's id" + }, + "email": { + "type": "string", + "description": "The user's email address" + }, + "passport_address": { + "type": "string", + "description": "The user's Passport address if it has been registered", + "pattern": "^0x[0-9a-fA-F]*$", + "maxLength": 42 + }, + "linked_addresses": { + "type": "array", + "minItems": 0, + "description": "The user's list of linked addresses", + "items": { + "description": "The user's linked address", + "type": "string", + "pattern": "^0x[0-9a-fA-F]*$", + "maxLength": 42 + } + } + } + }, + "MarketplaceContractType": { + "description": "The contract type for a collection", + "type": "string", + "enum": [ + "ERC721", + "ERC1155" + ] + }, + "NFTWithStack": { + "type": "object", + "description": "Stack", + "properties": { + "token_id": { + "description": "Token id of NFT (uint256 as string)", + "type": "string" + }, + "stack_id": { + "type": "string", + "format": "uuid", + "description": "Stack ID" + }, + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "contract_address": { + "type": "string", + "description": "Contract address" + }, + "contract_type": { + "$ref": "#/components/schemas/MarketplaceContractType" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the metadata was created" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "When the metadata was last updated", + "example": "2022-08-16T17:43:26.991388Z" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Sword", + "description": "The name of the NFT" + }, + "description": { + "type": "string", + "nullable": true, + "example": "2022-08-16T17:43:26.991388Z", + "description": "The description of the NFT" + }, + "image": { + "type": "string", + "nullable": true, + "description": "The image url of the NFT", + "example": "https://some-url" + }, + "external_url": { + "type": "string", + "nullable": true, + "description": "The external website link of NFT", + "example": "https://some-url" + }, + "animation_url": { + "type": "string", + "nullable": true, + "description": "The animation url of the NFT", + "example": "https://some-url" + }, + "youtube_url": { + "type": "string", + "nullable": true, + "description": "The youtube URL of NFT", + "example": "https://some-url" + }, + "attributes": { + "type": "array", + "description": "List of Metadata attributes", + "nullable": true, + "items": { + "$ref": "#/components/schemas/NFTMetadataAttribute" + } + }, + "balance": { + "type": "integer", + "description": "Balance of NFT", + "minimum": 1, + "nullable": true + } + }, + "required": [ + "token_id", + "stack_id", + "chain", + "contract_address", + "contract_type", + "updated_at", + "created_at", + "name", + "description", + "image", + "external_url", + "animation_url", + "youtube_url", + "attributes", + "balance" + ] + }, + "MarketPriceNativeToken": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Token type user is offering, which in this case is the native IMX token", + "example": "NATIVE", + "enum": [ + "NATIVE" + ] + }, + "symbol": { + "nullable": true, + "type": "string", + "description": "The symbol of token", + "example": "IMX" + } + }, + "required": [ + "type", + "symbol" + ] + }, + "MarketPriceERC20Token": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Token type user is offering, which in this case is ERC20", + "example": "ERC20", + "enum": [ + "ERC20" + ] + }, + "contract_address": { + "type": "string", + "description": "Address of ERC20 token", + "example": "0x0165878A594ca255338adfa4d48449f69242Eb8F", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "symbol": { + "nullable": true, + "type": "string", + "description": "The symbol of token", + "example": "ETH" + }, + "decimals": { + "nullable": true, + "type": "integer", + "description": "The decimals of token", + "example": 18 + } + }, + "required": [ + "type", + "contract_address", + "symbol", + "decimals" + ] + }, + "PaymentAmount": { + "type": "string", + "description": "The token amount value. This value is provided in the smallest unit of the token (e.g. wei for ETH)", + "example": "9750000000000000000", + "pattern": "\\d+" + }, + "MarketPriceFees": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "description": "Fee in the payment currency", + "example": "1000000000000000000" + }, + "type": { + "type": "string", + "description": "Fee type", + "example": "ROYALTY", + "enum": [ + "ROYALTY", + "MAKER_ECOSYSTEM", + "TAKER_ECOSYSTEM", + "PROTOCOL" + ] + }, + "recipient_address": { + "type": "string", + "description": "Wallet address of fee recipient", + "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, + "example": { + "amount": "1000000000000000000", + "type": "ROYALTY", + "recipient_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233" + }, + "required": [ + "type", + "amount", + "recipient_address" + ] + }, + "MarketPriceDetails": { + "type": "object", + "description": "Market Price details", + "properties": { + "token": { + "description": "Token details", + "oneOf": [ + { + "$ref": "#/components/schemas/MarketPriceNativeToken" + }, + { + "$ref": "#/components/schemas/MarketPriceERC20Token" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "NATIVE": "#/components/schemas/MarketPriceNativeToken", + "ERC20": "#/components/schemas/MarketPriceERC20Token" + } + } + }, + "amount": { + "$ref": "#/components/schemas/PaymentAmount" + }, + "fee_inclusive_amount": { + "$ref": "#/components/schemas/PaymentAmount" + }, + "fees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MarketPriceFees" + }, + "example": [ + { + "type": "TAKER_ECOSYSTEM", + "recipient_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92233", + "amount": "1000000000000000000" + } + ] + } + }, + "required": [ + "token", + "amount", + "fee_inclusive_amount", + "fees" + ] + }, + "ConvertedPrices": { + "type": "object", + "description": "A mapping of converted prices for major currencies such as ETH, USD. All converted prices are fee-inclusive.", + "additionalProperties": { + "type": "string" + }, + "example": { + "ETH": "0.0058079775", + "USD": "15.89" + } + }, + "Listing": { + "type": "object", + "properties": { + "listing_id": { + "type": "string", + "description": "Global Order identifier", + "example": "018792C9-4AD7-8EC4-4038-9E05C598534A" + }, + "price_details": { + "$ref": "#/components/schemas/MarketPriceDetails" + }, + "converted_prices": { + "$ref": "#/components/schemas/ConvertedPrices" + }, + "token_id": { + "type": "string", + "description": "Token ID", + "example": "1" + }, + "contract_address": { + "type": "string", + "description": "ETH Address of collection that the asset belongs to", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "creator": { + "type": "string", + "description": "ETH Address of listing creator", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "amount": { + "type": "string", + "description": "Amount of token included in the listing", + "example": "1" + } + }, + "required": [ + "listing_id", + "price_details", + "converted_prices", + "creator", + "token_id", + "contract_address", + "amount" + ] + }, + "LastTrade": { + "type": "object", + "nullable": true, + "description": "Most recent trade", + "properties": { + "trade_id": { + "type": "string", + "description": "Trade ID", + "format": "uuid", + "example": "4e28df8d-f65c-4c11-ba04-6a9dd47b179b" + }, + "contract_address": { + "type": "string", + "description": "ETH Address of collection that the asset belongs to", + "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" + }, + "token_id": { + "type": "string", + "description": "Token id of the traded asset (uint256 as string)", + "example": "1" + }, + "price_details": { + "type": "array", + "description": "Price details, list of payments involved in this trade", + "items": { + "$ref": "#/components/schemas/MarketPriceDetails" + } + }, + "amount": { + "type": "string", + "description": "Amount of the trade (uint256 as string)", + "example": "1" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "When the trade was created", + "example": "2022-08-16T17:43:26.991388Z" + } + }, + "required": [ + "trade_id", + "token_id", + "contract_address", + "price_details", + "amount", + "created_at" + ] + }, + "Market": { + "type": "object", + "description": "Market data", + "properties": { + "floor_listing": { + "description": "Cheapest active listing", + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Listing" + } + ] + }, + "last_trade": { + "$ref": "#/components/schemas/LastTrade" + } + }, + "required": [ + "floor_listing", + "last_trade" + ] + }, + "NFTBundle": { + "type": "object", + "description": "NFT bundle includes NFT with stack, markets and listings", + "properties": { + "nft_with_stack": { + "$ref": "#/components/schemas/NFTWithStack" + }, + "market": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Market" + } + ] + }, + "listings": { + "type": "array", + "description": "List of open listings for the stack.", + "maxItems": 10, + "items": { + "$ref": "#/components/schemas/Listing" + } + } + }, + "required": [ + "nft_with_stack", + "market", + "listings" + ] + }, + "SearchNFTsResult": { + "type": "object", + "description": "Search NFTs result", + "properties": { + "result": { + "type": "array", + "description": "List of nft bundles", + "items": { + "$ref": "#/components/schemas/NFTBundle" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "Stack": { + "type": "object", + "description": "Stack", + "properties": { + "stack_id": { + "type": "string", + "format": "uuid", + "description": "Stack ID" + }, + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "contract_address": { + "type": "string", + "description": "Contract address" + }, + "contract_type": { + "$ref": "#/components/schemas/MarketplaceContractType" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the metadata was created" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "When the metadata was last updated", + "example": "2022-08-16T17:43:26.991388Z" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Sword", + "description": "The name of the NFT" + }, + "description": { + "type": "string", + "nullable": true, + "example": "2022-08-16T17:43:26.991388Z", + "description": "The description of the NFT" + }, + "image": { + "type": "string", + "nullable": true, + "description": "The image url of the NFT", + "example": "https://some-url" + }, + "external_url": { + "type": "string", + "nullable": true, + "description": "The external website link of NFT", + "example": "https://some-url" + }, + "animation_url": { + "type": "string", + "nullable": true, + "description": "The animation url of the NFT", + "example": "https://some-url" + }, + "youtube_url": { + "type": "string", + "nullable": true, + "description": "The youtube URL of NFT", + "example": "https://some-url" + }, + "attributes": { + "type": "array", + "description": "List of Metadata attributes", + "nullable": true, + "items": { + "$ref": "#/components/schemas/NFTMetadataAttribute" + } + } + }, + "required": [ + "stack_id", + "chain", + "contract_address", + "contract_type", + "updated_at", + "created_at", + "name", + "description", + "image", + "external_url", + "animation_url", + "youtube_url", + "attributes" + ] + }, + "StackBundle": { + "type": "object", + "description": "Stack bundle includes stacks, markets and listings", + "properties": { + "stack": { + "$ref": "#/components/schemas/Stack" + }, + "stack_count": { + "type": "integer", + "description": "Total count of NFTs in the stack matching the filter params", + "example": 1 + }, + "market": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Market" + } + ] + }, + "listings": { + "type": "array", + "description": "List of open listings for the stack.", + "maxItems": 10, + "items": { + "$ref": "#/components/schemas/Listing" + } + } + }, + "required": [ + "stack", + "stack_count", + "market", + "listings" + ] + }, + "SearchStacksResult": { + "type": "object", + "description": "Search stacks result", + "properties": { + "result": { + "type": "array", + "description": "List of stack bundles", + "items": { + "$ref": "#/components/schemas/StackBundle" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "StackQuoteResult": { + "type": "object", + "description": "Stack quote result", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "stack_id": { + "format": "uuid", + "type": "string" + }, + "market_stack": { + "$ref": "#/components/schemas/Market" + }, + "market_collection": { + "$ref": "#/components/schemas/Market" + } + }, + "required": [ + "stack_id", + "market_stack", + "market_collection", + "chain" + ] + }, + "QuotesForStacksResult": { + "type": "object", + "description": "Quotes for stacks result", + "properties": { + "result": { + "type": "array", + "description": "List of quotes", + "items": { + "$ref": "#/components/schemas/StackQuoteResult" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + }, + "MarketNft": { + "type": "object", + "description": "NFT market data", + "properties": { + "last_trade": { + "$ref": "#/components/schemas/LastTrade" + } + }, + "required": [ + "last_trade" + ] + }, + "NFTQuoteResult": { + "type": "object", + "description": "NFT quote result", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "token_id": { + "description": "Token id of NFT (uint256 as string)", + "type": "string" + }, + "market_stack": { + "$ref": "#/components/schemas/Market" + }, + "market_nft": { + "$ref": "#/components/schemas/MarketNft" + }, + "market_collection": { + "$ref": "#/components/schemas/Market" + } + }, + "required": [ + "token_id", + "market_stack", + "market_nft", + "market_collection", + "chain" + ] + }, + "QuotesForNFTsResult": { + "type": "object", + "description": "Quotes for NFTs result", + "properties": { + "result": { + "type": "array", + "description": "List of quotes", + "items": { + "$ref": "#/components/schemas/NFTQuoteResult" + } + }, + "page": { + "$ref": "#/components/schemas/Page" + } + }, + "required": [ + "result", + "page" + ] + } + } + }, + "x-tagGroups": [ + { + "name": "Multi Rollup API", + "tags": [ + "activities", + "chains", + "collections", + "nfts", + "nft owners", + "metadata", + "tokens", + "demopage", + "verification", + "operatorallowlist", + "crafting", + "listings", + "orders" + ] + }, + { + "name": "Passport MR", + "tags": [ + "passport" + ] + }, + { + "name": "Passport Profile Service API", + "tags": [ + "passport profile" + ] + }, + { + "name": "Guardian", + "tags": [ + "guardian" + ] + }, + { + "name": "Indexer Marketplace APIs", + "tags": [ + "pricing", + "stacks" + ] + } + ] +}