This guide will help you get started with integrating the TwoCoin widget into your website. Follow these steps to begin offering cryptocurrency exchange functionality to your users.
Integrating the TwoCoin widget is a straightforward process:
The TwoCoin widget can be integrated into your website using the following methods:
The simplest way to integrate the widget is using an iframe with URL parameters:
<iframe
src="https://your-widget-domain.com/widget?paramName=value"
title="TwoCoin Widget"
width="100%"
height="800px"
frameBorder="0">
</iframe>
You can also redirect users directly to the widget page with configuration parameters:
<a href="https://your-widget-domain.com/widget?paramName=value"
target="_blank"
class="widget-button">
Buy Cryptocurrency
</a>
<!-- Or redirect programmatically -->
<script>
function openWidget() {
const params = new URLSearchParams({
walletAddress: '0x1234567890abcdef',
country: 'US',
state: 'NY',
fromCurrency: 'USD',
toCurrency: 'BTC'
});
const widgetUrl = 'https://your-widget-domain.com/widget?' + params.toString();
window.open(widgetUrl, '_blank');
}
</script>
The widget is configured through URL parameters. You can pre-configure various aspects of the widget by passing parameters in the URL. See the Widget Configuration section for detailed information.
Parameter | Description | Example |
---|---|---|
walletAddress | Pre-configured wallet address (read-only in UI) | 0x1234567890abcdef |
hideWallet | Hide wallet address section (requires walletAddress) | true |
country | Pre-configured country code (read-only in UI) | US |
state | Pre-configured state code (requires country) | NY |
hideCountryAndState | Hide country/state section (requires country) | true |
fromCurrency | Pre-configure the source currency | USD |
toCurrency | Pre-configure the target currency | BTC |
lockCurrencies | Lock currency selection to prevent changes | true |
hideOrders | Hide the "View Orders" button | true |
https://your-widget-domain.com/widget?walletAddress=0x1234567890abcdef&hideWallet=true&country=US&state=NY&fromCurrency=USD&toCurrency=BTC&lockCurrencies=true&hideOrders=true
If you encounter any issues or have questions not addressed in this documentation, please contact our support team on Telegram at https://t.me/cs_2coin (@cs_2coin).