Swapping For Developers

Exchanging Cross-Chain-Tokens to VET/VTHO and supported ecosystem tokens is available via API. Each swap is identified by a swapId for tracking.

How to embed

You can embed the swap functionality as IFrame into your website:
<iframe
    src="https://bridge.vet/iframe"
    width="800"
    height="800"
    frameborder="0"
    name="Swap Tokens"
/>
  1. 800x800 is suggested for Desktop size
  2. 480x480 is suggested for Mobile size

How to get supported Tokens

You can get a list of all vechain supported tokens from the API at:
https://bridge.vet/api/swap/tokens
You can get a list of all cross-chain supported tokens from the API at:
https://bridge.vet/api/swap/pairs/:direction/:token
  1. direction: (string) from | to
  2. token: (string) vet | vtho | vechain token symbol

How to get an Estimate

You can get a range of values that are supported on a given pair by calling its range endpoint:
https://bridge.vet/api/swap/:from/:to/range
You can get an estimated result list of all cross-chain supported tokens from the API at:
https://bridge.vet/api/swap/:from/:to/estimate?amount=:amount

How to start a Swap

You can start a new swap with a JSON POST to the API at:
https://bridge.vet/api/swap
{
    "amount": 0.5,
    "from": "eth",
    "to": "vet:vet",
    "address: "0x...."
}
The response will be the swapId of the newly created swap:
{ "swapId": "0:1234567890abcdef" }

How to check a Swap-Status

You can access the status of a swap with the API at:
https://bridge.vet/api/swap/status/:swapId