Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Before creating a swap, it's possible to programmatically retrieve available sources, destinations and assets for swaps. The endpoint is public and does not require any authorization.
GET
https://api.layerswap.io/api/available_networks
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.
Before creating a swap, it's possible to programmatically retrieve data about the valid minimum/maximum swap amount and the Layerswap fee. The endpoint is public and does not require any authorization.
POST
https://api.layerswap.io/api/swap_rate
Content-Type*
String
application/json
source*
String
destination*
String
source_asset*
String
The currency name. Example: USDC
refuel*
String
If set to true, the user will receive an additional refuel transaction in the native currency for the swap.
destination_asset
String
The currency name. Example: USDC
A detailed explanation of the Swap Rate Object is available here.
In order to initiate the process of bridging assets across blockchains, CEXes, and fiat, a Swap should be created. Swap has all the necessary information required to be able to process transfers from the source to the destination.
POST
https://api.layerswap.io/api/swaps
Create swap
This endpoint provides the ability to create a swap with as few parameters as possible - destination network, asset and amount. Then, the endpoint will return all the possible source networks which can be used for transferring the funds to the destination network. The returned source networks are tracked for a possible deposit.
POST
https://api.layerswap.io/api/swaps/fast
Create fast swap
This endpoint return all the neccessary information to execute source transaction.
GET
https://api.layerswap.io/api/swaps/{id}/prepare_src_transaction
Prepare swap deposit for execution
Note that you should execute this transaction manually. You should compose it based on the response and send to your wallet for execution. (Ex. User's Metamask, wallet managed by Fireblocks)
The supported blockchain network name.
The supported blockchain network/CEX/fiat provider name.
A detailed explanation of Swap Object is available .
GET
No
https://api.layerswap.io/api/available_networks
GET
No
https://api.layerswap.io/api/available_routes
GET
No
https://api.layerswap.io/api/swap_rate
POST
Yes
https://api.layerswap.io/api/swaps
POST
No
https://api.layerswap.io/api/swaps/fast
POST
Yes
https://api.layerswap.io/api/swaps/{id}/prepare
GET
Yes
https://api.layerswap.io/api/swaps/{id}
Cancel Swap
DELETE
Yes
https://api.layerswap.io/api/swaps/{id}
id*
String
ID can be either the Swap response data.id received in the create swap endpoint or a partner provided reference_id from the create swap request
X-LS-APIKEY*
API Key Retrived from Partner Setup
X-LS-APIKEY*
String
API Key retrieved from Partner Setup
Content-Type*
application/json
destination*
String
The supported blockchain network name, where the funds should be sent by the user. See available values.
source*
String
The supported blockchain network name, where the funds should be sent by the user. See available values.
amount*
Number
The predefined amount. Note that this is NOT the final amount sent by the user since the user can specify another amount while transferring.
source_asset*
String
The swap currency name. See available assets.
destination_address*
String
The destination network address, where the user will receive the funds.
refuel*
Bool
If set to true, the user will receive an additional refuel transaction in the native currency to the specified destination_address.
reference_id
String
Partner specified ID that could be used for the future reference to retrieve the swap.
destination_asset
String
The swap currency name. See available assets.
client_id
String
Optionally can be passed to the application Client ID.
Content-Type*
String
application/json
destination_address*
String
The destination network address, where the user will receive the funds.
destination_asset*
String
The swap currency name. See available assets.
destination_network*
String
The supported blockchain network name, where the funds should be sent by the user. See available values.
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.
id*
String
The Swap response data.id received in the create swap endpoint
from_address
String
Address from which the transaction is going to be executed
X-LS-APIKEY*
API Key retrieved from Partner Setup