Skip to content

fix: use tron_getAddressBalance JSON-RPC for TRON balance and update network preset IDs - #5565

Merged
0xmkh merged 1 commit into
mainfrom
fix/tron-balance-and-identity
Feb 27, 2026
Merged

fix: use tron_getAddressBalance JSON-RPC for TRON balance and update network preset IDs#5565
0xmkh merged 1 commit into
mainfrom
fix/tron-balance-and-identity

Conversation

@enesozturk

@enesozturk enesozturk commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • TRON balance: Switched from the /v1/account/{address}/balance REST endpoint (which uses TronGrid with free-plan rate limits) to the tron_getAddressBalance custom JSON-RPC method via BAPI (uses Quicknode, BAPI PR #1350). Parses the Quicknode account response to extract balance in SUN and converts to TRX (÷ 10^6).
  • Generic getAddressBalance: Made the method accept optional method and params parameters so chain-specific adapters (TRON, TON, etc.) can customize the JSON-RPC call without needing separate controller methods. TON adapter is unaffected (uses defaults).
  • TRON network images: Updated preset IDs for TRON mainnet, Shasta, and Nile testnet to use the correct network images.

Changes

File What changed
controllers/BlockchainApiController.ts getAddressBalance now accepts optional method and params, generic <T> for response type
controllers/utils/TypeUtil.ts Updated request/response types with optional fields and generic
adapters/tron/adapter.ts Uses tron_getAddressBalance method, parses response.data[0].balance from Quicknode
appkit-utils/PresetsUtil.ts Updated TRON network image preset IDs

Note

Requires tron_getAddressBalance to be available on the BAPI RPC provider for the project ID being used. Currently confirmed working on Quicknode provider. See BAPI PR #1350.

Test plan

  • Connect TronLink wallet — TRX balance should display correctly
  • TON adapter balance still works (uses default getAddressBalance params)
  • TRON network images display correctly in network selector

🤖 Generated with Claude Code


Note

Medium Risk
Updates TRON balance retrieval to a new JSON-RPC method and loosens BlockchainApiController.getAddressBalance typing/parameters, which could break balance display if the RPC method/response shape differs or is unavailable.

Overview
TRON balance fetching now uses BlockchainApiController.getAddressBalance with the tron_getAddressBalance JSON-RPC method and converts the returned SUN value to TRX via NumberUtil.

BlockchainApiController.getAddressBalance is generalized to accept optional method/params and a generic response type, and TRON mainnet/testnet preset network image IDs are updated in PresetsUtil.

Written by Cursor Bugbot for commit be0e9ef. This will update automatically on new commits. Configure here.

…update network preset IDs

- Use tron_getAddressBalance custom JSON-RPC method via BAPI instead of the balance REST endpoint (avoids TronGrid rate limits)
- Make getAddressBalance generic with optional method/params to support chain-specific RPC methods
- Parse Quicknode account response to extract balance in SUN and convert to TRX
- Update TRON network preset image IDs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Feb 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: be0e9ef

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Feb 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
appkit-demo Building Building Preview, Comment Feb 27, 2026 6:43am
appkit-gallery Building Building Preview, Comment Feb 27, 2026 6:43am
appkit-headless-sample-app Building Building Preview, Comment Feb 27, 2026 6:43am
appkit-laboratory Building Building Preview, Comment Feb 27, 2026 6:43am
9 Skipped Deployments
Project Deployment Actions Updated (UTC)
appkit-basic-example Ignored Ignored Feb 27, 2026 6:43am
appkit-basic-sign-client-example Ignored Ignored Feb 27, 2026 6:43am
appkit-basic-up-example Ignored Ignored Feb 27, 2026 6:43am
appkit-ethers5-bera Ignored Ignored Feb 27, 2026 6:43am
appkit-nansen-demo Ignored Ignored Feb 27, 2026 6:43am
appkit-wagmi-cdn-example Ignored Ignored Feb 27, 2026 6:43am
ethereum-provider-wagmi-example Ignored Ignored Feb 27, 2026 6:43am
next-wagmi-solana-bitcoin-example Ignored Ignored Feb 27, 2026 6:43am
vue-wagmi-example Ignored Ignored Feb 27, 2026 6:43am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Visual Regression Test Results ✅ Passed

⚠️ 15 visual change(s) detected

Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=790
Storybook Preview: https://6493191bf4b10fed8ca7353f-jgbmccwhzv.chromatic.com/

👉 Please review the visual changes in Chromatic and accept or reject them.

@github-actions

Copy link
Copy Markdown
Contributor
Warnings
⚠️

🔑 Potential UUID detected in packages/controllers/src/controllers/BlockchainApiController.ts (line 47): 2b92315d-eab7-5bef-8...

⚠️

🔑 Potential UUID detected in packages/controllers/src/controllers/BlockchainApiController.ts (line 47): 2b92315d-eab7-5bef-8...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 51): ba0ba0cd-17c6-4806-a...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 53): 3bff954d-5cb0-47a0-9...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 55): 30c46e53-e989-45fb-4...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 57): 93564157-2e8e-4ce7-8...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 59): 06b26297-fe0c-4733-5...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 61): ab9c186a-c52f-464b-2...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 63): 41d04d42-da3b-4453-8...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 65): e86fae9b-b770-4eea-e...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 67): 6a97d510-cac8-4e58-c...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 69): e909ea0a-f92a-4512-c...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 71): a18a7ecd-e307-4360-4...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 73): 4eeea7ef-0014-4649-5...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 75): 2257980a-3463-48c6-c...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 77): 0a728e83-bacb-46db-7...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 79): 02b53f6a-e3d4-479e-1...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 81): f926ff41-260d-4028-6...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 83): b310f07f-4ef7-49f3-7...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 85): 5a73b3dd-af74-424e-c...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 87): 34e68754-e536-40da-c...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 89): 3897a66d-40b9-4833-1...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 91): 161038da-44ae-4ec7-1...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 93): f1d73bb6-5450-4e18-3...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 95): 845c60df-d429-4991-e...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 97): ab781bbc-ccc6-418d-d...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 99): 7289c336-3981-4081-c...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 101): 3ff73439-a619-4894-9...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 103): b8101fc0-9c19-4b6f-e...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 103): b8101fc0-9c19-4b6f-e...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 107): e329c2c9-59b0-4a02-8...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 109): fc2427d1-5af9-4a9c-8...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 111): a1b58899-f671-4276-6...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 111): a1b58899-f671-4276-6...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 111): a1b58899-f671-4276-6...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 115): 0b4838db-0161-4ffe-0...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 117): 39354064-d79b-420b-0...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 119): b3406e4a-bbfc-44fb-e...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 121): 20f673c0-095e-49b2-0...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 121): 20f673c0-095e-49b2-0...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 125): 3502bb86-cc4e-420f-a...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 125): 3502bb86-cc4e-420f-a...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 125): 3502bb86-cc4e-420f-a...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 133): 0c2840c3-5b04-4c44-9...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 133): 0c2840c3-5b04-4c44-9...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 135): bba2c8be-7fd1-463e-4...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 136): 461db637-8616-43ce-0...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 137): 54a1aa77-d202-4f8d-0...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 138): ef1a1fcf-7fe8-4d69-b...

