You can pass various parameters to modify the look and UX of the Layerswap Hosted App. Example:

https://layerswap.io/app/?
    clientId=YOUR_CLIENT_ID
    &to=STARKNET_MAINNET
    &from=ETHEREUM_MAINNET
    &destAddress=0x0000000000000000000000000000000000000000
    &amount=27
    &asset=IMX
    &actionButtonText=Deposit

Query Params

from
string

Source network or exchange you want the users to transfer from, for example IMMUTABLEX_MAINNET.

to
string

Destination network or exchange you want the users to transfer from, for example ETHEREUM_MAINNET.

asset
string

The asset that you want to be preselected. NOTE: available assets depend on the selected network, for example, the asset IMX is only available in the IMMUTABLEX_MAINNET network.

destAddress
string

The destination address the funds should reach at the end of the swap.

hideAddress
true or false

If set to true, destination address will be hidden in the UI.

lockAddress
true or false

If set to true, the destination address will be locked for editing.

hideFrom
true or false

If set to true, the source will be hidden in the UI.

lockFrom
true or false

If set to true, the source will be locked for editing.

hideTo
true or false

If set to true, the destination will be hidden in the UI.

lockTo
true or false

If set to true, the destination will be locked for editing.

lockAsset
true or false

If set to true, the asset will be locked for editing.

hideRefuel
true or false

If set to true, refuel feature will be disabled and not shown in the UI.

clientId
string

Clinet Id from partner setup. And if the destAddress parameter is provided, the Partner’s logo will be shown next to the address.

amount
number

Use to pre-fill the amount field. Users will still be able to change it in the UI. The parameter will be skipped if the asset parameter was not passed.

externalId
string

A unique ID representing the user’s transfer session in the partner’s system. This can later be used to query the status of the transfer and will be included in the webhook notifications sent to the partner. Refer to the API Reference section to learn more.

account
string

User account name or address that will be shown as a source. hideFrom should be set to true

actionButtonText
string

Use to replace Swap now button text. For example, it can be changed to Deposit or Withdraw.

Was this page helpful?