Files
proxmox/docs/archive/fixes/THIRDWEB_BRIDGE_QUICK_FIX.md
defiQUG cb47cce074 Complete markdown files cleanup and organization
- 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.
2026-01-06 01:46:25 -08:00

2.7 KiB

thirdweb Bridge - Quick Fix Guide

What's Missing: 5 Critical Requirements


🔴 CRITICAL: API Secret Key

Problem: 401 Unauthorized - Authentication required

Fix:

  1. Sign up: https://thirdweb.com
  2. Dashboard → Settings → API Keys
  3. Generate secret key
  4. 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:

  1. Fix contract metadata
  2. Use WETH10 if it has correct metadata
  3. 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:

  1. Checks chain support
  2. Checks token recognition
  3. 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

  1. Get API Key (5 minutes)
  2. Check Chain Support (1 minute)
  3. Update Script Format (5 minutes)
  4. Test Quote (1 minute)
  5. Fix Metadata (if needed, hours/days)

Total Time: ~15 minutes (if chain supported)


See: docs/THIRDWEB_BRIDGE_MISSING_REQUIREMENTS.md for full details