Skip to content

[cli] rework gas command to show both coins and address balance - #27490

Merged
stefan-mysten merged 1 commit into
fix-cli-verify-bytecode-meterfrom
cli-gas-show-address-balance
Jul 28, 2026
Merged

[cli] rework gas command to show both coins and address balance #27490
stefan-mysten merged 1 commit into
fix-cli-verify-bytecode-meterfrom
cli-gas-show-address-balance

Conversation

@stefan-mysten

Copy link
Copy Markdown
Contributor

Description

This PR adds support for address balance in the sui client gas command.

Test plan

How did you test the new or updated feature?


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI: sui client gas now also displays address balance SUI balance.
  • Rust SDK:
  • Indexing Framework:

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Jul 28, 2026 5:18pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Jul 28, 2026 5:18pm
sui-kiosk Ignored Ignored Preview Jul 28, 2026 5:18pm

Request Review

@stefan-mysten
stefan-mysten temporarily deployed to sui-typescript-aws-kms-test-env July 27, 2026 22:52 — with GitHub Actions Inactive
@stefan-mysten
stefan-mysten changed the base branch from main to fix-cli-verify-bytecode-meter July 27, 2026 22:52
An address can hold SUI directly, not just in `Coin<SUI>` objects. That
SUI is spendable but no gas object accounts for it, so `sui client gas`
showed nothing for an address whose funds are all held that way.

Report it as an "address balance" row after the gas coins, matching how
`sui client balance --with-coins` already labels it, and drop the "no gas
coins" short-circuit when the address balance is non-zero. The `--json`
output becomes an object with `gasCoins` and the address balance fields,
rather than a bare array of coins.

Also fixes `order_balance_outputs_sui_first`, which compared the balance
API's coin type against the `Coin<SUI>` object type and so never matched:
`sui client balance` never actually ordered SUI first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@stefan-mysten
stefan-mysten force-pushed the cli-gas-show-address-balance branch from aad59ce to 960dde5 Compare July 28, 2026 17:15
@stefan-mysten
stefan-mysten temporarily deployed to sui-typescript-aws-kms-test-env July 28, 2026 17:15 — with GitHub Actions Inactive
@stefan-mysten
stefan-mysten merged commit 441e50b into main Jul 28, 2026
63 checks passed
@stefan-mysten
stefan-mysten deleted the cli-gas-show-address-balance branch July 28, 2026 18:05
jessiemongeon1 added a commit that referenced this pull request Aug 7, 2026
## Summary

- **BEDU-1007:** Update `sui client gas` descriptions to include total
SUI balance (help snippet + cheatsheet)
- **BEDU-996:** Update `sui client verify-source` to reflect removed
`package-id` argument and toolchain-based rebuild (help snippet +
cheatsheet)
- **BEDU-930:** Add step-by-step forking workflow to the Contribute to
Sui Repositories page
- **BEDU-931:** Expand Localize Sui Documentation with Crowdin project
link, translation guidelines, and reviewer process

**Skipped:** BEDU-1004 (ForwardingAddressRegistry) — reserved addresses
are documented on move-book.com, not docs.sui.io, and the feature is
devnet-only with no user-facing API yet.

Closes BEDU-930, BEDU-931, BEDU-996, BEDU-1007.

## Sources

| Source | Used for |
|---|---|
| [PR #27490](#27490) | `sui
client gas` now displays address balance alongside gas coins |
| [PR #27213](#27213) | `sui
client verify-source` reimplemented with toolchain rebuild, removed
flags |
| [MystenLabs/sui GitHub](https://github.com/MystenLabs/sui) | Forking
workflow steps |
| [Crowdin](https://support.crowdin.com/crowdin-intro/) | Localization
platform documentation |

## Test plan

- [ ] Verify `sui-client-help.mdx` snippet matches actual CLI output
after PRs #27490 and #27213 merge
- [ ] Confirm cheatsheet renders updated descriptions correctly
- [ ] Verify Crowdin project link resolves
- [ ] Confirm forking workflow CLI commands are correct

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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