Skip to content

feat(trustwallet): add tron namespace support - #1438

Open
llawliet-l-l wants to merge 1 commit into
nextfrom
feat/RC-304-trustwallet-tron-intergration
Open

llawliet-l-l wants to merge 1 commit into
nextfrom
feat/RC-304-trustwallet-tron-intergration

Conversation

@llawliet-l-l

@llawliet-l-l llawliet-l-l commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the Tron namespace to the Trust Wallet provider, wiring the extension's
TronLink-compatible instance (window.trustwallet.tronLink) into the hub with
connect / disconnect / eager-connect, account-change tracking, and signing.

Changes

  • New actions/tron.ts, builders/tron.ts, namespaces/tron.ts following the
    actions/builders split; Tron added to provider metadata and registration

  • Account changes subscribe to the instance's own accountsChanged event
    (string[] of base58 addresses; empty array → disconnect)

  • Custom CustomTronSigner extends DefaultTronSigner and strips the extra
    type field Rango puts inside raw_data.contract[*].parameter.value, which
    Trust's strict wallet-core parser rejects (signature unaffected — it covers
    txID/raw_data_hex)

  • Message-less user rejection ({code: 4001}) mapped to
    "User rejected the request" with the code kept on the error

  • canEagerConnect returns false (never throws) when the late-injected Tron
    shim isn't ready — auto-connect runs independently of the installed flag

  • Docs: support matrix and provider readme notes (switch-account
    reload caveat, auto-connect limitation)

    How tested

Manually against the Trust Wallet browser extension: connect, user rejection
(correct message, no masked listener error), account-switch/disconnect events,
and a real swap transaction that drove the wallet-core parser fix. Package
build, eslint, and ts-check pass.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Implemented a user interface (UI) change, referencing our Figma design to ensure pixel-perfect precision.

Comment thread wallets/provider-trustwallet/src/actions/tron.ts Outdated

@arlert-armin arlert-armin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants