Skip to content

Developer Experience Improvements: JSON output, table pagination, balance command #38

@charliebot87

Description

@charliebot87

Following up on #30 with three specific improvements from real-world usage:

1. --json flag on proton action

Problem: Action output is pretty-printed and hard to parse in scripts. When automating transactions, you want clean JSON you can pipe to jq or Python.

Suggestion:

proton action eosio.token transfer '{...}' myaccount --json
# Returns raw JSON: { "transaction_id": "abc123...", ... }

2. Pagination support on proton table

Problem: Large tables (e.g. simplelaunch curves with 400+ tokens) hit the row limit with no easy way to page through results.

Suggestion: Add --next flag using the next_key cursor returned by get_table_rows:

proton table simplelaunch curves --limit 100
# Output includes: next_key: "123"

proton table simplelaunch curves --limit 100 --lowerBound 123
# Continues from where you left off

Or add --all flag that automatically pages through and returns all rows.

3. proton balance <account> shorthand

Problem: Checking an account's token balances requires knowing the right table query (proton table eosio.token accounts <account>), which isn't obvious to new developers.

Suggestion: First-class balance command using the Light API:

proton balance myaccount
# XPR: 1,234.5678
# XUSDC: 50.00

proton balance myaccount --symbol XPR
# 1,234.5678 XPR

proton balance myaccount --json
# [{ "symbol": "XPR", "amount": "1234.5678", "contract": "eosio.token" }]

Could use the Light API (https://lightapi.eosamsterdam.net/api) for efficiency rather than direct table queries.


Happy to contribute PRs for any of these if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions