Skip to main content

Bridge tokens

The bridge flow allows players to transfer tokens to and from Immutable zkEVM.
Unity MarketplaceUnity Marketplace
💡Who is this for?
Developers who want to build an in-game marketplace in Unity.
💡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.

Overview

The bridge widget, powered by Squid, enables players to transfer tokens between Immutable zkEVM and other chains.

The Immutable Marketplace package generates the URL needed to access the bridge widget.

Generating the bridge URL

To generate the bridge URL, provide the environment as shown in the example:

using Immutable.Marketplace;
using UnityEngine;

public class MarketplaceExample : MonoBehaviour
{
async void Start()
{
try
{
string link = LinkFactory.GenerateBridgeLink(environment: Environment.Sandbox);
Debug.Log($"Link: {link}");

// Open the generated link in the default browser
Application.OpenURL(link);
}
catch (System.Exception e)
{
Debug.LogError($"Error getting the bridge link: {e.Message}");
}
}
}

Configuration

You can pass optional configurations to the bridge widget using the GenerateBridgeLink function. The main configurations are provided through the BridgeQueryParams struct.

The BridgeQueryParams struct allows you to define the configuration for the bridge flow. Here's a list of the available fields:

ParameterDescription
FromTokenAddressThe address of the token being moved from (default: null).
FromChainIDThe ID of the source blockchain (default: null).
ToTokenAddressThe address of the token being moved to (default: null).
ToChainIDThe ID of the destination blockchain (default: null).

Here's an example of how to use the GenerateBridgeLink function with the BridgeQueryParams struct:

var link = LinkFactory.GenerateBridgeLink(
environment: Environment.Sandbox,
queryParams: new BridgeQueryParams
{
FromTokenAddress = "0x1234...abcd",
FromChainID = "1",
ToTokenAddress = "0xabcd...1234",
ToChainID = "13371"
}
);

For more information, refer to Bridge tokens.


Related content