Swapping Tokens
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.
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.