Layerswap API
API Explorer
  • Overview
  • Partner Setup
  • UI Integration
    • Layerswap-hosted page
    • Embedded form
    • Customization
      • Interactive Builder
  • API Integration
    • Quickstart
    • API Reference
    • Swap lifecycle
    • Webhooks
    • DEPRECATED - V1 API Reference
      • Get Available Networks
      • Get Available Routes
      • Get Swap Rate
      • Create Fast Swap
      • Create Swap
      • Prepare Source Transaction
      • Get Swap
  • Mixed Integration
    • Swap Link
  • Data
    • Object types
    • Supported Platforms
      • Supported Networks
      • Supported Fiat Providers
      • Supported CEXes
Powered by GitBook

Layerswap

  • App
  • Explorer
  • Twitter
  • Discord

© 2023 Bransfer, Inc. All rights reserved.

On this page
  • Raw request
  • Raw response

Was this helpful?

Export as PDF
  1. API Integration
  2. DEPRECATED - V1 API Reference

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

Name
Type
Description

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

source

String

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 1 year ago

Was this helpful?

The supported blockchain network name to be filtered.

The supported blockchain network name to be filtered.

See available values.
See available values.