-
Notifications
You must be signed in to change notification settings - Fork 9
feat: added application configuration utilities #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+244
−0
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
#pragma once | ||
|
||
#include "ApplicationConfig.generated.h" | ||
|
||
/** | ||
* @class UApplicationConfig | ||
* @brief Configuration settings for Passport and various APIs. | ||
* @details This class stores configuration settings such as URLs, chain names, contract addresses, | ||
* client IDs, and environment settings for the zkEVM API, Orderbook API, and Passport. | ||
*/ | ||
UCLASS(Abstract, Blueprintable, ClassGroup = Immutable) | ||
class UApplicationConfig : public UObject | ||
YermekG marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
GENERATED_BODY() | ||
|
||
public: | ||
/** | ||
* Retrieves URL for the zkEVM API. | ||
* | ||
* @return A constant reference to an FString containing the name of the chain. | ||
*/ | ||
const FString& GetzkEVMAPIURL() | ||
{ | ||
return zkEVMAPIURL; | ||
} | ||
|
||
/** | ||
* Retrieves the name of the chain used to pass to the zkEVM API. | ||
* | ||
* @return A constant reference to an FString containing the name of the chain. | ||
*/ | ||
const FString& GetzkEVMAPIChainName() | ||
{ | ||
return zkEVMAPIChainName; | ||
} | ||
|
||
/** | ||
* Retrieves URL for the Orderbook API. | ||
* | ||
* @return A constant reference to an FString containing the name of the chain. | ||
*/ | ||
const FString& GetOrderbookAPIURL() | ||
{ | ||
return OrederbookAPIURL; | ||
} | ||
|
||
/** | ||
* Retrieves the name of the chain used to pass to the Orderbook API. | ||
* | ||
* @return A constant reference to an FString containing the name of the chain. | ||
*/ | ||
const FString& GetOrderbookAPIChainName() | ||
{ | ||
return OrderbookAPIChainName; | ||
} | ||
|
||
/** | ||
* @brief Retrieves the cryptocurrency contract address associated with the user's wallet balance. | ||
* | ||
* @return A string representing the contract address. | ||
*/ | ||
const FString& GetTokenBalanceContractAddress() | ||
{ | ||
return TokenBalanceContractAddress; | ||
} | ||
|
||
/** | ||
* Retrieves the list of NFT contracts used in the APIs' queries. | ||
* | ||
* @return A constant reference to an array of strings representing the contracts. | ||
*/ | ||
const TArray<FString>& GetNFTContractAddresses() | ||
{ | ||
return NFTContractAddress; | ||
} | ||
|
||
/** | ||
* Retrieves the Client ID used for Passport initialization. | ||
* | ||
* @return A constant reference to an FString containing the Client ID. | ||
*/ | ||
const FString& GetClientID() | ||
{ | ||
return ClientID; | ||
} | ||
|
||
/** | ||
* Retrieves the environment configuration used for Passport initialization. | ||
* | ||
* @return A constant reference to an FString representing the environment. | ||
*/ | ||
const FString& GetEnvironment() | ||
{ | ||
return Environment; | ||
} | ||
|
||
/** | ||
* Retrieves the URL where the browser will redirect after successful authentication. | ||
* @note This is only used for Android, iOS, and macOS. | ||
* | ||
* @return A constant reference to an FString containing the redirect URL. | ||
*/ | ||
const FString& GetRedirectURL() | ||
{ | ||
return RedirectURL; | ||
} | ||
|
||
/** | ||
* Retrieves the URL used for logging out. | ||
* | ||
* @return A constant reference to an FString containing the logout URL. | ||
*/ | ||
const FString& GetLogoutURL() | ||
{ | ||
return LogoutURL; | ||
} | ||
|
||
protected: | ||
/** The URL for the zkEVM API. */ | ||
UPROPERTY(EditDefaultsOnly, Category = "zkEVM API") | ||
FString zkEVMAPIURL; | ||
|
||
/** The name of the API chain used by the zkEVM API. */ | ||
UPROPERTY(EditDefaultsOnly, Category = "zkEVM API") | ||
FString zkEVMAPIChainName; | ||
|
||
/** The URL for the Orderbook API. */ | ||
UPROPERTY(EditDefaultsOnly, Category = "Orderbook API") | ||
FString OrederbookAPIURL; | ||
|
||
/** The name of the API chain used by Orderbook API. */ | ||
UPROPERTY(EditDefaultsOnly, Category = "Orderbook API") | ||
FString OrderbookAPIChainName; | ||
|
||
/** The address of the cryptocurrency contract in the blockchain. */ | ||
UPROPERTY(EditDefaultsOnly, Category = "Contracts") | ||
FString TokenBalanceContractAddress; | ||
|
||
/** An array of NFT contract addresses used for searching NFTs in the marketplace or displaying them in the player's inventory. */ | ||
UPROPERTY(EditDefaultsOnly, Category = "Contracts") | ||
TArray<FString> NFTContractAddress; | ||
|
||
/** Passport Client ID. */ | ||
UPROPERTY(EditDefaultsOnly, Category = "Passport") | ||
FString ClientID; | ||
|
||
/** Environment used to initialize passport. Ex. sandbox or production */ | ||
UPROPERTY(EditDefaultsOnly, Category = "Passport") | ||
FString Environment; | ||
|
||
/** | ||
* (Android, iOS, and macOS only) | ||
* The URL where the browser will redirect after successful authentication. | ||
*/ | ||
UPROPERTY(EditDefaultsOnly, Category = "Passport") | ||
FString RedirectURL; | ||
|
||
/** The URL where the browser will redirect after logout is complete. */ | ||
UPROPERTY(EditDefaultsOnly, Category = "Passport") | ||
FString LogoutURL; | ||
|
||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Source/Immutable/Public/Immutable/ImmutablePluginSettings.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include "Engine/DeveloperSettings.h" | ||
#include "ApplicationConfig.h" | ||
|
||
#include "ImmutablePluginSettings.generated.h" | ||
|
||
|
||
/** | ||
* ImmutablePluginSettings is a configuration class for the Immutable plugin. | ||
* This class contains settings that can be adjusted to control the behavior | ||
* of the Immutable plugin within the Unreal Engine environment. | ||
*/ | ||
UCLASS(config = Game, defaultconfig, meta = (DisplayName = "Immutable Plugin Settings")) | ||
class IMMUTABLE_API UImmutablePluginSettings : public UDeveloperSettings | ||
{ | ||
GENERATED_BODY() | ||
|
||
public: | ||
/// The default application configuration class. | ||
/// This property holds a reference to a subclass of UApplicationConfig, | ||
/// which will be used as the default configuration for the application. | ||
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category = "General") | ||
TSubclassOf<UApplicationConfig> DefaultApplicationConfig; | ||
YermekG marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.