CLI: ERC-20 wallet commands — approve, allowance, token, transfers, watch (stacked on #35) - #36
Open
kylecrawshaw wants to merge 1 commit into
Open
kylecrawshaw wants to merge 1 commit into
kylecrawshaw wants to merge 1 commit into
Conversation
kylecrawshaw
force-pushed
the
claude/cli-transfer-events
branch
from
September 23, 2026 19:27
a04c3c8 to
e84c493
Compare
kylecrawshaw
force-pushed
the
claude/cli-transfer-events
branch
from
September 23, 2026 19:31
e84c493 to
63eb5c8
Compare
kylecrawshaw
added this pull request to stack #32
September 23, 2026 19:32
kylecrawshaw
force-pushed
the
claude/cli-transfer-events
branch
from
September 25, 2026 01:54
63eb5c8 to
9b379e6
Compare
Contributor
🦋 Changeset detectedLatest commit: 597f349 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
kylecrawshaw
force-pushed
the
claude/cli-transfer-events
branch
2 times, most recently
from
September 30, 2026 20:23
f7e53ae to
cb1b4cd
Compare
Thin commands over the SDK's `erc20Actions`, each taking `SBC` (default) or any token address, with symbol and decimals read on-chain for a bare address: - `wallet approve <spender> <amount> [token]`, `max` for an unlimited approval, `--gas-limit` and `--no-wait` as for `wallet send` - `wallet allowance <spender> [token] [--owner]` - `wallet token [token]`: name, symbol, decimals, total supply - `wallet transfers [token]`: decoded `Transfer` logs over a block range (last 10 000 blocks by default) through `getTransfers` - `wallet watch [token]`: the same streamed through `watchTransfers` until Ctrl-C, one JSON object per line with --json `transfers` and `watch` default to transfers sent or received by the local account: two filters, merged and deduped since a self-transfer matches both sides. --from / --to pick one side, --address another account, --all every transfer of the token. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
kylecrawshaw
force-pushed
the
claude/cli-transfer-events
branch
from
September 30, 2026 23:08
cb1b4cd to
597f349
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #35 (CLI on the SDK's ERC-20 actions), itself on #24 and #23. Review only the last commit.
What
Five new
walletcommands, thin wrappers over theerc20Actionsthat #35 wires onto the CLI's clients. Each takesSBC(the default) or any token address as its last argument; symbol and decimals are read on-chain for a bare address.wallet approve <spender> <amount> [token]: ERC-20 approve,maxfor an unlimited approval,--gas-limitand--no-waitas forwallet send. Output{hash, receipt?}.wallet allowance <spender> [token] [--owner]: owner defaults to the local account.wallet token [token]: name, symbol, decimals, total supply.wallet transfers [token]: decodedTransferevents over a block range throughgetTransfers. Last 10 000 blocks by default, or--blocks <n>,--from-block <n>,--to-block <n>. One line per transfer;--jsonwraps the rows with the token and block range.wallet watch [token]: the same streamed throughwatchTransfersuntil Ctrl-C,--poll <ms>for the polling interval. With--json, one JSON object per line; the status line goes to stderr so stdout pipes cleanly.transfersandwatchdefault to transfers sent or received by the local account: two log filters, merged, deduped and ordered by block then log index, since a self-transfer matches both sides.--from/--topick one side,--addressanother account,--allevery transfer of the token.lib/erc20.tsgainsdescribeToken,transferFilters,sortTransfers,toTransferRowandlistTransfersso that logic is testable apart from commander.Tests
Five tests added in
tests/erc20.test.ts:maxamounts,describeToken, side-filter expansion, dedupe/ordering, row formatting, andlistTransfersagainst fakeeth_getLogsresponses that check both filters carry the block range. CLI total 36 passing,pnpm buildclean. Not run against a live node.ENG-2276
🤖 Generated with Claude Code