Get Available Routes

Before creating a swap, it's possible to programmatically retrieve all possible supported routes. The endpoint is public and does not require any authorization.

GET https://api.layerswap.io/api/available_networks

Query Parameters

NameTypeDescription

version

String

Possible values “sandbox” | any. If a sandbox value is provided, only the Testnet networks will be returned. For any other values - only the Mainnet networks will be returned.

sourceAsset

String

The currency name to be filtered. Example: USDT.

destination

String

The supported blockchain network name to be filtered. See available values.

source

String

The supported blockchain network name to be filtered. See available values.

destinationAsset

String

The currency name to be filtered. Example: USDT.

{
  "data": [
    {
      "source": "STARKNET_MAINNET",
      "source_asset": "USDC",
      "destination": "OPTIMISM_MAINNET",
      "destination_asset": "USDC"
    },
    {
      "source": "STARKNET_MAINNET",
      "source_asset": "ETH",
      "destination": "OPTIMISM_MAINNET",
      "destination_asset": "ETH"
    }
  ],
  "error": null
}

Raw request

curl -X 'GET' \
  'https://api.layerswap.io/api/available_routes'

Raw response

{
  "data": [
    {
      "source": "STARKNET_MAINNET",
      "source_asset": "USDC",
      "destination": "OPTIMISM_MAINNET",
      "destination_asset": "USDC"
    },
    {
      "source": "STARKNET_MAINNET",
      "source_asset": "ETH",
      "destination": "OPTIMISM_MAINNET",
      "destination_asset": "ETH"
    }
  ],
  "error": null
}

Last updated

© 2023 Bransfer, Inc. All rights reserved.