Exchange widget
This is the mainnet API. Real funds on every network.
Put a complete swap on any site with one iframe. Visitors swap inside it. Widget swaps are free while the widget is in preview, so your credit balance is never touched.
Get the snippet
- Sign in, accept the terms, and open Exchange widget.
- Select Create key.
- Pick the pair and theme, select Save defaults, then copy the snippet.
- Paste it into your page.
The preview on API access is live. A swap started there counts toward your daily limit.
<iframe src="https://allways.venturalabs.ai/widget?key=alw_pub_abcdefghijklmnopqrstuvwxyz0123456789ABCDEFG" width="380" height="560" style="border:0;max-width:100%" allow="clipboard-write" title="Swap"></iframe>Parameters
| Parameter | Value |
|---|---|
key | Your publishable alw_pub_… widget key. It is safe in page source. |
from | Currency to send first, an id from GET /v1/currencies such as sol. |
to | Currency to receive first, such as tao. One side must be SOL, TAO, or a subnet token (sn<N>). |
theme | auto follows the visitor's device, not your page. Set light or dark to match your site. |
Only key is required. A from/to or theme left out uses your saved defaults, read on every load, so a new save reaches live embeds without a new snippet. A value in the URL or in a posted message always wins over the saved one. An unsupported pair falls back to the saved pair, then the built-in one. Visitors can change the pair.
What visitors see
- Pick the pair and amount, then enter the send-from and receive-at addresses.
- Pass a short human check and press Swap. Pressing Swap accepts the Terms and Privacy Policy.
- Send exactly the shown amount to the deposit address, from the address they entered, before the timer ends (about 5 minutes). A deposit from another wallet is not matched.
- Watch progress until the swap is complete or refunded. Track in a new tab opens the same swap.
Cost
Widget swaps are free while the widget is in preview: no credit is spent, and your balance is never touched. Visitors still send the swap amount and pay their own network fee. The limits below are the only ceiling.
Paused
Visitors see Swaps are paused on this site when:
| Cause | Fix |
|---|---|
| Key missing, wrong, or rotated | Copy the snippet again |
| Daily limit reached | Wait up to 24 hours |
| Widget swaps are off on the service | Contact support |
A missing or malformed key, or widget swaps being off, pauses at once. The other causes show after the visitor presses Swap.
Limits
- 100 swap attempts per account in each 24-hour window, by default. An attempt that passes the human check counts, even if it then fails. The service may change this.
- A service-wide daily ceiling across every widget. When it is spent, embeds pause until the next day.
- Each visitor IP can start 3 swaps per minute.
Where it works
- Paste it in a raw HTML block: WordPress Custom HTML, Webflow Embed, Squarespace Code. Editors that strip iframes drop it.
- If your site sends a Content-Security-Policy, add
https://allways.venturalabs.aitoframe-src. - Open the page over http or https. A file opened from disk cannot show it.
- Keep
allow="clipboard-write"so the copy buttons work. - The widget is built for 380 × 560 px.
max-width:100%lets it shrink on phones; keepheight="560", or fit it with the size event below.
Privacy and events
- Widget swaps belong to your account. Your Receipts and
GET /v1/exchangesshow each visitor's addresses. - The widget's only event is
{ type: 'allways:widget-size', height }, posted to your page when its content height changes. Set the iframe height to it to fit every step without scrolling.
Rotate the key
Rotate the key from Exchange widget. The old key stops working immediately, so replace it in every embed.
