Skip to content

fix(forge): convert TRON hex addresses to Base58 in API service - #222

Merged
Gaubee merged 1 commit into
mainfrom
fix/tron-address-conversion
Jan 12, 2026
Merged

Gaubee merged 1 commit into
mainfrom
fix/tron-address-conversion

Conversation

@Gaubee

@Gaubee Gaubee commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Backend returns TRON addresses in hex format (41...), but frontend SDK requires Base58 format (T...).

Changes

  • Add tron-address.ts with tronHexToBase58() conversion utility using Web Crypto API
  • Wrap rechargeApi.getSupport() to auto-convert TRON depositAddress and contract fields
  • Add 15 unit tests for address conversion

Verification

node .chat/tron-hex-to-base58.mjs
Hex Base58
412c9d3ed50dd097bc491d4164e39fe14d5288b554 TE3776zaaZvY5J5EEdvkYTGQePDYdJs84N
41a614f803b6fd780986a42c78ec9c7f77e6ded13c TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t

Testing

  • 66 tests passing in forge miniapp

- Add tron-address.ts with tronHexToBase58() conversion utility
- Wrap rechargeApi.getSupport() to auto-convert TRON depositAddress and contract
- Backend returns TRON addresses in hex format (41...), frontend needs Base58 (T...)
@Gaubee
Gaubee force-pushed the fix/tron-address-conversion branch from b7f38d4 to f8d4689 Compare January 12, 2026 04:51
@Gaubee
Gaubee merged commit 3a2c7f2 into main Jan 12, 2026
14 of 20 checks passed
@Gaubee
Gaubee deleted the fix/tron-address-conversion branch January 12, 2026 05:00
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