CLI: run wallet ERC-20 interactions on the SDK's erc20Actions (stacked on #23) - #35
Merged
Merged
Conversation
kylecrawshaw
force-pushed
the
claude/cli-erc20-actions
branch
from
September 23, 2026 19:22
7eba33e to
ce9cdea
Compare
kylecrawshaw
force-pushed
the
claude/cli-erc20-actions
branch
2 times, most recently
from
September 23, 2026 19:31
1ea17c5 to
3836049
Compare
kylecrawshaw
changed the base branch from
claude/charming-carson-hr92hc-erc20
to
claude/charming-carson-hr92hc-permit2
September 23, 2026 19:31
kylecrawshaw
added this pull request to stack #32
September 23, 2026 19:32
azf20
previously approved these changes
Sep 24, 2026
kylecrawshaw
force-pushed
the
claude/cli-erc20-actions
branch
from
September 25, 2026 01:54
3836049 to
3095a29
Compare
Contributor
🦋 Changeset detectedLatest commit: ef215c4 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-erc20-actions
branch
from
September 25, 2026 13:59
3095a29 to
8a55584
Compare
Base automatically changed from
claude/charming-carson-hr92hc-permit2
to
main
September 30, 2026 20:23
`makePublicClient` / `makeWalletClient` extend their viem clients with `radiusActions` and `erc20Actions` from `radius-sdk/client`, defaulting to the configured SBC contract. `wallet send … SBC` goes through the SDK's `transfer` (amount parsing, calldata, `--gas-limit` via `gas`), and any 0x token address works in the same position, with decimals read on-chain. `wallet balance` now uses the SDK's `getBalances`, which keeps native RUSD apart from SBC instead of adding SBC on top of the aggregate `eth_getBalance` that already includes it. The JSON gains `aggregateWei` and `rusdSource`. The hand- written ERC-20 ABI in wallet.ts is gone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
kylecrawshaw
force-pushed
the
claude/cli-erc20-actions
branch
from
September 30, 2026 20:23
8a55584 to
ef215c4
Compare
azf20
approved these changes
Sep 30, 2026
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 #24 (SDK Permit2 actions), itself on #23 (SDK ERC-20 actions). Review only the last commit; the base branches carry the SDK work. #36, stacked on this PR, adds the new ERC-20 commands.
What
The CLI's existing ERC-20 code paths run on
radius-sdk/clientinstead of a hand-written ABI inwallet.ts. No new commands here.lib/client.ts:makePublicClientextends withradiusActions+erc20Actions,makeWalletClientwitherc20Actions, both defaulting to the configured SBC contract (--sbc/RADIUS_SBC_ADDRESS, else the canonical address from the SDK).lib/erc20.ts(new): token argument parsing (SBCor any 0x address), display-amount parsing andreadBalances.wallet send <to> <amount> SBCgoes through the SDK'stransfer;wallet send <to> <amount> 0xTokentransfers any ERC-20, with decimals read on-chain.--gas-limitstill works via thegasoption added to the SDK write actions in SDK: common ERC-20 interactions (stacked on #22) #23. The receipt is awaited by the CLI so--no-waitand the{hash, receipt}output are unchanged.wallet balanceuses the SDK'sgetBalances. Previously it added SBC on top ofeth_getBalance, which on Radius already includes SBC 1:1, sototalUsddouble counted.rusdis now native RUSD only, and the JSON gainsaggregateWeiandrusdSource(evm/derived/aggregatewhen the SBC read failed and the aggregate is all we have). The CLI half of Add balance query APIs accounting for Radius stablecoin aggregation #22 that described this never landed.Not touched:
wallet x402's Permit2 approval, which stays oncreateRadiusFetch().approvePermit2()(see #24).Tests
tests/erc20.test.tscovers token/amount parsing andreadBalancesagainst an in-memory node that models Radius' aggregatedeth_getBalance(both the separated read and the fallback whenbalanceOffails). CLI total 31 passing,pnpm buildclean. Not run against a live node.ENG-2276
🤖 Generated with Claude Code