Skip to content

Add wallet settings#722

Open
peachbits wants to merge 3 commits into
masterfrom
matthew/wallet-settings
Open

Add wallet settings#722
peachbits wants to merge 3 commits into
masterfrom
matthew/wallet-settings

Conversation

@peachbits
Copy link
Copy Markdown
Contributor

@peachbits peachbits commented Apr 6, 2026

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

Note

Medium Risk
Touches wallet creation timing, synced storage, and the currency engine contract; behavior is opt-in via hasWalletSettings but incorrect plugin handling could affect wallet startup or settings sync.

Overview
Adds per-wallet settings (walletSettings) that live on the synced wallet repo in WalletSettings.json, separate from account-level userSettings.

EdgeCurrencyWallet exposes walletSettings and changeWalletSettings (gated by EdgeCurrencyInfo.hasWalletSettings). Creation paths accept optional walletSettings in EdgeCreateCurrencyWalletOptions; the core prewrites them to disk before applyKit so the wallet pixie loads the right values when the engine starts. Redux tracks settings, reloads them on sync when the file changes, and the wallet watcher calls optional engine.changeWalletSettings. EdgeCurrencyEngine construction now receives walletSettings; memory wallets pass them through as well.

Also exposes imported on EdgeCurrencyWallet, and wallet split restore always calls changeWalletStates when there are wallets to un-archive (drops the previous “only if archived/deleted” short-circuit).

Reviewed by Cursor Bugbot for commit f87eace. Bugbot is set up for automated code reviews on this repo. Configure here.

swansontec and others added 3 commits April 2, 2026 12:00
The items in the list are already known to need these changes, so there is no need to double-check.
This lets us control settings on a per-wallet basis, instead of per-chain (which is that the old userSettings property handles).

Co-authored-by: Cursor <cursoragent@cursor.com>
@peachbits peachbits requested a review from swansontec April 6, 2026 17:24
Comment thread src/core/validate.ts Outdated
Comment thread src/core/account/account-api.ts
hasWalletSettings
) {
input.props.log.warn(
`walletSettings applying: ${JSON.stringify(walletSettings)}`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: MEDIUM
Raw walletSettings are logged via JSON.stringify(walletSettings). Because these settings are plugin-defined, they may include secrets or tokens, and this log line can expose sensitive values to log sinks.

Impact: Sensitive wallet configuration data could be disclosed through logs and any downstream log aggregation.

@j0ntz j0ntz force-pushed the matthew/wallet-settings branch from cdee339 to f87eace Compare May 21, 2026 18:43
Comment thread CHANGELOG.md

## Unreleased

- added: `EdgeCurrencyWallet.walletSettings` and `EdgeCurrencyWallet.changeWalletSettings`, plus matching engine plumbing.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGELOG omits new imported public API property

Low Severity

The PR adds a new public imported property on EdgeCurrencyWallet (in both types.ts and currency-wallet-api.ts), but the CHANGELOG entry only covers walletSettings and changeWalletSettings. Since imported is a newly exposed API on EdgeCurrencyWallet, it warrants its own added: entry in the CHANGELOG.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by learned rule: CHANGELOG entries must use correct semantic prefix

Reviewed by Cursor Bugbot for commit f87eace. Configure here.

Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
@j0ntz j0ntz force-pushed the matthew/wallet-settings branch from 5a222c6 to f87eace Compare May 22, 2026 10:30
Comment thread src/core/currency/wallet/currency-wallet-pixie.ts
Comment thread src/index.ts Outdated
@peachbits peachbits force-pushed the matthew/wallet-settings branch from 97cb1e0 to f87eace Compare May 26, 2026 03:35
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f87eace. Configure here.

)
await engine.changeWalletSettings(walletSettings).catch(error => {
input.props.log.warn(`walletSettings error: ${String(error)}`)
input.props.onError(error)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug wallet settings warn logs

Low Severity

The wallet-settings watcher logs every apply and error at warn with JSON.stringify of settings. That looks like temporary instrumentation, adds noisy production logs, and may write wallet configuration into crash or log pipelines.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f87eace. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants