Skip to content
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

feat: added transak widget #158

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

feat: added transak widget #158

wants to merge 12 commits into from

Conversation

YermekG
Copy link
Contributor

@YermekG YermekG commented Jan 9, 2025

Summary

Added transak widget which allows players add funds to purchase in-game nfts

  • Prefix your PR title with feat: , fix: , chore: , docs: , refactor: or test: .
  • Sample blueprints are updated with new SDK changes
  • Updated public documentation with new SDK changes (Immutable X and Immutable zkEVM)
  • Replied to GitHub issues

YermekG and others added 9 commits December 11, 2024 09:56
* feat: added transak web widget and environment enum

* fix: resolved compile issue with ue4

* fix: compiler issue with ue4

* chore: isolated source code for ue5

* feat: add blu web browser to transak widget (#3498)

* refactor: apply formatting

* refactor: move include inside respective engine macro

* refactor: expose is ready to blueprint

* refactor: change private to protected

* refactor: reorder .h and .cpp functions to match each other

* chore: update loctext namespace

* fix: compile error

* chore: removed redundant code

* chore: removed prefixes

---------

Co-authored-by: Yermek Garifullanov <yermek.garifullanov@immutable.com>
@YermekG YermekG requested a review from a team as a code owner January 9, 2025 22:03
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Unity, I put all commerce related stuff in another package. i.e. Marketplace. Should Transak stuff be in another folder e.g. Source/ImmutableMarketplace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can rename Transak folder to Marketplace to support your logic. However, I dont really thing we need to prefix it with Immutable. Will you accept it?

* @param ScreenTitle The title of the screen to load.
*/
UFUNCTION(BlueprintCallable)
void Load(const FString& WalletAddress, const FString& Email, const FString& ProductsAvailed, const FString& ScreenTitle);
Copy link
Contributor

@ImmutableJeffrey ImmutableJeffrey Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For blueprintcallables, I would prefer if the parameters arent const & as you can just enter text to the blueprint node when you call it

* @details More details could be found under the class parameter
* @return ThemeColor as FLinearColor
*/
const FLinearColor& GetThemeColor()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const FLinearColor& GetThemeColor() const ?

* @details More details could be found under the class parameter
* @return CryptoCurrencyList as array of FString
*/
const TArray<FString>& GetCryptoCurrencyList()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const TArray<FString>& GetCryptoCurrencyList() const ?

* @details More details could be found under the class parameter
* @return bDisableWalletAddressForm as bool
*/
bool DisableWalletAddressForm()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool DisableWalletAddressForm() const ?

* @details More details could be found under the class parameter
* @return bIsAutoFillUserData as bool
*/
bool IsAutoFillUserData()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool IsAutoFillUserData() const ?

UFUNCTION(BlueprintCallable)
void Load(const FString& WalletAddress, const FString& Email, const FString& ProductsAvailed, const FString& ScreenTitle);

FDelegateHandle CallAndRegister_OnWhenReady(FOnWhenReady::FDelegate Delegate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to create this Ready wrapper, when all it does is listen to when url changes. The ready name is kinda misleading. We can't compare the URL's to see if its "ready" ?
If we actually keep it, wouldn't it be better if .Clear() ready delegate after .Broadcast() so that subscribers don't need to manually invoke .Remove

#pragma once

UENUM()
enum class EPassportEnvironment : uint8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expose to blueprints ?



UENUM()
enum class ETransakEnvironment : uint8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expose to blueprints ?


if (!TransakConfig)
{
return "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap with TEXT

* @brief Configuration settings for Transak widget.
*/
UCLASS(Abstract, Blueprintable, ClassGroup = Immutable)
class UTransakConfig : public UObject
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expose the getters with blueprint pure ?

{
return false;
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add #undef LOCTEXT_NAMESPACE at end of file

* @details More details could be found under the class parameter
* @return bDisableWalletAddressForm as bool
*/
bool DisableWalletAddressForm()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be consistent and not be misleading, perhaps change it to IsDisableWalletAddressForm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants