Skip to content

refactor: make authorizationCache, chainSelector and onWalletNotFound in registerMwa optional - #1271

Open
beeman wants to merge 1 commit into
solana-mobile:mainfrom
beeman:beeman/register-mwa
Open

refactor: make authorizationCache, chainSelector and onWalletNotFound in registerMwa optional#1271
beeman wants to merge 1 commit into
solana-mobile:mainfrom
beeman:beeman/register-mwa

Conversation

@beeman

@beeman beeman commented Sep 4, 2025

Copy link
Copy Markdown
Collaborator

This commit makes the authorizationCache, chainSelector and onWalletNotFound properties of registerMwa optional.

It does so by extracting the LocalSolanaMobileWalletAdapterWalletOptions into an object, marking the properties as optional and have RemoteSolanaMobileWalletAdapterWalletOptions extend it.

After that, we provide a default value in the constructor so that this function remains working the same, it just needs a few less parameters to set up.

Summary by CodeRabbit

  • New Features
    • Simplified wallet setup by making authorization caching, chain selection, and wallet-not-found handling optional.
    • Added reusable configuration types for local, remote, and Nostr-based wallet connections.
    • Improved connection configuration so relay selection is preserved across supported connection methods.
  • Documentation
    • Added release notes describing the new optional configuration options and exported configuration types.

@Funkatronics
Funkatronics self-requested a review September 12, 2025 15:50
Comment thread js/packages/wallet-standard-mobile/src/wallet.ts Outdated
Comment thread js/packages/wallet-standard-mobile/src/initialize.ts Outdated
Comment thread js/packages/wallet-standard-mobile/src/wallet.ts Outdated
@Funkatronics

Copy link
Copy Markdown
Collaborator

CI build is failing on these changes @beeman

@beeman beeman self-assigned this Jun 2, 2026
@Funkatronics

Copy link
Copy Markdown
Collaborator

closed, inactive. feel free to reopen

@beeman beeman reopened this Sep 1, 2026
@beeman
beeman force-pushed the beeman/register-mwa branch from 1a87422 to ffd4bc4 Compare September 1, 2026 19:30
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 824d47fa-038f-45cf-b4d4-2eadc68974cb

📥 Commits

Reviewing files that changed from the base of the PR and between c258ef8 and ffd4bc4.

📒 Files selected for processing (4)
  • js/.changeset/wallet-standard-mobile-optional-register-mwa-config.md
  • js/packages/wallet-standard-mobile/src/initialize.ts
  • js/packages/wallet-standard-mobile/src/wallet.ts
  • js/packages/wallet-standard-mobile/test/wallet.test.ts

Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.


📝 Walkthrough

Walkthrough

@solana-mobile/wallet-standard-mobile now exports shared wallet configuration interfaces. Local, remote, and Nostr wallet constructors accept optional authorization cache, chain selector, and wallet-not-found handler values with defaults. registerMwa uses the shared configuration type.

Changes

Wallet configuration

Layer / File(s) Summary
Configuration contracts and defaults
js/packages/wallet-standard-mobile/src/wallet.ts
The package exports shared, local, remote, and Nostr wallet configuration interfaces and imports default factories for optional settings.
Wallet constructor defaults
js/packages/wallet-standard-mobile/src/wallet.ts, js/packages/wallet-standard-mobile/test/wallet.test.ts
Local and remote constructors use the exported configuration interfaces, apply defaults, preserve relay selection, and update the wallet-not-found handler type.
Registration integration and release metadata
js/packages/wallet-standard-mobile/src/initialize.ts, js/.changeset/wallet-standard-mobile-optional-register-mwa-config.md
registerMwa uses the shared configuration type. The changeset documents the optional values and exported interfaces.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to ffd4b

The change makes three registerMwa options optional while providing defaults that preserve existing behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: funkatronics

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: making authorizationCache, chainSelector, and onWalletNotFound optional in registerMwa.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@beeman
beeman requested a review from Funkatronics September 2, 2026 09:40
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