Skip to main content
Version: v2

Generating the swap URL

💡Reminder

The following variables are using placeholder values.
Don't forget to replace them with values that are relevant to your application.

  • PublishableKey is currently set to YOUR_PUBLISHABLE_KEY in the example.
  • FromTokenAddress is currently set to 0x1234...abcd in the example.
  • ToTokenAddress is currently set to 0x1234...abcd in the example.

Please refer to the Swap SDK Reference for more details.

C++

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);
}

Blueprint