- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
2.7 KiB
thirdweb Bridge - Quick Fix Guide
What's Missing: 5 Critical Requirements
🔴 CRITICAL: API Secret Key
Problem: 401 Unauthorized - Authentication required
Fix:
- Sign up: https://thirdweb.com
- Dashboard → Settings → API Keys
- Generate secret key
- Export:
export THIRDWEB_SECRET_KEY=your_key
Test:
THIRDWEB_SECRET_KEY=your_key ./scripts/test-thirdweb-bridge-with-auth.sh
🟡 HIGH: Chain Support Check
Problem: ChainID 138 may not be supported
Fix:
curl -X GET "https://api.thirdweb.com/v1/bridge/chains" \
-H "x-secret-key: $THIRDWEB_SECRET_KEY" | jq '.[] | select(.chainId == 138)'
If Not Supported: Request support from thirdweb or use CCIP Bridge
🟡 HIGH: Correct API Format
Problem: Using wrong endpoint/format
Wrong:
POST https://bridge.thirdweb.com/api/quote
Correct:
POST https://api.thirdweb.com/v1/bridge/swap
Headers:
- x-secret-key: <YOUR_KEY>
Body:
{
"from": "0xWALLET",
"exact": "input",
"tokenIn": { "address": "...", "chainId": 138, "amount": "..." },
"tokenOut": { "address": "...", "chainId": 1, "minAmount": "0" }
}
🟡 MEDIUM: Token Recognition
Problem: WETH may not be registered
Check:
curl -X GET "https://api.thirdweb.com/v1/bridge/tokens?chainId=138" \
-H "x-secret-key: $THIRDWEB_SECRET_KEY" | jq '.[] | select(.address == "0xC02aaA39...")'
If Not Recognized: Contact thirdweb to register token
🟠 LOW: ERC-20 Metadata
Problem: symbol() and decimals() return unexpected values
Impact: May affect token recognition
Fix Options:
- Fix contract metadata
- Use WETH10 if it has correct metadata
- Request thirdweb to accept token despite metadata issues
Quick Test Script
Ready-to-use script: scripts/test-thirdweb-bridge-with-auth.sh
Usage:
THIRDWEB_SECRET_KEY=your_key \
WALLET_ADDRESS=0xYourWallet \
./scripts/test-thirdweb-bridge-with-auth.sh
What it does:
- ✅ Checks chain support
- ✅ Checks token recognition
- ✅ Gets bridge quote
Alternative: CCIP Bridge ✅
If thirdweb Bridge requirements are too complex:
Use CCIP Bridge (already available):
- ✅ No API keys needed
- ✅ Already deployed
- ✅ Supports ChainID 138
- ✅ Secure and audited
Route: Bridge WETH → Swap to USDT on Mainnet
Priority Order
- Get API Key (5 minutes)
- Check Chain Support (1 minute)
- Update Script Format (5 minutes)
- Test Quote (1 minute)
- Fix Metadata (if needed, hours/days)
Total Time: ~15 minutes (if chain supported)
See: docs/THIRDWEB_BRIDGE_MISSING_REQUIREMENTS.md for full details