refactor(wallet): resolve wallet key via @blockrun/core#2
Open
KillerQueen-Z wants to merge 2 commits into
Open
refactor(wallet): resolve wallet key via @blockrun/core#2KillerQueen-Z wants to merge 2 commits into
KillerQueen-Z wants to merge 2 commits into
Conversation
Delegate resolveWalletKey() to @blockrun/core's resolvePrivateKey() so the resolution order (env BLOCKRUN_WALLET_KEY|BASE_CHAIN_WALLET_KEY -> ~/.blockrun/.session -> legacy wallet.key) is the single source of truth shared with the SDK and the umbrella blockrun CLI. Verified: 19/19 unit tests; direct-mode bridge end-to-end (health reports the same wallet/balance, real /v1/responses request completes on a free model).
- blockrun-codex bin alias so gh-style prefix discovery resolves
`blockrun codex <cmd>` directly
- wallet/doctor --json now emit the @blockrun/core output contract
({ok,data}/{ok,error}) — same envelope as every BlockRun product
- fold remaining self-built pieces into core 0.0.3: address derivation
(addressFromKey), cost-log path (paths().costLog — BLOCKRUN_HOME now
applies), and the canonical .session path in start.mjs
Verified: 19/19 tests against registry core@0.0.3; direct-mode bridge
serves /v1/stats from the core-resolved ledger; `blockrun codex wallet
--json` end-to-end through the umbrella.
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.
What
Delegates
resolveWalletKey()insrc/direct.jsto the newly published@blockrun/core— the shared kernel that owns BlockRun's canonical wallet resolution order:Why
First step of the product-family convergence: every BlockRun tool (SDK, umbrella
blockrunCLI, this bridge) should read the wallet through one source of truth instead of each re-implementing the scan. Kills drift by construction.Diff
package.json/ lockfile: +@blockrun/core ^0.0.2src/direct.js:resolveWalletKey()body →resolvePrivateKey()?.privateKey(net −11 lines)Verification
0x3491…402E)/health?full=truereports the same wallet + balance through the new path; a real/v1/responsesrequest on a free model streams toresponse.completed