Skip to main content
Version: v2

Swapping Tokens

Learn how to integrate the swap flow, enabling players to exchange tokens on Immutable zkEVM. This feature provides another way for players to acquire your game's ERC-20 tokens for purchasing NFTs in your marketplace.
Swapping Tokens in UnrealSwapping Tokens in Unreal
💡Prerequisite step
Before continuing with this step, ensure you have completed the previous On-Ramping Tokens step of this tutorial series.

Overview

The Quickswap Swap Widget allows players to exchange one token for another on the Immutable zkEVM network, providing an alternative means of obtaining your in-game currency.

💡Allowlisted tokens
Only tokens that have been verified will be displayed on the widgets. To allowlist an ERC-20 token please follow our Asset Verification procedure.
For additional questions, please contact our support team on Discord.

You can integrate this widget into your game by:

Direct players to their default browser to open the widget.

Displaying the Widget

The Unreal Marketplace module provides a function to generate the Quickswap Swap Widget URL, which you can customise with specific configuration options to tailor the experience.

For more details, refer to the Unreal Swap Tokens documentation.

Direct players to their default browser to open the widget.
void GenerateAndLaunchSwapLink()
{
FImmutableSwapQueryParams QueryParams;
QueryParams.FromTokenAddress = TEXT("0x1234...abcd");
QueryParams.ToTokenAddress = TEXT("0xabcd...1234");

const FString SwapLink = UImmutableMarketplaceLinkFactory::GenerateSwapLink
(
EImmutableEnvironment::Sandbox,
TEXT("YOUR_PUBLISHABLE_KEY"),
QueryParams
);

FPlatformProcess::LaunchURL(*SwapLink, nullptr, nullptr);
}

Next steps

Players can now swap tokens for your in-game currency, ensuring they have the funds needed to purchase NFTs in your marketplace. Continue to the final step of this tutorial series to learn about bridging tokens.


Related content