Skip to content

Let users choose the wallet's storage provider - #83

Open
rohenaz wants to merge 2 commits into
mainfrom
storage-provider-choice
Open

rohenaz wants to merge 2 commits into
mainfrom
storage-provider-choice

Conversation

@rohenaz

@rohenaz rohenaz commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Before: Settings showed the built-in wallet's storage host as read-only text, and every open pointed the wallet at the hosted 1Sat storage.

After: Settings shows which provider keeps the wallet's data and broadcasts its transactions, and lets the user switch to another provider or back to the 1Sat default. When the wallet was moved on another device, the row says so, marks the wallet read-only and asks for that provider's address, so this browser follows the move instead of undoing it.

The choice is saved per chain and identity key in this browser and used on the next open. The store's own user record still decides which store is active.

How: changeWalletStorage in the wallet provider calls setActiveStorage (or addRemote after a move), then checks getStorageStatus and only saves the choice once the new provider is the writable active store. The Change button only appears when the installed @1sat/wallet-browser reports getStorageStatus, so with 0.1.2 nothing changes for users until an SDK release with b-open-io/1sat-sdk#105 and #106 is installed here. Logging goes through reportDiagnostic.

Tests: tests/wallet-storage-choice.test.ts (address checks, per-account save and load) and the updated tests/wallet-storage-endpoint.test.ts. bun test tests/, biome and tsc --noEmit pass locally.

The built-in wallet's storage provider keeps its data and broadcasts its
transactions. Settings now shows it, lets the user move the wallet to
another provider, and asks for the provider's address when the wallet
was moved on another device, so it follows rather than undoes the move.

The choice is kept per chain and identity key in this browser. Switching
appears only once @1sat/wallet-browser reports getStorageStatus.
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
1satwallet.com Ready Ready Preview Nov 25, 2026 6:59pm UTC

Request Review

When the provider chosen for a wallet can't be reached at open, the
wallet opens on the 1Sat storage read-only instead of failing, and
Settings names the provider and offers to try again. A switch that
finishes after the wallet was locked no longer writes its state, a
read-only wallet can pick its current provider again, and the default
address is normalized so switching back matches its store.

This branch had an error being deployed

1 failed and 1 active deployments
e2e-testnet — e47e1c29 Deployed Nov 25, 2026 by rohenaz via Testnet (local build) #219
Preview — e47e1c29 Deployed Nov 25, 2026 by vercel[bot]
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.

1 participant