Bridge & Cross-chain Features
POTLAUNCH integrates with NEAR Intents to provide seamless cross-chain token transfers and swaps. NEAR Intents is a multichain transaction protocol where users specify desired outcomes and let third parties (Market Makers) compete to provide the best solution.
Overview
NEAR Intents enables:
- Cross-chain token swaps - Exchange tokens between different blockchains
- Competitive pricing - Market Makers compete to offer the best rates
- Automatic settlement - Smart contracts verify and settle all transactions
- Wide chain support - Support for multiple blockchains including NEAR, Ethereum, Solana, and more
Using NEAR Intents for Deposits
NEAR Intents simplifies cross-chain deposits through the 1Click Swap API, which abstracts away the complexity of intent creation, solver coordination, and transaction execution.
How 1Click Works
The 1Click API provides a simple REST interface for cross-chain swaps:
- Request a Quote - Get the best available rate with a unique deposit address
- Transfer Tokens - Send tokens to the provided deposit address
- Automatic Processing - 1Click coordinates with Market Makers to execute your swap
- Receive Tokens - Get tokens delivered to your specified address
Swap Process Flow
Supported Tokens
To check which tokens are supported for cross-chain transfers, use the tokens endpoint:
GET https://1click.chaindefuser.com/v0/tokensEach token includes:
- Blockchain network
- Contract address
- Current price in USD
- Symbol and decimals
- Last price update timestamp
Bridging Tokens with 1Click API
Step 1: Request a Swap Quote
Request a quote by providing swap parameters:
POST https://1click.chaindefuser.com/v0/quote
{
"dry": false,
"swapType": "EXACT_INPUT",
"slippageTolerance": 100, // 1% = 100 basis points
"originAsset": "nep141:wrap.near",
"depositType": "ORIGIN_CHAIN",
"destinationAsset": "nep141:usdc.near",
"amount": "1000000000000000000000000", // 1 NEAR in yoctoNEAR
"recipient": "your-wallet.near",
"refundTo": "your-wallet.near",
"refundType": "ORIGIN_CHAIN"
}Key Parameters
| Parameter | Description |
|---|---|
swapType | EXACT_INPUT or EXACT_OUTPUT - how to interpret the amount |
slippageTolerance | Maximum acceptable slippage in basis points (100 = 1%) |
originAsset | Token you’re sending (format: nep141:contract-address) |
destinationAsset | Token you want to receive |
amount | Amount in smallest token unit (with decimals) |
recipient | Destination address for received tokens |
refundTo | Address for refunds if swap fails |
Step 2: Transfer Tokens
The quote response includes a unique depositAddress. Transfer your tokens to this address to initiate the swap:
{
"quote": {
"depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8",
"depositMemo": "1111111", // Required for some chains
"amountIn": "1000000",
"amountOut": "9950000",
"deadline": "2025-03-04T15:00:00Z",
"timeEstimate": 120 // seconds
}
}Important for CEX users: Centralized exchanges often use intermediate deposit addresses. These may not credit deposits from NEAR Intents until recognized. Send a small test amount first.
Step 3: Submit Deposit Transaction (Optional)
Speed up processing by notifying 1Click of your deposit:
POST https://1click.chaindefuser.com/v0/deposit/submit
{
"depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8",
"txHash": "0x123abc456def789..."
}Step 4: Monitor Swap Status
Check your swap progress:
GET https://1click.chaindefuser.com/v0/status?depositAddress=0x76b4c56085ED136a8744D52bE956396624a730E8Managing Bridged Tokens
Swap Statuses
Your swap will progress through these states:
| Status | Description |
|---|---|
PENDING_DEPOSIT | Waiting for deposit to the deposit address |
PROCESSING | Deposit detected, Market Makers are executing |
SUCCESS | Tokens delivered to destination address |
INCOMPLETE_DEPOSIT | Deposit below required amount |
REFUNDED | Swap failed, funds returned to refund address |
FAILED | Swap failed due to error |
Checking Swap Details
The status endpoint returns comprehensive swap information:
{
"status": "SUCCESS",
"swapDetails": {
"amountIn": "1000000",
"amountInFormatted": "1.0",
"amountInUsd": "2.79",
"amountOut": "9950000",
"amountOutFormatted": "9.95",
"amountOutUsd": "9.95",
"slippage": 50,
"originChainTxHashes": [...],
"destinationChainTxHashes": [...]
}
}Handling Failed Swaps
If a swap fails:
- Automatic Refund - Funds are automatically returned to your
refundToaddress - Check Status - Use the status endpoint to see failure reason
- Retry - Create a new quote and retry the swap
Cross-chain Transactions
Supported Chains
NEAR Intents supports multiple blockchain networks. Check the Chain Support documentation for the full list of supported chains and their address formats.
Fee Structure
1Click Swap API Fees
- With API Key: Only 0.0001% protocol fee applies
- Without API Key: Additional 0.1% fee (total: ~0.1001%)
- Apply for API Key
Application Fees
Developers can add custom fees using the appFees parameter:
{
"appFees": [
{
"recipient": "your-app.near",
"fee": 50 // 0.5% = 50 basis points
}
]
}See 1Click App Fees Calculation for details on how fees are calculated.
Treasury Addresses
For transparency, all NEAR Intents treasury addresses are publicly listed. View them at:
Security & Compliance
NEAR Intents implements security measures and compliance standards:
- Smart Contract Verification - All transactions verified on NEAR Protocol
- Automatic Refunds - Failed swaps automatically refunded
- Risk Management - See Risk and Compliance
- Security Practices - Review Security Documentation
Advanced Features
Exact Input vs Exact Output
- EXACT_INPUT: Specify exact amount to send, receive variable amount
- EXACT_OUTPUT: Specify exact amount to receive, send variable amount
Slippage Tolerance
Control price movement acceptance:
- 50 basis points = 0.5% slippage
- 100 basis points = 1% slippage (recommended)
- 200 basis points = 2% slippage
Virtual Chain Recipients
For advanced use cases, specify virtual chain recipients for complex routing:
{
"virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C"
}Custom Recipient Messages
Send messages with your transfer for smart contract recipients:
{
"customRecipientMsg": "smart-contract-recipient.near"
}Integration Examples
TypeScript SDK
import { DefuseClient } from '@defuse-protocol/sdk';
const client = new DefuseClient({
apiKey: 'your-api-key'
});
// Request quote
const quote = await client.requestQuote({
swapType: 'EXACT_INPUT',
originAsset: 'nep141:wrap.near',
destinationAsset: 'nep141:usdc.near',
amount: '1000000000000000000000000',
recipient: 'recipient.near',
refundTo: 'sender.near'
});
// Check status
const status = await client.getSwapStatus(quote.depositAddress);Code Examples
For complete integration examples, see:
Best Practices
- Test First - Always test with small amounts before large transfers
- Monitor Status - Regularly check swap status for time-sensitive operations
- Handle Refunds - Ensure refund addresses are always accessible
- Set Appropriate Slippage - Balance between execution success and price protection
- Use API Keys - Obtain an API key to minimize fees
- Check Deadlines - Ensure deposits are made before the quote deadline
Support & Resources
Next Steps
Ready to continue? Check out these related guides:
- Token Launch Guide - Learn how to launch tokens that support cross-chain features
- Advanced Launch Settings - Configure advanced launch parameters
- API Reference - Integrate POTLAUNCH into your application
- Developer Guide - Build with the POTLAUNCH SDK