⚠️

🔑 Potential UUID detected in packages/appkit-utils/src/PresetsUtil.ts (line 139): 07ba87ed-43aa-4adf-4...

Generated by 🚫 dangerJS against be0e9ef

@github-actions

Copy link
Copy Markdown
Contributor

📦 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

@reown/appkit - Main Entry
Size limit:   80 kB
Size:         75.63 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 342 ms   on Snapdragon 410
Total time:   1.9 s
@reown/appkit/react
Size limit:   235 kB
Size:         233.83 kB with all dependencies, minified and gzipped
Loading time: 4.6 s     on slow 3G
Running time: 830 ms    on Snapdragon 410
Total time:   5.4 s
@reown/appkit/vue
Size limit:   80 kB
Size:         75.63 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 309 ms   on Snapdragon 410
Total time:   1.8 s
@reown/appkit-scaffold-ui
Size limit:   220 kB
Size:         213.73 kB with all dependencies, minified and gzipped
Loading time: 4.2 s     on slow 3G
Running time: 587 ms    on Snapdragon 410
Total time:   4.8 s
@reown/appkit-ui
Size limit:   500 kB
Size:         13.16 kB with all dependencies, minified and gzipped
Loading time: 258 ms   on slow 3G
Running time: 76 ms    on Snapdragon 410
Total time:   333 ms

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.65% 39610 / 50360
🔵 Statements 78.65% 39610 / 50360
🔵 Functions 76.34% 4251 / 5568
🔵 Branches 86.7% 9635 / 11112
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit-utils/src/PresetsUtil.ts 100% 100% 100% 100%
packages/controllers/src/controllers/BlockchainApiController.ts 42.78% 75% 32.65% 42.78% 199-200, 221-259, 263-282, 286-298, 302-317, 329-352, 360-361, 376-395, 399-428, 432-457, 467-470, 499-509, 513-528, 532-542, 546-564, 568-596, 607-618, 622-658, 662-671, 674-690, 281-343, 394-456, 527-689
Generated in workflow #16931 for commit be0e9ef by the Vitest Coverage Report Action

@enesozturk
enesozturk requested a review from 0xmkh February 27, 2026 08:00
@enesozturk
enesozturk added this pull request to the merge queue Feb 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 27, 2026
@enesozturk
enesozturk added this pull request to the merge queue Feb 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 27, 2026
@enesozturk
enesozturk added this pull request to the merge queue Feb 27, 2026
@0xmkh
0xmkh removed this pull request from the merge queue due to a manual request Feb 27, 2026
@0xmkh
0xmkh merged commit 3ec6179 into main Feb 27, 2026
94 of 103 checks passed
@0xmkh
0xmkh deleted the fix/tron-balance-and-identity branch February 27, 2026 12:14
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants