Skip to content

Conversation

@myzykj
Copy link
Contributor

@myzykj myzykj commented Sep 15, 2025

TRON WalletConnect Structure Compatibility Update

Description

This PR updates the TRON WalletConnect implementation to align the transaction signing data structures exchanged between DApps and wallets. The change ensures backward compatibility across different versions of the transaction data format. The changes include:

  1. Dapp side updates:

    • Added tron_method_version session property to indicate the structure version being used
    • When tron_method_version === "v1", uses the new structure: params = { address, transaction }
    • When tron_method_version !== "v1" or not present, uses the old structure: params = { address, transaction: { transaction } }
  2. Wallet side updates:

    • Updated [TronRequestHandlerUtil.ts] to handle both new and old TRON transaction structures
    • Used compatible access pattern: request.params.transaction?.transaction || request.params.transaction
  3. Backward compatibility:

    • Ensures that older dapps can continue to work with the updated wallet
    • New dapps using v1 structure will work correctly
    • No breaking changes for existing implementations

 1. Change signing response structure to be compatible with both old and new wallets.
 2. fix tron logo link
 3. add trx balance
 4. update tronweb to v6 version
 5. compatible with both new and old structures in wallet
@vercel
Copy link

vercel bot commented Sep 15, 2025

Someone is attempting to deploy a commit to the Reown Team on Vercel.

A member of the Team first needs to authorize it.

# Conflicts:
#	advanced/dapps/react-dapp-v2/pnpm-lock.yaml
@jakubuid jakubuid requested a review from ganchoradkov October 16, 2025 14:08
Sam added 3 commits October 21, 2025 15:56
# Conflicts:
#	advanced/dapps/react-dapp-v2/package.json
#	advanced/dapps/react-dapp-v2/pnpm-lock.yaml
#	advanced/dapps/react-dapp-v2/src/contexts/JsonRpcContext.tsx
@myzykj
Copy link
Contributor Author

myzykj commented Oct 30, 2025

fix: return cached TronWeb instance and switch to verifyMessageV2

  • always return tronWebTestnet/tronWebMainnet after init to avoid undefined
  • add fallback return undefined for unknown chainId
  • use trx.verifyMessageV2(message, signature) to verify message

@myzykj
Copy link
Contributor Author

myzykj commented Oct 30, 2025

I have merged the latest from main and it runs successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant