fix: build spec-compliant TRON transactions for WalletConnect signing#5638
fix: build spec-compliant TRON transactions for WalletConnect signing#5638enesozturk wants to merge 3 commits intomainfrom
Conversation
…ormat The TonWalletConnectConnector was passing sendMessage params through without converting field names to the snake_case format required by the WalletConnect TON JSON-RPC spec. This caused wallets to fail with "Messages are absent" because: 1. Field names were camelCase (validUntil, extraCurrency) instead of snake_case (valid_until, extra_currency) as required by the spec 2. Params were wrapped in an array, but the sample wallet's approveTonRequest handler passes request.params directly to sendMessage without unwrapping — unlike signData which correctly unwraps with request.params[0] Changes: - Convert validUntil to valid_until with a default 60s expiry - Convert extraCurrency to extra_currency in message objects - Ensure amount is always a string (wallets validate typeof) - Send params as a plain object instead of array for compatibility The injected wallet connector (TonConnectConnector) already handled this conversion correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The TronWalletConnectConnector was sending simplified {to, from, value}
objects via tron_signTransaction, but the WC spec requires full unsigned
transaction objects (with raw_data, raw_data_hex, txID, visible).
Changes:
- TronWalletConnectConnector now builds unsigned tx via Blockchain API's
tron_createTransaction, sends full tx to wallet for signing, then
broadcasts via tron_broadcastTransaction
- TronConnectConnector refactored to use Blockchain API instead of
hardcoded TronGrid URLs
- Added TRON chains to WC_HTTP_RPC_SUPPORTED_CHAINS
- Added chainDefault RPC URLs to TRON chain definitions as fallbacks
- Added unit tests for the WC connector transaction flow
Depends on: reown-com/blockchain-api#1396
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
9 Skipped Deployments
|
Visual Regression Test Results ✅ PassedChromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=875 👉 Please review the visual changes in Chromatic and accept or reject them. |
|
📦 Bundle Size Check✅ All bundles are within size limits 📊 View detailed bundle sizes> @reown/appkit-monorepo@1.7.1 size /home/runner/work/appkit/appkit > size-limit |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary
tron_createTransactionmethod before sending them to wallets viatron_signTransaction, then broadcasts viatron_broadcastTransactiontron:0x2b6653dc,tron:0xcd8690dc) toWC_HTTP_RPC_SUPPORTED_CHAINSchainDefaultRPC URLs to TRON chain definitions as fallbacksProblem
The
TronWalletConnectConnector.sendTransaction()was sending a simplified{to, from, value}object as thetransactionparameter totron_signTransaction. According to the WalletConnect TRON RPC spec, wallets expect a full unsigned TRON transaction object withraw_data,raw_data_hex,txID, andvisiblefields.Wallets implementing the spec correctly (e.g. JustLend DAO) reject these malformed transaction objects.
Solution
The connector now follows a 3-step flow:
tron_createTransaction)tron_signTransaction)tron_broadcastTransaction)All TRON fullnode interactions are routed through our Blockchain API infrastructure instead of hardcoding third-party TronGrid URLs.
Dependencies
tron_createTransactionwrapper to the Blockchain API)Test plan
pnpm build— 24/24 tasks successfulpnpm -w run prettier:format🤖 Generated with Claude Code