Direct Swap API

Introduction

The Direct Swap API provides seamless integration for cross-chain token swaps. This service supports:

  • Access Key Management: Create, check, and manage API access keys.

  • Quote Generation: Generate swap quotes with customizable parameters.

  • Swap Execution: Perform swaps securely across supported blockchain networks.

  • Transaction Tracking: Monitor swap progress and confirm transaction completion.

Endpoints

/l1x_getNetworkList

GET

Retrieve a list of all supported networks.

/l1x_getXtalkStatus?swapId=<id>

GET

Get the status of a specific swap using its Swap ID.

/access_key/l1x_accessKeyStatus

GET

Check the status of an existing access key.

/access_key/l1x_accessKeyRequest

POST

Request a new access key for API usage.

/l1x_getQuote

POST

Generate a swap quote with input parameters.

/l1x_createSwap

POST

Create and execute a swap using a quote ID.

Detailed Endpoint Descriptions

  1. List Supported Networks

    1. Method: GET

    2. Endpoint: /l1x_getNetworkList

    3. Description: Retrieves a list of all blockchain networks supported by the Direct Swap service.

  • Response Example:

  1. Get Direct X-Talk Status

    • Method: GET

    • Endpoint: /l1x_getXtalkStatus

    • Description: Retrieves the current status of a specific swap.

    • Query Parameters:

      • swapId (required): The unique identifier of the swap.

    • Response Example

  1. Check Access Key Status

    • Method: GET

    • Endpoint: /access_key/l1x_accessKeyStatus

    • Description: Checks whether an access key is active and valid.

    • Response Example

  1. Request Access Key

    • Method: POST

    • Endpoint: /access_key/l1x_accessKeyRequest

    • Description: Requests a new access key for API usage.

    • Request Body:

  • Response Body:

  1. Generate Swap Quote

    • Method: POST

    • Endpoint: /l1x_getQuote

    • Description: Generates a quote for a swap based on provided parameters.

    • Request Body Parameters:

      • sourceChainId (required): The ID of the source blockchain.

      • destinationChainId (required): The ID of the destination blockchain.

      • sourceAmount (required): The amount to be swapped.

      • affiliatePercentage (optional): Commission percentage for affiliates (set to 0 if not applicable).

      • affiliateAddress (optional): Wallet address for affiliate commissions.

    • Response Example:

  1. Create Swap

    • Method: POST

    • Endpoint: /l1x_createSwap

    • Description: Creates and executes a swap using the generated quote.

    • Request Body Parameters:

      • quoteId (required): The ID of the generated quote.

      • sender (required): The wallet address of the sender.

      • receiver (required): The wallet address of the receiver.

      • sourceAssetSymbol (required): Token symbol on the source chain.

      • destinationAssetSymbol (required): Token symbol on the destination chain.

    • Response Example:

  1. Get Affiliate History

    • Method: GET

    • Endpoint: /l1x_getAffiliateHistory

    • Description: Retrieves the affiliate commission history.

Last updated