๐ Overview
CryptoForge allows external websites to redirect their users directly to our swap interface with pre-selected tokens. This integration enhances user experience by avoiding manual navigation.
๐ URL Format
The base URL for external integration is:
https://world-of-coin.com/?page=trade&tab=swap&to=[TOKEN]&from=[TOKEN]
โ๏ธ Available Parameters
Parameter |
Required |
Description |
Example |
page |
Yes |
Destination page (must be "trade") |
trade |
tab |
Yes |
Tab to open (must be "swap") |
swap |
to |
No |
Destination token (symbol or address) |
USDC or 0xA0b86a33E6264176FD012245D2A4eB35e52B2a |
from |
No |
Source token (symbol or address) |
ETH or 0xA0b86a33E6417... |
๐ก Usage Examples
1. Swap to specific token
Redirect user to buy USDC:
https://world-of-coin.com/?page=trade&tab=swap&to=USDC
2. Complete pre-configured swap
Exchange ETH for USDC:
https://world-of-coin.com/?page=trade&tab=swap&from=ETH&to=USDC
3. Using contract addresses
For lesser-known tokens:
https://world-of-coin.com/?page=trade&tab=swap&to=0xA0b86a33E6264176FD012245D2A4eB35e52B2a
๐งช Live Testing
Click the links below to test the integration:
๐ป JavaScript Integration
Example code to dynamically generate swap links:
function generateSwapLink(baseUrl, options = {}) {
const params = new URLSearchParams({
page: 'trade',
tab: 'swap'
});
if (options.to) params.append('to', options.to);
if (options.from) params.append('from', options.from);
return `${baseUrl}?${params.toString()}`;
}
// Usage examples
const swapToUSDC = generateSwapLink('https://world-of-coin.com', {
to: 'USDC'
});
const ethToUsdc = generateSwapLink('https://world-of-coin.com', {
from: 'ETH',
to: 'USDC'
});
๐จ HTML Integration
Simply add links to your website:
<!-- Simple button -->
<a href="https://world-of-coin.com/?page=trade&tab=swap&to=USDC"
target="_blank"
class="swap-btn">
Swap to USDC
</a>
<!-- Styled button -->
<a href="https://world-of-coin.com/?page=trade&tab=swap&from=ETH&to=USDC"
target="_blank"
style="background: #667eea; color: white; padding: 12px 24px;
border-radius: 8px; text-decoration: none;
display: inline-block; margin: 10px;">
๐ Swap ETH โ USDC
</a>
โ ๏ธ Important Notes
- Parameters are case-insensitive (ETH = eth = Eth)
- If a token is not found, it will simply be ignored
- Users must always connect their wallet to perform swaps
- Standard Ethereum network fees apply