Repository navigation
Conversation
tkhq-valet-dev
Bot
force-pushed
the
carey/wallet-sign-flags
branch
from
November 5, 2026 19:51
954e999 to
3f6fc20
Compare
tkhq-valet-dev
Bot
force-pushed
the
carey/wallet-sign-flags
branch
from
November 5, 2026 20:04
3f6fc20 to
0fc319a
Compare
Parse --account into a curve plus either an explicit path or a conventional format, so wallet create rejects formats it cannot infer during parsing. wallet account create now requires --curve and --path through clap when the address format has no inferred value, so these exit with usage_error. CreateNextAccount keeps only the conventional format; the address format comes from it. Account prediction stops with an error when the API returns the same full page again. --payload-file drops one trailing newline, so echo and editor-saved files sign the text shown. Share the file-or-stdin read with JSON parameter input. Replace the wiremock flag suite with unit tests for local parsing and three mock tests for pages the live API cannot produce. The e2e suite now signs a transaction from flags. Co-authored-by: Turnkey <noreply@turnkey.com>
Drop comments that restate code, merge the StandardFormat impl blocks, tie the account list page size to the prediction page size, and use 0x… placeholders in the signing docs. Co-authored-by: Turnkey <noreply@turnkey.com>
figitaki
force-pushed
the
carey/wallet-sign-flags
branch
from
November 5, 2026 21:08
0fc319a to
092765e
Compare
Path prediction posted to get_wallet_accounts, which the API answers with 404. The SDK client and the gpg mock tests use list_wallet_accounts. Co-authored-by: Turnkey <noreply@turnkey.com>
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 #111 (
carey/private-key-commands). Retarget tomainonce #111 merges.What
Adds flag-based input beside the raw-JSON path for
wallet create,wallet account create,sign payload, andsign transaction. Flags and--input-json/--input-fileare mutually exclusive, enforced by clap (exit 2). Output, error codes, and pending handling are unchanged.wallet create --name [--account ADDRESS_FORMAT[:PATH]]... [--mnemonic-length]. Like Go, no accounts are created by default. Accounts without a path get the next conventional path not already used by an explicit path or an earlier account. Repeated explicit paths are rejected.wallet account create --wallet-id --address-format [--curve] [--path-format] [--path]. The curve is inferred as in Go. Without--path, the next unused conventional path for that address format is predicted fromget_wallet_accounts(all pages, decoded loosely so address formats newer than the client don't break it). Documented indocs/resources.md.sign payload --sign-with (--payload | --payload-file) --encoding --hash-functionsign transaction --sign-with (--unsigned-transaction | --unsigned-transaction-file) --typeEnum flags use the shared kebab-case parser (
src/enum_args.rs, moved out of #111'sprivate-keycode and generalized to address format, curve, path format, payload encoding, hash function, and transaction type). Values are listed in--help,Unspecifiedis excluded, and API names likeADDRESS_FORMAT_ETHEREUMare rejected.Why
Go CLI parity (
wallets create,wallets accounts create,raw sign,ethereum transaction).Encoding, hash function, and transaction type stay required with flags. The "explicit algorithm inputs" requirement comes from the original port's docs, so I did not add Go's UTF-8/sha256 defaults. A silent hash default changes which digest gets signed. Say if you want defaults.
Testing
cargo +nightly-2026-09-01 fmt --check,cargo clippy --all-targets --locked -- -D warnings,cargo doc, andcargo testpass.tests/wallet_sign_flags.rs(wiremock) checks exact intent bodies, mixed explicit/predicted paths, path prediction with pagination and an unknown address format, curve inference, mutual exclusion, kebab-only values, and usage errors. Live e2e tests (wallets,gpg) were updated but not run here.operations::tests::mutation_timeout_is_unknown_and_does_not_leak_bodyis flaky under parallel load, including on main.