diff --git a/Source/ImmutablezkEVMAPI/.openapi-generator-ignore b/Source/ImmutablezkEVMAPI/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/Source/ImmutablezkEVMAPI/.openapi-generator/FILES b/Source/ImmutablezkEVMAPI/.openapi-generator/FILES new file mode 100644 index 0000000..3e824cc --- /dev/null +++ b/Source/ImmutablezkEVMAPI/.openapi-generator/FILES @@ -0,0 +1,377 @@ +ImmutablezkEVMAPI.Build.cs +Private/APIAPIError400.cpp +Private/APIAPIError401.cpp +Private/APIAPIError403.cpp +Private/APIAPIError404.cpp +Private/APIAPIError409.cpp +Private/APIAPIError429.cpp +Private/APIAPIError500.cpp +Private/APIAPIError501.cpp +Private/APIActiveOrderStatus.cpp +Private/APIActivitiesApi.cpp +Private/APIActivitiesApiOperations.cpp +Private/APIActivity.cpp +Private/APIActivityAsset.cpp +Private/APIActivityDetails.cpp +Private/APIActivityNFT.cpp +Private/APIActivityNativeToken.cpp +Private/APIActivityToken.cpp +Private/APIActivityType.cpp +Private/APIAssetCollectionItem.cpp +Private/APIAssetVerificationStatus.cpp +Private/APIBaseModel.cpp +Private/APIBasicAPIError.cpp +Private/APIBid.cpp +Private/APIBidResult.cpp +Private/APIBlockchainMetadata.cpp +Private/APIBurn.cpp +Private/APICall.cpp +Private/APICancelOrdersRequestBody.cpp +Private/APICancelOrdersResult.cpp +Private/APICancelOrdersResultData.cpp +Private/APICancelledOrderStatus.cpp +Private/APIChain.cpp +Private/APIChainWithDetails.cpp +Private/APIChainsApi.cpp +Private/APIChainsApiOperations.cpp +Private/APICollection.cpp +Private/APICollectionBidResult.cpp +Private/APICollectionContractType.cpp +Private/APICollectionMetadata.cpp +Private/APICollectionsApi.cpp +Private/APICollectionsApiOperations.cpp +Private/APICraftingApi.cpp +Private/APICraftingApiOperations.cpp +Private/APICreateBidRequestBody.cpp +Private/APICreateCollectionBidRequestBody.cpp +Private/APICreateListingRequestBody.cpp +Private/APICreateMintRequestRequest.cpp +Private/APICreateMintRequestResult.cpp +Private/APIDeposit.cpp +Private/APIERC1155CollectionItem.cpp +Private/APIERC1155Item.cpp +Private/APIERC20Item.cpp +Private/APIERC721CollectionItem.cpp +Private/APIERC721Item.cpp +Private/APIExpiredOrderStatus.cpp +Private/APIFailedOrderCancellation.cpp +Private/APIFee.cpp +Private/APIFillStatus.cpp +Private/APIFilledOrderStatus.cpp +Private/APIFilter.cpp +Private/APIFilterResult.cpp +Private/APIFilterValue.cpp +Private/APIFulfillableOrder.cpp +Private/APIFulfillmentData200Response.cpp +Private/APIFulfillmentData200ResponseResult.cpp +Private/APIFulfillmentDataRequest.cpp +Private/APIGetActivityResult.cpp +Private/APIGetCollectionResult.cpp +Private/APIGetLinkedAddressesRes.cpp +Private/APIGetMetadataResult.cpp +Private/APIGetMintRequestResult.cpp +Private/APIGetNFTResult.cpp +Private/APIGetTokenResult.cpp +Private/APIHelpers.cpp +Private/APIInactiveOrderStatus.cpp +Private/APIItem.cpp +Private/APILastTrade.cpp +Private/APILinkWalletV2Request.cpp +Private/APIListActivitiesResult.cpp +Private/APIListBidsResult.cpp +Private/APIListChainsResult.cpp +Private/APIListCollectionBidsResult.cpp +Private/APIListCollectionOwnersResult.cpp +Private/APIListCollectionsResult.cpp +Private/APIListFiltersResult.cpp +Private/APIListListingsResult.cpp +Private/APIListMetadataResult.cpp +Private/APIListMintRequestsResult.cpp +Private/APIListNFTOwnersResult.cpp +Private/APIListNFTsByOwnerResult.cpp +Private/APIListNFTsResult.cpp +Private/APIListTokensResult.cpp +Private/APIListTradeResult.cpp +Private/APIListing.cpp +Private/APIListingResult.cpp +Private/APIMarket.cpp +Private/APIMarketNft.cpp +Private/APIMarketPriceDetails.cpp +Private/APIMarketPriceDetailsToken.cpp +Private/APIMarketPriceERC20Token.cpp +Private/APIMarketPriceFees.cpp +Private/APIMarketPriceNativeToken.cpp +Private/APIMarketplaceContractType.cpp +Private/APIMetadata.cpp +Private/APIMetadataApi.cpp +Private/APIMetadataApiOperations.cpp +Private/APIMetadataRefreshRateLimitResult.cpp +Private/APIMetadataSearchApi.cpp +Private/APIMetadataSearchApiOperations.cpp +Private/APIMint.cpp +Private/APIMintAsset.cpp +Private/APIMintRequestErrorMessage.cpp +Private/APIMintRequestStatus.cpp +Private/APINFT.cpp +Private/APINFTBundle.cpp +Private/APINFTContractType.cpp +Private/APINFTMetadataAttribute.cpp +Private/APINFTMetadataAttributeValue.cpp +Private/APINFTMetadataRequest.cpp +Private/APINFTOwner.cpp +Private/APINFTQuoteResult.cpp +Private/APINFTSale.cpp +Private/APINFTWithBalance.cpp +Private/APINFTWithOwner.cpp +Private/APINFTWithStack.cpp +Private/APINativeItem.cpp +Private/APINftOwnersApi.cpp +Private/APINftOwnersApiOperations.cpp +Private/APINftsApi.cpp +Private/APINftsApiOperations.cpp +Private/APIOperatorAllowlistContractStatus.cpp +Private/APIOperatorAllowlistContractStatusInternal.cpp +Private/APIOperatorAllowlistStatus.cpp +Private/APIOperatorAllowlistStatusDetails.cpp +Private/APIOperatorAllowlistStatusRequested.cpp +Private/APIOperatorAllowlistStatusUpdated.cpp +Private/APIOrder.cpp +Private/APIOrderStatus.cpp +Private/APIOrderStatusName.cpp +Private/APIOrdersApi.cpp +Private/APIOrdersApiOperations.cpp +Private/APIOrganisationTier.cpp +Private/APIPage.cpp +Private/APIPassportApi.cpp +Private/APIPassportApiOperations.cpp +Private/APIPassportProfileApi.cpp +Private/APIPassportProfileApiOperations.cpp +Private/APIPendingOrderStatus.cpp +Private/APIPricingApi.cpp +Private/APIPricingApiOperations.cpp +Private/APIProtocolData.cpp +Private/APIQuotesForNFTsResult.cpp +Private/APIQuotesForStacksResult.cpp +Private/APIRefreshCollectionMetadataRequest.cpp +Private/APIRefreshCollectionMetadataResult.cpp +Private/APIRefreshMetadataByID.cpp +Private/APIRefreshMetadataByIDRequest.cpp +Private/APIRefreshMetadataByTokenID.cpp +Private/APIRefreshNFTMetadataByTokenIDRequest.cpp +Private/APIRefreshableNFTAttributes.cpp +Private/APISaleFee.cpp +Private/APISalePayment.cpp +Private/APISalePaymentToken.cpp +Private/APISearchNFTsResult.cpp +Private/APISearchStacksResult.cpp +Private/APISignCraftingRequest.cpp +Private/APISignCraftingRequestMultiCaller.cpp +Private/APISignCraftingResult.cpp +Private/APIStack.cpp +Private/APIStackBundle.cpp +Private/APIStackQuoteResult.cpp +Private/APIToken.cpp +Private/APITokenContractType.cpp +Private/APITokensApi.cpp +Private/APITokensApiOperations.cpp +Private/APITrade.cpp +Private/APITradeBlockchainMetadata.cpp +Private/APITradeResult.cpp +Private/APITransfer.cpp +Private/APIUnfulfillableOrder.cpp +Private/APIUserInfo.cpp +Private/APIVerificationRequest.cpp +Private/APIVerificationRequestContractType.cpp +Private/APIVerificationRequestInternal.cpp +Private/APIVerificationRequestStatus.cpp +Private/APIWallet.cpp +Private/APIWithdrawal.cpp +Private/ImmutablezkEVMAPIModule.cpp +Private/ImmutablezkEVMAPIModule.h +Public/APIAPIError400.h +Public/APIAPIError401.h +Public/APIAPIError403.h +Public/APIAPIError404.h +Public/APIAPIError409.h +Public/APIAPIError429.h +Public/APIAPIError500.h +Public/APIAPIError501.h +Public/APIActiveOrderStatus.h +Public/APIActivitiesApi.h +Public/APIActivitiesApiOperations.h +Public/APIActivity.h +Public/APIActivityAsset.h +Public/APIActivityDetails.h +Public/APIActivityNFT.h +Public/APIActivityNativeToken.h +Public/APIActivityToken.h +Public/APIActivityType.h +Public/APIAssetCollectionItem.h +Public/APIAssetVerificationStatus.h +Public/APIBaseModel.h +Public/APIBasicAPIError.h +Public/APIBid.h +Public/APIBidResult.h +Public/APIBlockchainMetadata.h +Public/APIBurn.h +Public/APICall.h +Public/APICancelOrdersRequestBody.h +Public/APICancelOrdersResult.h +Public/APICancelOrdersResultData.h +Public/APICancelledOrderStatus.h +Public/APIChain.h +Public/APIChainWithDetails.h +Public/APIChainsApi.h +Public/APIChainsApiOperations.h +Public/APICollection.h +Public/APICollectionBidResult.h +Public/APICollectionContractType.h +Public/APICollectionMetadata.h +Public/APICollectionsApi.h +Public/APICollectionsApiOperations.h +Public/APICraftingApi.h +Public/APICraftingApiOperations.h +Public/APICreateBidRequestBody.h +Public/APICreateCollectionBidRequestBody.h +Public/APICreateListingRequestBody.h +Public/APICreateMintRequestRequest.h +Public/APICreateMintRequestResult.h +Public/APIDeposit.h +Public/APIERC1155CollectionItem.h +Public/APIERC1155Item.h +Public/APIERC20Item.h +Public/APIERC721CollectionItem.h +Public/APIERC721Item.h +Public/APIExpiredOrderStatus.h +Public/APIFailedOrderCancellation.h +Public/APIFee.h +Public/APIFillStatus.h +Public/APIFilledOrderStatus.h +Public/APIFilter.h +Public/APIFilterResult.h +Public/APIFilterValue.h +Public/APIFulfillableOrder.h +Public/APIFulfillmentData200Response.h +Public/APIFulfillmentData200ResponseResult.h +Public/APIFulfillmentDataRequest.h +Public/APIGetActivityResult.h +Public/APIGetCollectionResult.h +Public/APIGetLinkedAddressesRes.h +Public/APIGetMetadataResult.h +Public/APIGetMintRequestResult.h +Public/APIGetNFTResult.h +Public/APIGetTokenResult.h +Public/APIHelpers.h +Public/APIInactiveOrderStatus.h +Public/APIItem.h +Public/APILastTrade.h +Public/APILinkWalletV2Request.h +Public/APIListActivitiesResult.h +Public/APIListBidsResult.h +Public/APIListChainsResult.h +Public/APIListCollectionBidsResult.h +Public/APIListCollectionOwnersResult.h +Public/APIListCollectionsResult.h +Public/APIListFiltersResult.h +Public/APIListListingsResult.h +Public/APIListMetadataResult.h +Public/APIListMintRequestsResult.h +Public/APIListNFTOwnersResult.h +Public/APIListNFTsByOwnerResult.h +Public/APIListNFTsResult.h +Public/APIListTokensResult.h +Public/APIListTradeResult.h +Public/APIListing.h +Public/APIListingResult.h +Public/APIMarket.h +Public/APIMarketNft.h +Public/APIMarketPriceDetails.h +Public/APIMarketPriceDetailsToken.h +Public/APIMarketPriceERC20Token.h +Public/APIMarketPriceFees.h +Public/APIMarketPriceNativeToken.h +Public/APIMarketplaceContractType.h +Public/APIMetadata.h +Public/APIMetadataApi.h +Public/APIMetadataApiOperations.h +Public/APIMetadataRefreshRateLimitResult.h +Public/APIMetadataSearchApi.h +Public/APIMetadataSearchApiOperations.h +Public/APIMint.h +Public/APIMintAsset.h +Public/APIMintRequestErrorMessage.h +Public/APIMintRequestStatus.h +Public/APINFT.h +Public/APINFTBundle.h +Public/APINFTContractType.h +Public/APINFTMetadataAttribute.h +Public/APINFTMetadataAttributeValue.h +Public/APINFTMetadataRequest.h +Public/APINFTOwner.h +Public/APINFTQuoteResult.h +Public/APINFTSale.h +Public/APINFTWithBalance.h +Public/APINFTWithOwner.h +Public/APINFTWithStack.h +Public/APINativeItem.h +Public/APINftOwnersApi.h +Public/APINftOwnersApiOperations.h +Public/APINftsApi.h +Public/APINftsApiOperations.h +Public/APIOperatorAllowlistContractStatus.h +Public/APIOperatorAllowlistContractStatusInternal.h +Public/APIOperatorAllowlistStatus.h +Public/APIOperatorAllowlistStatusDetails.h +Public/APIOperatorAllowlistStatusRequested.h +Public/APIOperatorAllowlistStatusUpdated.h +Public/APIOrder.h +Public/APIOrderStatus.h +Public/APIOrderStatusName.h +Public/APIOrdersApi.h +Public/APIOrdersApiOperations.h +Public/APIOrganisationTier.h +Public/APIPage.h +Public/APIPassportApi.h +Public/APIPassportApiOperations.h +Public/APIPassportProfileApi.h +Public/APIPassportProfileApiOperations.h +Public/APIPendingOrderStatus.h +Public/APIPricingApi.h +Public/APIPricingApiOperations.h +Public/APIProtocolData.h +Public/APIQuotesForNFTsResult.h +Public/APIQuotesForStacksResult.h +Public/APIRefreshCollectionMetadataRequest.h +Public/APIRefreshCollectionMetadataResult.h +Public/APIRefreshMetadataByID.h +Public/APIRefreshMetadataByIDRequest.h +Public/APIRefreshMetadataByTokenID.h +Public/APIRefreshNFTMetadataByTokenIDRequest.h +Public/APIRefreshableNFTAttributes.h +Public/APISaleFee.h +Public/APISalePayment.h +Public/APISalePaymentToken.h +Public/APISearchNFTsResult.h +Public/APISearchStacksResult.h +Public/APISignCraftingRequest.h +Public/APISignCraftingRequestMultiCaller.h +Public/APISignCraftingResult.h +Public/APIStack.h +Public/APIStackBundle.h +Public/APIStackQuoteResult.h +Public/APIToken.h +Public/APITokenContractType.h +Public/APITokensApi.h +Public/APITokensApiOperations.h +Public/APITrade.h +Public/APITradeBlockchainMetadata.h +Public/APITradeResult.h +Public/APITransfer.h +Public/APIUnfulfillableOrder.h +Public/APIUserInfo.h +Public/APIVerificationRequest.h +Public/APIVerificationRequestContractType.h +Public/APIVerificationRequestInternal.h +Public/APIVerificationRequestStatus.h +Public/APIWallet.h +Public/APIWithdrawal.h diff --git a/Source/ImmutablezkEVMAPI/.openapi-generator/VERSION b/Source/ImmutablezkEVMAPI/.openapi-generator/VERSION new file mode 100644 index 0000000..758bb9c --- /dev/null +++ b/Source/ImmutablezkEVMAPI/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0 diff --git a/Source/ImmutablezkEVMAPI/Private/APIBid.cpp b/Source/ImmutablezkEVMAPI/Private/APIBid.cpp new file mode 100644 index 0000000..32cfd3a --- /dev/null +++ b/Source/ImmutablezkEVMAPI/Private/APIBid.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 "APIBid.h" + +#include "ImmutablezkEVMAPIModule.h" +#include "APIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace ImmutablezkEVMAPI +{ + +void APIBid::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("bid_id")); WriteJsonValue(Writer, BidId); + Writer->WriteIdentifierPrefix(TEXT("price_details")); WriteJsonValue(Writer, PriceDetails); + if (TokenId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("token_id")); WriteJsonValue(Writer, TokenId.GetValue()); + } + 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 APIBid::FromJson(const TSharedPtr& JsonValue) +{ + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(*Object, TEXT("bid_id"), BidId); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("price_details"), PriceDetails); + 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/ImmutablezkEVMAPI/Private/APIMarket.cpp b/Source/ImmutablezkEVMAPI/Private/APIMarket.cpp index ac32057..bc9c17b 100644 --- a/Source/ImmutablezkEVMAPI/Private/APIMarket.cpp +++ b/Source/ImmutablezkEVMAPI/Private/APIMarket.cpp @@ -27,6 +27,10 @@ void APIMarket::WriteJson(JsonWriter& Writer) const { Writer->WriteIdentifierPrefix(TEXT("floor_listing")); WriteJsonValue(Writer, FloorListing.GetValue()); } + if (TopBid.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("top_bid")); WriteJsonValue(Writer, TopBid.GetValue()); + } if (LastTrade.IsSet()) { Writer->WriteIdentifierPrefix(TEXT("last_trade")); WriteJsonValue(Writer, LastTrade.GetValue()); @@ -43,6 +47,7 @@ bool APIMarket::FromJson(const TSharedPtr& JsonValue) bool ParseSuccess = true; ParseSuccess &= TryGetJsonValue(*Object, TEXT("floor_listing"), FloorListing); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("top_bid"), TopBid); ParseSuccess &= TryGetJsonValue(*Object, TEXT("last_trade"), LastTrade); return ParseSuccess; diff --git a/Source/ImmutablezkEVMAPI/Private/APIMetadataSearchApiOperations.cpp b/Source/ImmutablezkEVMAPI/Private/APIMetadataSearchApiOperations.cpp index 75224ca..d8d179e 100644 --- a/Source/ImmutablezkEVMAPI/Private/APIMetadataSearchApiOperations.cpp +++ b/Source/ImmutablezkEVMAPI/Private/APIMetadataSearchApiOperations.cpp @@ -234,6 +234,10 @@ FString APIMetadataSearchApi::SearchStacksRequest::ComputePath() const { QueryParams.Add(FString(TEXT("keyword=")) + ToUrlString(Keyword.GetValue())); } + if(PaymentToken.IsSet()) + { + QueryParams.Add(FString(TEXT("payment_token=")) + ToUrlString(PaymentToken.GetValue())); + } if(SortBy.IsSet()) { QueryParams.Add(FString(TEXT("sort_by=")) + ToUrlString(SortBy.GetValue())); diff --git a/Source/ImmutablezkEVMAPI/Private/APINFTBundle.cpp b/Source/ImmutablezkEVMAPI/Private/APINFTBundle.cpp index 4e51178..b4f3ad7 100644 --- a/Source/ImmutablezkEVMAPI/Private/APINFTBundle.cpp +++ b/Source/ImmutablezkEVMAPI/Private/APINFTBundle.cpp @@ -29,6 +29,7 @@ void APINFTBundle::WriteJson(JsonWriter& Writer) const Writer->WriteIdentifierPrefix(TEXT("market")); WriteJsonValue(Writer, Market.GetValue()); } Writer->WriteIdentifierPrefix(TEXT("listings")); WriteJsonValue(Writer, Listings); + Writer->WriteIdentifierPrefix(TEXT("bids")); WriteJsonValue(Writer, Bids); Writer->WriteObjectEnd(); } @@ -43,6 +44,7 @@ bool APINFTBundle::FromJson(const TSharedPtr& JsonValue) ParseSuccess &= TryGetJsonValue(*Object, TEXT("nft_with_stack"), NftWithStack); ParseSuccess &= TryGetJsonValue(*Object, TEXT("market"), Market); ParseSuccess &= TryGetJsonValue(*Object, TEXT("listings"), Listings); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("bids"), Bids); return ParseSuccess; } diff --git a/Source/ImmutablezkEVMAPI/Private/APIPricingApiOperations.cpp b/Source/ImmutablezkEVMAPI/Private/APIPricingApiOperations.cpp index d4c6db6..19fda9e 100644 --- a/Source/ImmutablezkEVMAPI/Private/APIPricingApiOperations.cpp +++ b/Source/ImmutablezkEVMAPI/Private/APIPricingApiOperations.cpp @@ -33,6 +33,10 @@ FString APIPricingApi::QuotesForNFTsRequest::ComputePath() const TArray QueryParams; QueryParams.Add(CollectionToUrlString_multi(TokenId, TEXT("token_id"))); + if(PaymentToken.IsSet()) + { + QueryParams.Add(FString(TEXT("payment_token=")) + ToUrlString(PaymentToken.GetValue())); + } if(PageCursor.IsSet()) { QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); @@ -96,6 +100,10 @@ FString APIPricingApi::QuotesForStacksRequest::ComputePath() const TArray QueryParams; QueryParams.Add(CollectionToUrlString_multi(StackId, TEXT("stack_id"))); + if(PaymentToken.IsSet()) + { + QueryParams.Add(FString(TEXT("payment_token=")) + ToUrlString(PaymentToken.GetValue())); + } if(PageCursor.IsSet()) { QueryParams.Add(FString(TEXT("page_cursor=")) + ToUrlString(PageCursor.GetValue())); diff --git a/Source/ImmutablezkEVMAPI/Private/APIStackBundle.cpp b/Source/ImmutablezkEVMAPI/Private/APIStackBundle.cpp index 84638b0..4aff994 100644 --- a/Source/ImmutablezkEVMAPI/Private/APIStackBundle.cpp +++ b/Source/ImmutablezkEVMAPI/Private/APIStackBundle.cpp @@ -30,6 +30,7 @@ void APIStackBundle::WriteJson(JsonWriter& Writer) const Writer->WriteIdentifierPrefix(TEXT("market")); WriteJsonValue(Writer, Market.GetValue()); } Writer->WriteIdentifierPrefix(TEXT("listings")); WriteJsonValue(Writer, Listings); + Writer->WriteIdentifierPrefix(TEXT("bids")); WriteJsonValue(Writer, Bids); Writer->WriteObjectEnd(); } @@ -45,6 +46,7 @@ bool APIStackBundle::FromJson(const TSharedPtr& JsonValue) ParseSuccess &= TryGetJsonValue(*Object, TEXT("stack_count"), StackCount); ParseSuccess &= TryGetJsonValue(*Object, TEXT("market"), Market); ParseSuccess &= TryGetJsonValue(*Object, TEXT("listings"), Listings); + ParseSuccess &= TryGetJsonValue(*Object, TEXT("bids"), Bids); return ParseSuccess; } diff --git a/Source/ImmutablezkEVMAPI/Public/APIBid.h b/Source/ImmutablezkEVMAPI/Public/APIBid.h new file mode 100644 index 0000000..8af746b --- /dev/null +++ b/Source/ImmutablezkEVMAPI/Public/APIBid.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 "APIMarketPriceDetails.h" + +namespace ImmutablezkEVMAPI +{ + +/* + * APIBid + * + * + */ +class IMMUTABLEZKEVMAPI_API APIBid : public Model +{ +public: + virtual ~APIBid() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + /* Global Order identifier */ + FString BidId; + APIMarketPriceDetails PriceDetails; + /* Token ID. Null for collection bids that can be fulfilled by any asset in the collection */ + TOptional 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/ImmutablezkEVMAPI/Public/APICancelOrdersRequestBody.h b/Source/ImmutablezkEVMAPI/Public/APICancelOrdersRequestBody.h index 583312b..f2cb774 100644 --- a/Source/ImmutablezkEVMAPI/Public/APICancelOrdersRequestBody.h +++ b/Source/ImmutablezkEVMAPI/Public/APICancelOrdersRequestBody.h @@ -32,7 +32,7 @@ class IMMUTABLEZKEVMAPI_API APICancelOrdersRequestBody : public Model /* Address of the user initiating the cancel request */ FString AccountAddress; /* List of order ids proposed for cancellation */ - TArray Orders; + TSet Orders; /* Signature generated by the user for the specific cancellation request */ FString Signature; }; diff --git a/Source/ImmutablezkEVMAPI/Public/APIHelpers.h b/Source/ImmutablezkEVMAPI/Public/APIHelpers.h index b55adc0..b587a70 100644 --- a/Source/ImmutablezkEVMAPI/Public/APIHelpers.h +++ b/Source/ImmutablezkEVMAPI/Public/APIHelpers.h @@ -295,6 +295,17 @@ inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) Writer->WriteArrayEnd(); } +template +inline void WriteJsonValue(JsonWriter& Writer, const TSet& Value) +{ + Writer->WriteArrayStart(); + for (const auto& Element : Value) + { + WriteJsonValue(Writer, Element); + } + Writer->WriteArrayEnd(); +} + template inline void WriteJsonValue(JsonWriter& Writer, const TMap& Value) { @@ -424,6 +435,26 @@ inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& return false; } +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSet& SetValue) +{ + const TArray>* JsonArray; + if (JsonValue->TryGetArray(JsonArray)) + { + bool ParseSuccess = true; + const int32 Count = JsonArray->Num(); + SetValue.Reset(); + for (int i = 0; i < Count; i++) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue((*JsonArray)[i], TmpValue); + SetValue.Emplace(MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + template inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TMap& MapValue) { diff --git a/Source/ImmutablezkEVMAPI/Public/APIMarket.h b/Source/ImmutablezkEVMAPI/Public/APIMarket.h index cf61f09..b9516be 100644 --- a/Source/ImmutablezkEVMAPI/Public/APIMarket.h +++ b/Source/ImmutablezkEVMAPI/Public/APIMarket.h @@ -13,6 +13,7 @@ #pragma once #include "APIBaseModel.h" +#include "APIBid.h" #include "APILastTrade.h" #include "APIListing.h" @@ -33,6 +34,8 @@ class IMMUTABLEZKEVMAPI_API APIMarket : public Model /* Cheapest active listing */ TOptional FloorListing; + /* Highest active big */ + TOptional TopBid; TOptional LastTrade; }; diff --git a/Source/ImmutablezkEVMAPI/Public/APIMetadataSearchApiOperations.h b/Source/ImmutablezkEVMAPI/Public/APIMetadataSearchApiOperations.h index 69d29ec..0c47914 100644 --- a/Source/ImmutablezkEVMAPI/Public/APIMetadataSearchApiOperations.h +++ b/Source/ImmutablezkEVMAPI/Public/APIMetadataSearchApiOperations.h @@ -117,6 +117,8 @@ class IMMUTABLEZKEVMAPI_API APIMetadataSearchApi::SearchStacksRequest : public R TOptional Traits; /* Keyword to search NFT name and description. Alphanumeric characters only. */ TOptional Keyword; + /* Filters the active listings, bids, floor listing and top bid by the specified payment token, either the address of the payment token contract or 'NATIVE' */ + TOptional PaymentToken; enum class SortByEnum { CheapestFirst, diff --git a/Source/ImmutablezkEVMAPI/Public/APINFTBundle.h b/Source/ImmutablezkEVMAPI/Public/APINFTBundle.h index ceb3113..23621b7 100644 --- a/Source/ImmutablezkEVMAPI/Public/APINFTBundle.h +++ b/Source/ImmutablezkEVMAPI/Public/APINFTBundle.h @@ -13,6 +13,7 @@ #pragma once #include "APIBaseModel.h" +#include "APIBid.h" #include "APIListing.h" #include "APIMarket.h" #include "APINFTWithStack.h" @@ -34,8 +35,10 @@ class IMMUTABLEZKEVMAPI_API APINFTBundle : public Model APINFTWithStack NftWithStack; TOptional Market; - /* List of open listings for the stack. */ + /* List of open listings for the NFT. */ TArray Listings; + /* List of open bids for the NFT. */ + TArray Bids; }; } diff --git a/Source/ImmutablezkEVMAPI/Public/APINFTMetadataAttribute.h b/Source/ImmutablezkEVMAPI/Public/APINFTMetadataAttribute.h index 811e010..71d9dd9 100644 --- a/Source/ImmutablezkEVMAPI/Public/APINFTMetadataAttribute.h +++ b/Source/ImmutablezkEVMAPI/Public/APINFTMetadataAttribute.h @@ -44,12 +44,7 @@ class IMMUTABLEZKEVMAPI_API APINFTMetadataAttribute : public Model 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 + APINFTMetadataAttributeValue Value; }; } diff --git a/Source/ImmutablezkEVMAPI/Public/APIPricingApiOperations.h b/Source/ImmutablezkEVMAPI/Public/APIPricingApiOperations.h index 2dd9b1a..2a75b00 100644 --- a/Source/ImmutablezkEVMAPI/Public/APIPricingApiOperations.h +++ b/Source/ImmutablezkEVMAPI/Public/APIPricingApiOperations.h @@ -44,6 +44,8 @@ class IMMUTABLEZKEVMAPI_API APIPricingApi::QuotesForNFTsRequest : public Request FString ContractAddress; /* List of token ids to get pricing data for */ TArray TokenId; + /* Filters the active listings, bids, floor listing and top bid by the specified payment token, either the address of the payment token contract or 'NATIVE'. */ + TOptional PaymentToken; /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ TOptional PageCursor; }; @@ -75,6 +77,8 @@ class IMMUTABLEZKEVMAPI_API APIPricingApi::QuotesForStacksRequest : public Reque FString ContractAddress; /* List of stack ids to get pricing data for */ TArray StackId; + /* Filters the active listings, bids, floor listing and top bid by the specified payment token, either the address of the payment token contract or 'NATIVE'. */ + TOptional PaymentToken; /* Encoded page cursor to retrieve previous or next page. Use the value returned in the response. */ TOptional PageCursor; }; diff --git a/Source/ImmutablezkEVMAPI/Public/APIStackBundle.h b/Source/ImmutablezkEVMAPI/Public/APIStackBundle.h index a3d849a..4e0cb95 100644 --- a/Source/ImmutablezkEVMAPI/Public/APIStackBundle.h +++ b/Source/ImmutablezkEVMAPI/Public/APIStackBundle.h @@ -13,6 +13,7 @@ #pragma once #include "APIBaseModel.h" +#include "APIBid.h" #include "APIListing.h" #include "APIMarket.h" #include "APIStack.h" @@ -38,6 +39,8 @@ class IMMUTABLEZKEVMAPI_API APIStackBundle : public Model TOptional Market; /* List of open listings for the stack. */ TArray Listings; + /* List of open bids for the stack. */ + TArray Bids; }; } diff --git a/Source/ImmutablezkEVMAPI/README.md b/Source/ImmutablezkEVMAPI/README.md index 4bdaf2b..dc82376 100644 --- a/Source/ImmutablezkEVMAPI/README.md +++ b/Source/ImmutablezkEVMAPI/README.md @@ -1,8 +1,3 @@ # Usage -TO generate OpenAPI locally: - - ``` - openapi-generator-cli generate -i openapi.json -g cpp-ue4 -o . --additional-properties=modelNamePrefix="API",cppNamespace=ImmutablezkEVMAPI,unrealModuleName=ImmutablezkEVMAPI - - ``` \ No newline at end of file +To generate OpenAPI locally, use the corresponding batch files in `openapi-generator/batch-files` \ No newline at end of file diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/batch-files/generate.bat b/Source/ImmutablezkEVMAPI/openapi-generator/batch-files/generate.bat new file mode 100644 index 0000000..ae9e07b --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/batch-files/generate.bat @@ -0,0 +1,13 @@ +@echo off + +set OPENAPI_GENERATOR_CLI=openapi-generator-cli + +set GENERATOR=-g cpp-ue4 +set TEMPLATE=-t ../template/cpp-ue4 +set INPUT=-i https://imx-openapiv3-mr-sandbox.s3.us-east-2.amazonaws.com/openapi.json +set OUTPUT=-o ../.. +set ADDITIONAL_PROPERTIES=--additional-properties=modelNamePrefix="API",cppNamespace=ImmutablezkEVMAPI,unrealModuleName=ImmutablezkEVMAPI + +%OPENAPI_GENERATOR_CLI% generate %GENERATOR% %TEMPLATE% %INPUT% %OUTPUT% %ADDITIONAL_PROPERTIES% + +pause \ No newline at end of file diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/batch-files/generate.sh b/Source/ImmutablezkEVMAPI/openapi-generator/batch-files/generate.sh new file mode 100644 index 0000000..a6aeef9 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/batch-files/generate.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +OPENAPI_GENERATOR_CLI=openapi-generator-cli + +GENERATOR="-g cpp-ue4" +TEMPLATE="-t ../template/cpp-ue4" +INPUT="-i https://imx-openapiv3-mr-sandbox.s3.us-east-2.amazonaws.com/openapi.json" +OUTPUT="-o ../.." +ADDITIONAL_PROPERTIES="--additional-properties=modelNamePrefix=API,cppNamespace=ImmutablezkEVMAPI,unrealModuleName=ImmutablezkEVMAPI" + +$OPENAPI_GENERATOR_CLI generate $GENERATOR $TEMPLATE $INPUT $OUTPUT $ADDITIONAL_PROPERTIES \ No newline at end of file diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/batch-files/openapitools.json b/Source/ImmutablezkEVMAPI/openapi-generator/batch-files/openapitools.json new file mode 100644 index 0000000..f8d07ce --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/batch-files/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.10.0" + } +} diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/Build.cs.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/Build.cs.mustache new file mode 100644 index 0000000..bfbee11 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/Build.cs.mustache @@ -0,0 +1,20 @@ +{{>licenseInfo}} +using System; +using System.IO; +using UnrealBuildTool; + +public class {{unrealModuleName}} : ModuleRules +{ + public {{unrealModuleName}}(ReadOnlyTargetRules Target) : base(Target) + { + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "HTTP", + "Json", + } + ); + PCHUsage = PCHUsageMode.NoPCHs; + } +} \ No newline at end of file diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-header.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-header.mustache new file mode 100644 index 0000000..4f2bec0 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-header.mustache @@ -0,0 +1,55 @@ +{{>licenseInfo}} +#pragma once + +#include "CoreMinimal.h" +#include "{{modelNamePrefix}}BaseModel.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +class {{dllapi}} {{classname}} +{ +public: + {{classname}}(); + ~{{classname}}(); + + /* 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(); + + {{#operations}}{{#operation}}class {{operationIdCamelCase}}Request; + class {{operationIdCamelCase}}Response; + {{/operation}}{{/operations}} + {{#operations}}{{#operation}}DECLARE_DELEGATE_OneParam(F{{operationIdCamelCase}}Delegate, const {{operationIdCamelCase}}Response&); + {{/operation}}{{/operations}} + {{#operations}}{{#operation}}{{#description}}/* {{{.}}} */ + {{/description}}FHttpRequestPtr {{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate = F{{operationIdCamelCase}}Delegate()) const; + {{/operation}}{{/operations}} +private: + {{#operations}}{{#operation}}void On{{operationIdCamelCase}}Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, F{{operationIdCamelCase}}Delegate Delegate) const; + {{/operation}}{{/operations}} + 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; +}; + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-operations-header.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-operations-header.mustache new file mode 100644 index 0000000..99b57ea --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-operations-header.mustache @@ -0,0 +1,67 @@ +{{>licenseInfo}} +#pragma once + +#include "{{modelNamePrefix}}BaseModel.h" +#include "{{classname}}.h" + +{{#imports}}{{{import}}} +{{/imports}} + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +{{#operations}} +{{#operation}} +/* {{summary}} +{{#notes}} * + * {{.}}{{/notes}} +*/ +class {{dllapi}} {{classname}}::{{operationIdCamelCase}}Request : public Request +{ +public: + virtual ~{{operationIdCamelCase}}Request() {} + void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; + FString ComputePath() const final; + + {{#allParams}} + {{#isEnum}} + {{#allowableValues}} + enum class {{{enumName}}} + { + {{#enumVars}} + {{name}}, + {{/enumVars}} + }; + {{/allowableValues}} + + static FString EnumToString(const {{{enumName}}}& EnumValue); + static bool EnumFromString(const FString& EnumAsString, {{{enumName}}}& EnumValue); + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{^isEnum}} + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{/allParams}} +}; + +class {{dllapi}} {{classname}}::{{operationIdCamelCase}}Response : public Response +{ +public: + virtual ~{{operationIdCamelCase}}Response() {} + {{#responses.0}} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + {{/responses.0}} + bool FromJson(const TSharedPtr& JsonValue) final; + + {{#returnType}}{{{.}}} Content;{{/returnType}} +}; + +{{/operation}} +{{/operations}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-operations-source.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-operations-source.mustache new file mode 100644 index 0000000..e58a460 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-operations-source.mustache @@ -0,0 +1,330 @@ +{{>licenseInfo}} +#include "{{classname}}Operations.h" + +#include "{{unrealModuleName}}Module.h" +#include "{{modelNamePrefix}}Helpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} +{{#operations}}{{#operation}} +{{#allParams}} +{{#isEnum}} +inline FString ToString(const {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + {{#allowableValues}} + switch (Value) + { + {{#enumVars}} + case {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}::{{name}}: + return TEXT("{{{value}}}"); + {{/enumVars}} + } + {{/allowableValues}} + + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}} Value (%d)"), (int)Value); + return TEXT(""); +} + +FString {{classname}}::{{operationIdCamelCase}}Request::EnumToString(const {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + static TMap StringToEnum = { {{#allowableValues}}{{#enumVars}} + { TEXT("{{{value}}}"), {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}::{{name}} },{{/enumVars}}{{/allowableValues}} }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool {{classname}}::{{operationIdCamelCase}}Request::EnumFromString(const FString& EnumAsString, {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + {{#allowableValues}} + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + {{/allowableValues}} + return false; +} + +{{/isEnum}} +{{/allParams}} +FString {{classname}}::{{operationIdCamelCase}}Request::ComputePath() const +{ + {{^pathParams.0}} + FString Path(TEXT("{{{path}}}")); + {{/pathParams.0}} + {{#pathParams.0}} + TMap PathParams = { {{#pathParams}} + { TEXT("{{baseName}}"), FStringFormatArg(ToUrlString({{paramName}})) }{{^-last}},{{/-last}}{{/pathParams}} }; + + FString Path = FString::Format(TEXT("{{{path}}}"), PathParams); + + {{/pathParams.0}} + {{#queryParams.0}} + TArray QueryParams; + {{#queryParams}} + {{#required}} + {{^collectionFormat}} + QueryParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}})); + {{/collectionFormat}} + {{#collectionFormat}} + {{#isCollectionFormatMulti}} + QueryParams.Add(CollectionToUrlString_{{collectionFormat}}({{paramName}}, TEXT("{{baseName}}"))); + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + QueryParams.Add(FString(TEXT("{{baseName}}=")) + CollectionToUrlString_{{collectionFormat}}({{paramName}}, TEXT("{{baseName}}"))); + {{/isCollectionFormatMulti}} + {{/collectionFormat}} + {{/required}} + {{^required}} + {{^collectionFormat}} + if({{paramName}}.IsSet()) + { + QueryParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}}.GetValue())); + } + {{/collectionFormat}} + {{#collectionFormat}} + if({{paramName}}.IsSet()) + { + {{#isCollectionFormatMulti}} + QueryParams.Add(CollectionToUrlString_{{collectionFormat}}({{paramName}}.GetValue(), TEXT("{{baseName}}"))); + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + QueryParams.Add(FString(TEXT("{{baseName}}=")) + CollectionToUrlString_{{collectionFormat}}({{paramName}}.GetValue(), TEXT("{{baseName}}"))); + {{/isCollectionFormatMulti}} + } + {{/collectionFormat}} + {{/required}} + {{/queryParams}} + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + {{/queryParams.0}} + return Path; +} + +void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHttpRequestRef& HttpRequest) const +{ + static const TArray Consumes = { {{#consumes}}TEXT("{{{mediaType}}}"){{^-last}}, {{/-last}}{{/consumes}} }; + //static const TArray Produces = { {{#produces}}TEXT("{{{mediaType}}}"){{^-last}}, {{/-last}}{{/produces}} }; + + HttpRequest->SetVerb(TEXT("{{httpMethod}}")); + {{#headerParams.0}} + + // Header parameters + {{#headerParams}} + {{#required}} + HttpRequest->SetHeader(TEXT("{{baseName}}"), {{paramName}}); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet()) + { + HttpRequest->SetHeader(TEXT("{{baseName}}"), {{paramName}}.GetValue()); + } + {{/required}} + {{/headerParams}} + {{/headerParams.0}} + + {{#isBodyAllowed}} + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + {{#bodyParams.0}} + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + {{#bodyParams}} + {{#required}} + WriteJsonValue(Writer, {{paramName}}); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet()) + { + WriteJsonValue(Writer, {{paramName}}.GetValue()); + } + {{/required}} + {{/bodyParams}} + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + {{/bodyParams.0}} + {{^bodyParams.0}} + {{#formParams.0}} + // Form parameters added to try to generate a json body when no body parameters are specified. + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + Writer->WriteObjectStart(); + {{#formParams}} + {{#isFile}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Files are not supported in json body")); + {{/isFile}} + {{^isFile}} + {{#required}} + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); + WriteJsonValue(Writer, {{paramName}}); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet()){ + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); + WriteJsonValue(Writer, {{paramName}}.GetValue()); + } + {{/required}} + {{/isFile}} + {{/formParams}} + Writer->WriteObjectEnd(); + Writer->Close(); + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + {{/formParams.0}} + {{/bodyParams.0}} + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + {{#formParams.0}} + HttpMultipartFormData FormData; + {{#formParams}} + {{#isContainer}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Collections are not supported in multipart form")); + {{/isContainer}} + {{^isContainer}} + {{#required}} + {{#isFile}} + FormData.AddFilePart(TEXT("{{baseName}}"), {{paramName}}); + {{/isFile}} + {{^isFile}} + {{#isBinary}} + FormData.AddBinaryPart(TEXT("{{baseName}}"), {{paramName}}); + {{/isBinary}} + {{^isBinary}} + FormData.AddStringPart(TEXT("{{baseName}}"), *ToUrlString({{paramName}})); + {{/isBinary}} + {{/isFile}} + {{/required}} + {{^required}} + if({{paramName}}.IsSet()) + { + {{#isFile}} + FormData.AddFilePart(TEXT("{{baseName}}"), {{paramName}}.GetValue()); + {{/isFile}} + {{^isFile}} + {{#isBinary}} + FormData.AddBinaryPart(TEXT("{{baseName}}"), {{paramName}}.GetValue()); + {{/isBinary}} + {{^isBinary}} + FormData.AddStringPart(TEXT("{{baseName}}"), *ToUrlString({{paramName}}.GetValue())); + {{/isBinary}} + {{/isFile}} + } + {{/required}} + {{/isContainer}} + {{/formParams}} + + FormData.SetupHttpRequest(HttpRequest); + {{/formParams.0}} + {{#bodyParams.0}} + {{#bodyParams}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Body parameter ({{baseName}}) was ignored, not supported in multipart form")); + {{/bodyParams}} + {{/bodyParams.0}} + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + {{#formParams.0}} + TArray FormParams; + {{#formParams}} + {{#isContainer}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Collections are not supported in urlencoded requests")); + {{/isContainer}} + {{#isFile}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Files are not supported in urlencoded requests")); + {{/isFile}} + {{^isFile}} + {{^isContainer}} + {{#required}} + FormParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}})); + {{/required}} + {{^required}} + if({{paramName}}.IsSet()) + { + FormParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}}.GetValue())); + } + {{/required}} + {{/isContainer}} + {{/isFile}} + {{/formParams}} + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); + HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); + {{/formParams.0}} + {{#bodyParams.0}} + {{#bodyParams}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Body parameter ({{baseName}}) was ignored, not supported in urlencoded requests")); + {{/bodyParams}} + {{/bodyParams.0}} + } + else + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } + {{/isBodyAllowed}} +} + +{{#responses.0}} +void {{classname}}::{{operationIdCamelCase}}Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + {{#responses}} + case {{code}}: + {{#isDefault}} + default: + {{/isDefault}} + SetResponseString(TEXT("{{message}}")); + break; + {{/responses}} + } +} +{{/responses.0}} + +bool {{classname}}::{{operationIdCamelCase}}Response::FromJson(const TSharedPtr& JsonValue) +{ + {{#returnType}} + return TryGetJsonValue(JsonValue, Content); + {{/returnType}} + {{^returnType}} + return true; + {{/returnType}} +} +{{/operation}}{{/operations}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-source.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-source.mustache new file mode 100644 index 0000000..d6091e4 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/api-source.mustache @@ -0,0 +1,160 @@ +{{>licenseInfo}} +#include "{{classname}}.h" + +#include "{{classname}}Operations.h" +#include "{{unrealModuleName}}Module.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +{{classname}}::{{classname}}() +: Url(TEXT("{{basePath}}")) +{ +} + +{{classname}}::~{{classname}}() {} + +void {{classname}}::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void {{classname}}::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void {{classname}}::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool {{classname}}::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("{{classname}}: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void {{classname}}::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) +{ + if (RetryManager != &InRetryManager) + { + DefaultRetryManager.Reset(); + RetryManager = &InRetryManager; + } +} + +FHttpRetrySystem::FManager& {{classname}}::GetHttpRetryManager() +{ + checkf(RetryManager, TEXT("{{classname}}: 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 {{classname}}::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 {{classname}}::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(Log{{unrealModuleName}}, 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); +} + +{{#operations}} +{{#operation}} +FHttpRequestPtr {{classname}}::{{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate /*= F{{operationIdCamelCase}}Delegate()*/) 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, &{{classname}}::On{{operationIdCamelCase}}Response, Delegate); + HttpRequest->ProcessRequest(); + return HttpRequest; +} + +void {{classname}}::On{{operationIdCamelCase}}Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, F{{operationIdCamelCase}}Delegate Delegate) const +{ + {{operationIdCamelCase}}Response Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +{{/operation}} +{{/operations}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/helpers-header.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/helpers-header.mustache new file mode 100644 index 0000000..6a90362 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/helpers-header.mustache @@ -0,0 +1,501 @@ +{{>licenseInfo}} +#pragma once + +#include "{{modelNamePrefix}}BaseModel.h" + +#include "Serialization/JsonSerializer.h" +#include "Dom/JsonObject.h" +#include "Misc/Base64.h" +#include "PlatformHttp.h" + +class IHttpRequest; + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +typedef TSharedRef> JsonWriter; + +////////////////////////////////////////////////////////////////////////// + +class {{dllapi}} 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 TSet& 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; +} + +{{dllapi}} 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, TSet& SetValue) +{ + const TArray>* JsonArray; + if (JsonValue->TryGetArray(JsonArray)) + { + bool ParseSuccess = true; + const int32 Count = JsonArray->Num(); + SetValue.Reset(); + for (int i = 0; i < Count; i++) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue((*JsonArray)[i], TmpValue); + SetValue.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; +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/helpers-source.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/helpers-source.mustache new file mode 100644 index 0000000..fdb6ade --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/helpers-source.mustache @@ -0,0 +1,226 @@ +{{>licenseInfo}} +#include "{{modelNamePrefix}}Helpers.h" + +#include "{{unrealModuleName}}Module.h" + +#include "Interfaces/IHttpRequest.h" +#include "PlatformHttp.h" +#include "Misc/FileHelper.h" +#include "Misc/Paths.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +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(Log{{unrealModuleName}}, 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(Log{{unrealModuleName}}, 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); +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/licenseInfo.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/licenseInfo.mustache new file mode 100644 index 0000000..b0182ee --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}OpenAPI spec version: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-base-header.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-base-header.mustache new file mode 100644 index 0000000..e4fdbd1 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-base-header.mustache @@ -0,0 +1,100 @@ +{{>licenseInfo}} +#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" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +typedef TSharedRef> JsonWriter; +using namespace FHttpRetrySystem; + +struct {{dllapi}} HttpRetryManager + : public FManager +#if ENGINE_MAJOR_VERSION <= 4 + , public FTickerObjectBase +#else + , public FTSTickerObjectBase +#endif +{ + using FManager::FManager; + + bool Tick(float DeltaTime) final; +}; + +struct {{dllapi}} 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 {{dllapi}} Model +{ +public: + virtual ~Model() {} + virtual void WriteJson(JsonWriter& Writer) const = 0; + virtual bool FromJson(const TSharedPtr& JsonValue) = 0; +}; + +class {{dllapi}} 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 {{dllapi}} 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; +}; + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-base-source.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-base-source.mustache new file mode 100644 index 0000000..1a551ca --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-base-source.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} +#include "{{modelNamePrefix}}BaseModel.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +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")); + } +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-header.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-header.mustache new file mode 100644 index 0000000..ee709e5 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-header.mustache @@ -0,0 +1,74 @@ +{{>licenseInfo}} +#pragma once + +#include "{{modelNamePrefix}}BaseModel.h" +{{#imports}}{{{import}}} +{{/imports}} + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} +{{#models}} +{{#model}} + +/* + * {{classname}} + * + * {{description}} + */ +class {{dllapi}} {{classname}} : public Model +{ +public: + virtual ~{{classname}}() {} + bool FromJson(const TSharedPtr& JsonValue) final; + void WriteJson(JsonWriter& Writer) const final; + + {{#isString}} + {{#isEnum}} + {{#allowableValues}} + enum class Values + { + {{#enumVars}} + {{name}}, + {{/enumVars}} + }; + + Values Value{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/allowableValues}} + + static FString EnumToString(const Values& EnumValue); + static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); + {{/isEnum}} + {{^isEnum}} + FString Value{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isEnum}} + {{/isString}} + {{#vars}} + {{#isEnum}} + {{#allowableValues}} + enum class {{{enumName}}} + { + {{#enumVars}} + {{name}}, + {{/enumVars}} + }; + {{/allowableValues}} + + static FString EnumToString(const {{{enumName}}}& EnumValue); + static bool EnumFromString(const FString& EnumAsString, {{{enumName}}}& EnumValue); + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{^isEnum}} + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatype}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{/vars}} +}; + +{{/model}} +{{/models}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-source.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-source.mustache new file mode 100644 index 0000000..7ab8ea5 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/model-source.mustache @@ -0,0 +1,185 @@ +{{>licenseInfo}} +#include "{{classname}}.h" + +#include "{{unrealModuleName}}Module.h" +#include "{{modelNamePrefix}}Helpers.h" + +#include "Templates/SharedPointer.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} +{{#models}}{{#model}} +{{#isEnum}} +inline FString ToString(const {{classname}}::Values& Value) +{ + {{#allowableValues}} + switch (Value) + { + {{#enumVars}} + case {{classname}}::Values::{{name}}: + return TEXT("{{{value}}}"); + {{/enumVars}} + } + {{/allowableValues}} + + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::Values Value (%d)"), (int)Value); + return TEXT(""); +} + +FString {{classname}}::EnumToString(const {{classname}}::Values& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, {{classname}}::Values& Value) +{ + static TMap StringToEnum = { {{#allowableValues}}{{#enumVars}} + { TEXT("{{{value}}}"), {{classname}}::Values::{{name}} },{{/enumVars}}{{/allowableValues}} }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool {{classname}}::EnumFromString(const FString& EnumAsString, {{classname}}::Values& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const {{classname}}::Values& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, {{classname}}::Values& Value) +{ + {{#allowableValues}} + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + {{/allowableValues}} + return false; +} + +{{/isEnum}} +{{#hasEnums}} +{{#vars}} +{{#isEnum}} +inline FString ToString(const {{classname}}::{{{enumName}}}& Value) +{ + {{#allowableValues}} + switch (Value) + { + {{#enumVars}} + case {{classname}}::{{{enumName}}}::{{name}}: + return TEXT("{{{value}}}"); + {{/enumVars}} + } + {{/allowableValues}} + + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{{enumName}}} Value (%d)"), (int)Value); + return TEXT(""); +} + +FString {{classname}}::EnumToString(const {{classname}}::{{{enumName}}}& EnumValue) +{ + return ToString(EnumValue); +} + +inline bool FromString(const FString& EnumAsString, {{classname}}::{{{enumName}}}& Value) +{ + static TMap StringToEnum = { {{#allowableValues}}{{#enumVars}} + { TEXT("{{{value}}}"), {{classname}}::{{{enumName}}}::{{name}} },{{/enumVars}}{{/allowableValues}} }; + + const auto Found = StringToEnum.Find(EnumAsString); + if(Found) + Value = *Found; + + return Found != nullptr; +} + +bool {{classname}}::EnumFromString(const FString& EnumAsString, {{classname}}::{{{enumName}}}& EnumValue) +{ + return FromString(EnumAsString, EnumValue); +} + +inline void WriteJsonValue(JsonWriter& Writer, const {{classname}}::{{{enumName}}}& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, {{classname}}::{{{enumName}}}& Value) +{ + {{#allowableValues}} + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + if(FromString(TmpValue, Value)) + return true; + } + {{/allowableValues}} + return false; +} + +{{/isEnum}} +{{/vars}} +{{/hasEnums}} +void {{classname}}::WriteJson(JsonWriter& Writer) const +{ + {{#isString}} + WriteJsonValue(Writer, Value); + {{/isString}} + {{^isString}} + Writer->WriteObjectStart(); + {{#vars}} + {{#required}} + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}); + {{/required}} + {{^required}} + if ({{name}}.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}.GetValue()); + } + {{/required}} + {{/vars}} + Writer->WriteObjectEnd(); + {{/isString}} +} + +bool {{classname}}::FromJson(const TSharedPtr& JsonValue) +{ + {{#isString}} + return TryGetJsonValue(JsonValue, Value); + {{/isString}} + {{^isString}} + const TSharedPtr* Object; + if (!JsonValue->TryGetObject(Object)) + return false; + + bool ParseSuccess = true; + + {{#vars}} + {{#required}} + {{^isWriteOnly}}ParseSuccess &= {{/isWriteOnly}}TryGetJsonValue(*Object, TEXT("{{baseName}}"), {{name}}); + {{/required}} + {{^required}} + ParseSuccess &= TryGetJsonValue(*Object, TEXT("{{baseName}}"), {{name}}); + {{/required}} + {{/vars}} + + return ParseSuccess; + {{/isString}} +} + +{{/model}} +{{/models}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/module-header.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/module-header.mustache new file mode 100644 index 0000000..f27de89 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/module-header.mustache @@ -0,0 +1,15 @@ +{{>licenseInfo}} +#pragma once + +#include "Modules/ModuleInterface.h" +#include "Modules/ModuleManager.h" +#include "Logging/LogMacros.h" + +DECLARE_LOG_CATEGORY_EXTERN(Log{{unrealModuleName}}, Log, All); + +class {{dllapi}} {{unrealModuleName}}Module : public IModuleInterface +{ +public: + void StartupModule() final; + void ShutdownModule() final; +}; diff --git a/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/module-source.mustache b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/module-source.mustache new file mode 100644 index 0000000..e89bb28 --- /dev/null +++ b/Source/ImmutablezkEVMAPI/openapi-generator/template/cpp-ue4/module-source.mustache @@ -0,0 +1,13 @@ +{{>licenseInfo}} +#include "{{unrealModuleName}}Module.h" + +IMPLEMENT_MODULE({{unrealModuleName}}Module, {{unrealModuleName}}); +DEFINE_LOG_CATEGORY(Log{{unrealModuleName}}); + +void {{unrealModuleName}}Module::StartupModule() +{ +} + +void {{unrealModuleName}}Module::ShutdownModule() +{ +} diff --git a/Source/ImmutablezkEVMAPI/openapi.json b/Source/ImmutablezkEVMAPI/openapi.json deleted file mode 100644 index e19e581..0000000 --- a/Source/ImmutablezkEVMAPI/openapi.json +++ /dev/null @@ -1,9957 +0,0 @@ -{ - "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": "metadata-search", - "x-displayName": "metadata-search" - } - ], - "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" - } - } - } - } - } - } - }, - "/v1/chains/{chain_name}/search/filters/{contract_address}": { - "get": { - "x-hide-from-sdk": true, - "tags": [ - "metadata-search" - ], - "operationId": "ListFilters", - "summary": "Get list of metadata attribute filters", - "description": "Get list of metadata filters", - "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 addresses for collection", - "schema": { - "type": "string", - "pattern": "^0x[a-fA-F0-9]{40}$", - "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" - } - } - ], - "responses": { - "200": { - "description": "200 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListFiltersResult" - } - } - } - }, - "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" - } - } - } - }, - "/v1/chains/{chain_name}/search/nfts": { - "get": { - "x-hide-from-sdk": true, - "tags": [ - "metadata-search" - ], - "operationId": "SearchNFTs", - "summary": "Search NFTs", - "description": "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" - } - } - } - }, - "/v1/chains/{chain_name}/search/stacks": { - "get": { - "x-hide-from-sdk": true, - "tags": [ - "metadata-search" - ], - "operationId": "SearchStacks", - "summary": "Search NFT stacks", - "description": "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": "traits", - "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" - } - } - } - }, - "/v1/chains/{chain_name}/stacks": { - "get": { - "x-hide-from-sdk": true, - "tags": [ - "metadata" - ], - "operationId": "ListStacks", - "summary": "List NFT stack bundles by stack_id. Response will include Market, Listings & Stack Count information for each stack", - "description": "List NFT stack bundles by stack_id. This endpoint functions similarly to `ListMetadataByID` but extends the response to include Market, Listings & Stack Count information for each stack.", - "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" - } - } - } - }, - "/v1/chains/{chain_name}/quotes/{contract_address}/stacks": { - "get": { - "x-hide-from-sdk": true, - "tags": [ - "pricing" - ], - "operationId": "QuotesForStacks", - "summary": "Get pricing data for a list of stack ids", - "description": "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" - } - } - } - }, - "/v1/chains/{chain_name}/quotes/{contract_address}/nfts": { - "get": { - "x-hide-from-sdk": true, - "tags": [ - "pricing" - ], - "operationId": "QuotesForNFTs", - "summary": "Get pricing data for a list of token ids", - "description": "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" - }, - "operator_allowlist_address": { - "type": "string", - "nullable": true, - "description": "The address of the Operator Allowlist - https://docs.immutable.com/products/zkevm/minting/royalties/allowlist-spec/" - }, - "minter_address": { - "type": "string", - "nullable": true, - "description": "The address of the minter used in the Minting API - https://docs.immutable.com/products/zkEVM/minting/minting-api#minting-api-prerequisites" - } - }, - "required": [ - "rpc_url", - "operator_allowlist_address", - "minter_address" - ] - } - ] - }, - "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 - } - } - } - }, - "FilterValue": { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "nft_count": { - "type": "string", - "description": "Number of NFTs that have this trait. Uint256 as string" - } - }, - "example": [ - { - "value": "Common", - "nft_count": "42" - }, - { - "value": "Rare", - "nft_count": "17" - } - ], - "required": [ - "value", - "nft_count" - ] - }, - "Filter": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of trait", - "example": "Rarity" - }, - "values": { - "description": "List of 100 most common values for this trait sorted by number of associated NFTs", - "type": "array", - "items": { - "$ref": "#/components/schemas/FilterValue" - } - }, - "omitted_values_count": { - "type": "integer", - "description": "Indicated how many more distinct values exist", - "example": 0 - } - }, - "required": [ - "name", - "values", - "omitted_values_count" - ] - }, - "FilterResult": { - "type": "object", - "properties": { - "chain": { - "$ref": "#/components/schemas/Chain" - }, - "contract_address": { - "type": "string", - "description": "ETH Address of collection that the asset belongs to", - "example": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3" - }, - "filters": { - "description": "List of all filters and the most common values", - "type": "array", - "items": { - "$ref": "#/components/schemas/Filter" - } - } - }, - "required": [ - "chain", - "contract_address", - "filters" - ] - }, - "ListFiltersResult": { - "type": "object", - "description": "List filters result", - "properties": { - "result": { - "$ref": "#/components/schemas/FilterResult" - }, - "page": { - "$ref": "#/components/schemas/Page" - } - }, - "required": [ - "result", - "page" - ] - }, - "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" - ] - }, - "ConvertedPrices": { - "type": "object", - "description": "A mapping of converted prices for major currencies such as ETH, USD. All converted prices are fee-inclusive.", - "nullable": true, - "additionalProperties": { - "type": "string" - }, - "example": { - "ETH": "0.0058079775", - "USD": "15.89" - } - }, - "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" - } - ] - }, - "converted_prices": { - "$ref": "#/components/schemas/ConvertedPrices" - } - }, - "required": [ - "token", - "amount", - "fee_inclusive_amount", - "fees", - "converted_prices" - ] - }, - "Listing": { - "type": "object", - "properties": { - "listing_id": { - "type": "string", - "description": "Global Order identifier", - "example": "018792C9-4AD7-8EC4-4038-9E05C598534A" - }, - "price_details": { - "$ref": "#/components/schemas/MarketPriceDetails" - }, - "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", - "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" - ] - } - } - } -}