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 toYOUR_PUBLISHABLE_KEY
in the example.FromTokenAddress
is currently set to0x1234...abcd
in the example.ToTokenAddress
is currently set to0x1234...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
- BlueprintUE
- Image
