Skip to content

Feat/mwa v2 - #289

Merged
Kuldotha merged 9 commits into
mainfrom
feat/mwa-v2
Jun 17, 2026
Merged

Kuldotha merged 9 commits into
mainfrom
feat/mwa-v2

Conversation

@Kuldotha

@Kuldotha Kuldotha commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

▎ No breaking API changes: DisconnectWallet() was renamed to Deauthorize() but kept as an [Obsolete] alias that forwards to it, so existing consumers keep compiling. Includes a native Android change
▎ (MwaChooserHelper.java) and a cache-invalidation step that forces pre-fix users to re-authorize once on upgrade.

┌────────┬─────────┬────────────────┬────────────────────────┐
│ Status │ Type │ ⚠️ Core Change │ Issue │
├────────┼─────────┼────────────────┼────────────────────────┤
│ Ready │ Feature │ Yes │ Link (Issue link here) │
└────────┴─────────┴────────────────┴────────────────────────┘

Problem

The SDK's Mobile Wallet Adapter implementation predated MWA 2.0 and was missing most of the protocol surface that modern on-device wallets expect. Concretely:

  • Double-prompt / non-silent reauth. Authorizing through the OS wallet chooser produced an auth_token that wasn't reauthorizable, because startActivity(createChooser(...)) made the system the caller rather
    than our app — and Seed Vault binds authorization to the caller. The first signing call after connect re-prompted.
  • Missing protocol methods. No deauthorize, get_capabilities, sign_and_send_transactions, clone_authorization, or Sign-In-With-Solana.
  • Coarse error handling. Wallet RPC errors surfaced as opaque exceptions with no error code or structured data (e.g. partial-submit signatures were lost).
  • No re-entrancy protection. Concurrent MWA calls could race two wallet associations.
  • No returning-user story. Apps had no supported way to detect a cached session at the landing screen, so returning users saw a bare "Connect" even though reconnect is silent.

Solution

Layered MWA 2.0 parity onto the hardened association transport (transport left untouched):

  • Chooser caller identity fixed by launching the chooser with startActivityForResult so the chosen wallet sees our app as the caller — silent reauth now works, no double-prompt.
  • New protocol methods on SolanaWalletAdapter: Deauthorize() (wallet-side revoke, targeted at the issuing wallet), GetCapabilities(), SignAndSendTransactions(), CloneAuthorization(), LoginWithSignIn() (SIWS,
    with a sign_messages fallback), plus ReconnectWallet().
  • Typed result for sign-and-send. SignAndSendTransactions returns a SignAndSendTxResult (Success / UserDeclined / NotSubmitted+partial signatures / InvalidPayloads / TooManyPayloads / NotSupported /
    Unauthorized / Failed) instead of throwing, since those outcomes are expected and carry data. Other methods stay exception-based via MwaRpcException (numeric Code + optional Data).
  • Concurrency gate. A single-flight SemaphoreSlim gate ensures one wallet interaction at a time; a concurrent call fails fast with OperationInFlightException.
  • Returning-user helpers. New static MwaSession (HasCachedSession / CachedAccountAddress / ClearCachedSession) usable before any adapter exists, so a landing screen can show Continue + Logout instead of
    Connect.
  • Docs added under docs/ (quick-start, method reference, cache guide, best practices).

Before & After Screenshots

N/A — no UI surface in the SDK itself. Behavior verified on-device (Seeker / Seed Vault, Phantom): silent reauth after first connect, correct-network signing, and all new methods exercised via a test-suite

Other changes (e.g. bug fixes, small refactors)

  • DisconnectWallet() → Deauthorize() rename, with [Obsolete] alias retained (non-breaking).
  • IAdapterOperations interface extended for the new operations; contract tests updated to pin the surface.
  • AuthorizationResult enriched (accounts[] with chains/features/display_address/icon, wallet_uri_base, SIWS result); ResponseError now carries a data payload.
  • Added MobileWalletAdapterClient / CapabilitiesResult tests.
  • Version bump 1.2.10 → 1.3.0.

Deploy Notes

Pure Unity package change — installed via UPM git URL. Includes a native Android change (MwaChooserHelper.java); consumers must rebuild the Android player (IL2CPP / ARM64). On first launch after upgrade,
pre-fix cached auth is invalidated, so existing users re-authorize once.

New scripts:

  • Runtime/codebase/SolanaMobileStack/MwaSession.cs : static cached-session helpers (HasCachedSession, CachedAccountAddress, ClearCachedSession).
  • Runtime/codebase/SolanaMobileStack/MwaRpcException.cs : typed RPC error (Code + Data) and OperationInFlightException.
  • .../Responses/SignAndSendTxResult.cs, SignInResult.cs, SignInPayload.cs, CloneAuthorizationResult.cs : MWA 2.0 request/response models.

New dependencies:

  • None.

Summary by CodeRabbit

  • New Features

    • Added SignAndSendTransactions with optional submission options and typed results.
    • Extended authorization/sign-in to support Sign-In-With-Solana payloads and new sign-in result data.
    • Added clone-authorization support, plus MwaSession cached-session helpers.
    • Upgraded capabilities reporting to a feature-based model.
    • Added DeauthorizeWallet and a LoginWalletAdapter(SignInPayload) one-call flow.
  • Bug Fixes

    • Prevented concurrent wallet operations (in-flight gating) and improved structured RPC error handling.
    • Updated disconnect/deauthorize behavior to separate local session clearing from remote deauthorization.
  • Documentation

    • Added/expanded Android Mobile Wallet Adapter docs (install, quick start, method reference, best practices, cache guide).
  • Tests

    • Broadened request/response and capability deserialization coverage.

Kuldotha and others added 6 commits June 11, 2026 15:56
…ame on #288 auth fix

Rebased onto main (PR #288 CAIP-2 chain fix). Dropped the obsolete authorize+token
rework (#1/#2) and chain-edge diagnostics (#9) since #288's reauthorize+chain supersedes
them; kept the additive work:
- get_capabilities features[] parsing + SupportsCloneAuthorization/SupportsSignInWithSolana
- sign_and_send_transactions (no fallback; throws NotSupportedException on -32601 via MwaRpcException)
- DisconnectWallet() renamed to Deauthorize()

Needs a Unity compile + on-device re-test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lias

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The SDK is upgraded to MWA 2.0 by adding Sign-In-With-Solana (LoginWithSignIn, SignInPayload, SignInResult), SignAndSendTransactions with a typed SignAndSendTxResult union, CloneAuthorization, a process-wide OpGate semaphore enforcing single-flight operations, typed MwaRpcException error handling, a MwaSession cached-session static helper, and an expanded feature-driven CapabilitiesResult model. An Android chooser launch bug is fixed, DisconnectWallet is refactored to local-only clearing, and four new documentation guides plus comprehensive test coverage are added.

Changes

MWA 2.0 Feature Upgrade

Layer / File(s) Summary
New DTOs, result union, and RPC error types
Runtime/codebase/SolanaMobileStack/MwaRpcException.cs, Runtime/codebase/SolanaMobileStack/JsonRpcClient/SignInPayload.cs, Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignInResult.cs, Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/CloneAuthorizationResult.cs, Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignAndSendResult.cs, Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignAndSendTxResult.cs, Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/Response.cs, .../*.meta
Introduces MwaRpcException carrying Code and Data (JToken), OperationInFlightException for concurrent-operation signaling, and MwaErrorCodes constant set. Adds SignInPayload (SIWS input fields), SignInResult (SIWS output), CloneAuthorizationResult (auth token), SignAndSendResult (response with signature decoding), and the abstract SignAndSendTxResult discriminated union with eight sealed outcome types (Success, UserDeclined, NotSubmitted, InvalidPayloads, TooManyPayloads, NotSupported, Unauthorized, Failed). Updates ResponseError.Data from generic type to JToken.
CapabilitiesResult MWA 2.0 model and JsonRequest/AuthorizationResult extensions
Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/CapabilitiesResult.cs, Runtime/codebase/SolanaMobileStack/JsonRpcClient/JsonRequest.cs, Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/AuthorizationResult.cs
Expands CapabilitiesResult with MWA 2.0 feature constants (FeatureSignMessages, FeatureSignAndSendTransaction, FeatureSignInWithSolana, FeatureCloneAuthorization, FeatureSignTransactions), adds Features array, introduces computed SupportsCloneAuthorization and SupportsSignInWithSolana properties derived from feature detection or legacy boolean fallback, renames legacy field to SupportsCloneAuthorizationLegacy, adds HasFeature() method, and implements MixedStringArrayConverter for normalized mixed-type JSON arrays. Extends JsonRequestParams with Options (nested JsonRequestOptions) and SignInPayload fields. Adds display/formatting/icon/capability fields to AuthorizationResult and AuthorizationResultAccounts.
IAdapterOperations contract and MobileWalletAdapterClient RPC methods
Runtime/codebase/SolanaMobileStack/Interfaces/IAdapterOperations.cs, Runtime/codebase/SolanaMobileStack/MobileWalletAdapterClient.cs
Adds optional SignInPayload parameter to IAdapterOperations.Authorize and introduces two new interface methods: SignAndSendTransactions and CloneAuthorization. Implements all three in MobileWalletAdapterClient: extended Authorize conditionally sets request.Params.SignInPayload; new SignAndSendTransactions base64-encodes transactions into request payloads and includes optional options; CloneAuthorization sends an empty-params RPC. Adds PrepareSignAndSendTransactionsRequest and ToWireOptions helpers.
SolanaMobileWalletAdapter: operation gate, typed errors, and new APIs
Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs
Introduces process-wide OpGate (SemaphoreSlim) and RunExclusive helper overloads to enforce single in-flight operation, throwing OperationInFlightException on contention. Replaces generic exception throws with MwaRpcException (preserving code/message/data). Gates _Login, _SignAllTransactions, GetCapabilities, SignMessage, and new Deauthorize behind RunExclusive. Adds SignAndSendTransactions (returns typed SignAndSendTxResult by mapping MwaRpcException codes to result variants; includes JSON parsing for signatures and valid), CloneAuthorization, and LoginWithSignIn (SIWS with sign_messages fallback when wallet lacks native support). Refactors DisconnectWallet to clear only local session state (no remote revoke).
SolanaWalletAdapter, MwaSession, Web3 integration, Android fix, and auth cache docs
Runtime/codebase/SolanaWalletAdapter.cs, Runtime/codebase/SolanaMobileStack/MwaSession.cs, Runtime/codebase/Web3.cs, Runtime/Plugins/SolanaMobileStack/Android/MwaChooserHelper.java, Runtime/codebase/SolanaMobileStack/MwaAuthCache/IMwaAuthCache.cs, .../*.meta
Adds Deauthorize, SignAndSendTransactions, CloneAuthorization, and LoginWithSignIn to SolanaWalletAdapter with mobile-adapter detection (throw NotImplementedException for non-MWA paths). Introduces MwaSession static helper (HasCachedSession, CachedAccountAddress, ClearCachedSession) using PlayerPrefs and injected/default auth caches. Refactors Web3.LoginWalletAdapter() to use new CreateWalletAdapter() helper, adds LoginWalletAdapter(SignInPayload) overload for SIWS, and introduces DisconnectWalletAdapter() to safely disconnect and clear cached session. Fixes MwaChooserHelper to call startActivityForResult with dedicated CHOOSER_REQUEST_CODE. Updates IMwaAuthCache XML docs to reference DeauthorizeWallet().
Tests: contract, capabilities, client serialization, and cache
Tests/EditMode/Contracts/IAdapterOperationsContractTests.cs, Tests/EditMode/JsonRpc/CapabilitiesResultTests.cs, Tests/EditMode/MwaClient/MobileWalletAdapterClientTests.cs, Tests/EditMode/MwaAuthCache/PlayerPrefsAuthCacheTests.cs
Updates IAdapterOperationsContractTests to validate the expanded Authorize signature and new method count (6→8 for SignAndSendTransactions/CloneAuthorization). Extends CapabilitiesResultTests with feature-array parsing, mixed-type supported_transaction_versions normalization, and predicate combinations (features vs legacy boolean). Adds 12 new MobileWalletAdapterClientTests for sign_and_send_transactions (method, base64 payloads, options serialization), SignAndSendResult deserialization, sign_messages (method, batch encoding, address encoding), clone_authorization, and SIWS sign_in_payload inclusion/omission. Updates PlayerPrefsAuthCacheTests comment and removes redundant Clear() call.
Documentation suite and package version
docs/installation.md, docs/mwa-quick-start.md, docs/mwa-method-reference.md, docs/mwa-best-practices.md, docs/mwa-cache-guide.md, docs.meta, README.md, package.json, .../*.meta
Adds comprehensive MWA documentation: installation.md (prerequisites, install, project setup, Android build, connection flow, end-to-end example, troubleshooting), mwa-quick-start.md (condensed integration walkthrough), mwa-method-reference.md (full method mapping, platform-specific behavior, authentication/signing/capability flows, events, error handling), mwa-best-practices.md (returning-user UI patterns using MwaSession, concurrency guidance), mwa-cache-guide.md (auth token persistence, custom cache injection, token invalidation). Updates README.md to link to installation guide. Adds Unity meta files for all docs. Bumps package.json version from 1.2.10 to 1.3.0.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

  • magicblock-labs/Solana.Unity-SDK#269: Both PRs modify MWA authorization lifecycle and capability handling—SolanaMobileWalletAdapter/IAdapterOperations evolve Deauthorize/GetCapabilities, and both change CapabilitiesResult.cs (that PR introduced basic fields; this PR expands to feature-driven model with legacy fallback).
  • magicblock-labs/Solana.Unity-SDK#283: The retrieved PR adds EditMode contract and lifecycle tests that validate the same MWA request/response shapes (IAdapterOperations, CapabilitiesResult, Deauthorize routing) that this PR modifies, providing test coverage for the interface and schema changes.
  • magicblock-labs/Solana.Unity-SDK#288: Both PRs modify MWA authorization request plumbing—IAdapterOperations.Authorize(...)/MobileWalletAdapterClient.Authorize(...) and JsonRequest.JsonRequestParams are extended (this PR adds SignInPayload, retrieved PR adds CAIP-2 chain), so they overlap at the same authorization signatures and request parameter models.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Feat/mwa v2' is vague and generic. While it indicates a feature related to MWA v2, it uses non-descriptive formatting that doesn't clearly convey the main objective or scope of the comprehensive protocol upgrade being delivered. Replace with a more descriptive title that captures the primary change, such as 'Implement MWA 2.0 protocol support with typed signing results and session helpers' or 'Add MWA 2.0 parity: silent reauth, sign-and-send, capabilities, and clone authorization'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is comprehensive and well-structured, covering problem statement, detailed solution, deployment notes, and new scripts. It follows the template structure closely despite minor formatting differences (bullet points vs markdown table styling).
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mwa-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Kuldotha
Kuldotha requested a review from GabrielePicco June 14, 2026 09:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs (1)

703-703: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Deauthorize path can still trigger wallet discovery/chooser.

DeauthorizeImpl calls ResolveWalletPackage(), but that resolver is documented to fall through to discovery/native picker. This conflicts with the disconnect rule to avoid chooser UI and can prompt users during logout.

Suggested fix
- string targetPackage = await ResolveWalletPackage();
+ // Disconnect must be cache-only; never trigger discovery/picker.
+ string targetPackage = await _walletSelectionCache.GetSelectedWalletPackage();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs` at line 703,
The DeauthorizeImpl method is calling ResolveWalletPackage() at line 703, but
this method triggers wallet discovery and native picker UI, which should not
occur during deauthorization. Instead of calling ResolveWalletPackage(),
retrieve the already-authorized wallet package directly from the current session
state or a stored field that holds the active wallet package from the
authorization flow. This ensures deauthorization completes without prompting the
user with any UI chooser.
Tests/EditMode/MwaAuthCache/PlayerPrefsAuthCacheTests.cs (1)

138-148: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Test doesn't validate idempotency as claimed.

The test name is Clear_OnEmptyCache_IsIdempotent but only calls Clear() once. To properly test idempotency (multiple invocations produce the same result without error), call Clear() at least twice:

         await cache.Clear();
+        await cache.Clear();  // second call must also succeed
 
         Assert.IsNull(await cache.Get());

The comment mentions "Logout() and Deauthorize() can both call Clear in a row", so the test should verify this scenario.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/EditMode/MwaAuthCache/PlayerPrefsAuthCacheTests.cs` around lines 138 -
148, The test method Clear_OnEmptyCache_IsIdempotent does not actually test
idempotency because it only calls Clear() once. To properly validate idempotency
and verify that back-to-back invocations are safe (as mentioned in the comment),
add a second await cache.Clear() call immediately after the first one, before
the final assertion. This will demonstrate that calling Clear() multiple times
in succession on an empty cache produces consistent results without errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/mwa-best-practices.md`:
- Line 45: The documentation shows minimal examples of async void event handlers
(OnConnectOrContinue and OnLogout) without exception handling. Add a note or
clarification in the documentation explaining that while these are simplified
examples, production code should wrap the await calls in try-catch blocks to
prevent unhandled exceptions from crashing the application. Reference both event
handlers and explain the best practice of including error handling similar to
the catch block pattern shown in the comment.
- Line 39: The continueLabel.text assignment uses C# 8.0 range syntax (addr[..4]
and addr[^4..]) which is incompatible with Unity 2019.4. Replace the range
operators with substring method calls: use addr.Substring(0, 4) for the first 4
characters and addr.Substring(addr.Length - 4) for the last 4 characters. This
ensures compatibility with the target Unity version while maintaining the same
string truncation behavior.

In `@docs/mwa-quick-start.md`:
- Around line 58-60: The documentation guidance for checking cached sessions
shows `MwaSession.HasCachedSession()` being called without await, but since the
method returns Task<bool> it must be awaited in an async context. Update the
code example in the best practices guidance to demonstrate calling
MwaSession.HasCachedSession() with await and show it within an appropriate async
method or context to prevent readers from copying code that will result in a
compile-time error.

In
`@Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/CapabilitiesResult.cs`:
- Around line 94-100: The ReadJson method in MixedStringArrayConverter currently
accepts any JSON token type and coerces it to a string via ToString(), which
allows invalid schema values like objects, arrays, and booleans to silently
contaminate the result array. Modify the token processing loop where result[i]
is assigned to first validate that each token is either null or of type
JTokenType.String; for any other token type, throw a JsonSerializationException
with a descriptive error message indicating the unsupported type was
encountered, rather than blindly calling ToString() on the token.

In
`@Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/CloneAuthorizationResult.cs`:
- Line 14: The `[RequiredMember]` attribute is a C# 11 feature not supported by
Unity, which only supports C# 9.0 and will cause compilation errors. Remove all
occurrences of the `[RequiredMember]` attribute from the affected classes
(CloneAuthorizationResult, SignedResult, SignAndSendResult, AuthorizationResult,
and others mentioned in the comment). Replace this compile-time validation with
runtime validation by adding property validation logic in constructors or
initialization methods to ensure required properties are properly initialized
before use.

In
`@Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignAndSendResult.cs`:
- Around line 22-24: In the SignatureBytes property of the SignAndSendResult
class, add validation for each signature entry before calling
Convert.FromBase64String instead of relying on the default exception behavior.
Check each element in the Signatures collection for null or invalid base64
content, and when an invalid entry is encountered, throw a structured
serialization exception that includes both the problematic entry and its index
position in the list to provide clear context for debugging.

In `@Runtime/codebase/SolanaMobileStack/MobileWalletAdapterClient.cs`:
- Around line 85-90: The SignAndSendTransactions method lacks a null guard for
the transactions parameter, which causes a crash during request construction
when transactions.Select(...) is called in
PrepareSignAndSendTransactionsRequest. Add a null check at the start of the
SignAndSendTransactions method to validate that transactions is not null and
throw ArgumentNullException if it is, providing a clear and predictable API
contract. Apply the same null guard fix to any other similar transaction signing
entry-point methods in this class.

In `@Runtime/codebase/SolanaMobileStack/MwaRpcException.cs`:
- Around line 48-61: The MwaErrorCodes class is missing the NotCloned error code
that is defined in the MWA 2.0 specification. Add a new constant declaration for
NotCloned with the value -5 in the MwaErrorCodes class, positioning it between
the NotSubmitted constant (value -4) and the TooManyPayloads constant (value -6)
to maintain proper ordering of the error codes.

In `@Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs`:
- Around line 533-537: The LoginWithSignIn method does not validate that the
payload parameter is non-null before passing it to LoginWithSignInImpl, which
will crash with a NullReferenceException when LoginWithSignInImpl attempts to
read multiple fields from the payload. Add a null check at the beginning of the
LoginWithSignIn method to validate the payload parameter and throw an
ArgumentNullException if it is null, ensuring the method fails gracefully with a
clear error message rather than a crash later during execution.
- Around line 476-484: The ParseDataSignatures method does not handle exceptions
that can be thrown by Convert.FromBase64String when processing malformed base64
data in the wallet response. Wrap the Convert.FromBase64String call in a
try-catch block to gracefully handle FormatException (or more broadly, any
exception from base64 decoding), and assign null to result[i] when the
conversion fails, allowing the method to return safely without breaking the
SignAndSendTxResult contract.

---

Outside diff comments:
In `@Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs`:
- Line 703: The DeauthorizeImpl method is calling ResolveWalletPackage() at line
703, but this method triggers wallet discovery and native picker UI, which
should not occur during deauthorization. Instead of calling
ResolveWalletPackage(), retrieve the already-authorized wallet package directly
from the current session state or a stored field that holds the active wallet
package from the authorization flow. This ensures deauthorization completes
without prompting the user with any UI chooser.

In `@Tests/EditMode/MwaAuthCache/PlayerPrefsAuthCacheTests.cs`:
- Around line 138-148: The test method Clear_OnEmptyCache_IsIdempotent does not
actually test idempotency because it only calls Clear() once. To properly
validate idempotency and verify that back-to-back invocations are safe (as
mentioned in the comment), add a second await cache.Clear() call immediately
after the first one, before the final assertion. This will demonstrate that
calling Clear() multiple times in succession on an empty cache produces
consistent results without errors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 539114b5-a4bf-4ff5-89f2-019a884cce5e

📥 Commits

Reviewing files that changed from the base of the PR and between 8fc607a and 19cac76.

📒 Files selected for processing (38)
  • Runtime/Plugins/SolanaMobileStack/Android/MwaChooserHelper.java
  • Runtime/codebase/SolanaMobileStack/Interfaces/IAdapterOperations.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/JsonRequest.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/AuthorizationResult.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/CapabilitiesResult.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/CloneAuthorizationResult.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/CloneAuthorizationResult.cs.meta
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/Response.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignAndSendResult.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignAndSendResult.cs.meta
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignAndSendTxResult.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignAndSendTxResult.cs.meta
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignInResult.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignInResult.cs.meta
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/SignInPayload.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/SignInPayload.cs.meta
  • Runtime/codebase/SolanaMobileStack/MobileWalletAdapterClient.cs
  • Runtime/codebase/SolanaMobileStack/MwaAuthCache/IMwaAuthCache.cs
  • Runtime/codebase/SolanaMobileStack/MwaRpcException.cs
  • Runtime/codebase/SolanaMobileStack/MwaRpcException.cs.meta
  • Runtime/codebase/SolanaMobileStack/MwaSession.cs
  • Runtime/codebase/SolanaMobileStack/MwaSession.cs.meta
  • Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs
  • Runtime/codebase/SolanaWalletAdapter.cs
  • Tests/EditMode/Contracts/IAdapterOperationsContractTests.cs
  • Tests/EditMode/JsonRpc/CapabilitiesResultTests.cs
  • Tests/EditMode/MwaAuthCache/PlayerPrefsAuthCacheTests.cs
  • Tests/EditMode/MwaClient/MobileWalletAdapterClientTests.cs
  • docs.meta
  • docs/mwa-best-practices.md
  • docs/mwa-best-practices.md.meta
  • docs/mwa-cache-guide.md
  • docs/mwa-cache-guide.md.meta
  • docs/mwa-method-reference.md
  • docs/mwa-method-reference.md.meta
  • docs/mwa-quick-start.md
  • docs/mwa-quick-start.md.meta
  • package.json

Comment thread docs/mwa-best-practices.md Resolved
Comment thread docs/mwa-best-practices.md Resolved
Comment thread docs/mwa-quick-start.md
Comment on lines +58 to +60
Because returning users reconnect silently, a landing screen should show **Continue** +
**Logout** for them instead of a bare **Connect**. Check before any adapter exists with
`MwaSession.HasCachedSession()` — see [Best Practices](mwa-best-practices.md).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Call the cached-session helper asynchronously.

MwaSession.HasCachedSession() is documented as Task<bool> in the method reference, so this guidance should show await/an async context; otherwise readers will copy a compile-time mismatch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/mwa-quick-start.md` around lines 58 - 60, The documentation guidance for
checking cached sessions shows `MwaSession.HasCachedSession()` being called
without await, but since the method returns Task<bool> it must be awaited in an
async context. Update the code example in the best practices guidance to
demonstrate calling MwaSession.HasCachedSession() with await and show it within
an appropriate async method or context to prevent readers from copying code that
will result in a compile-time error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
docs/mwa-best-practices.md (1)

44-44: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace the C# 8 range syntax in this sample.

If this doc still targets Unity 2019.4, addr[..4] / addr[^4..] won’t compile; use Substring or call out a newer minimum Unity/C# version. This is the same compatibility issue previously flagged.

♻️ Proposed fix
-                continueLabel.text = $"Continue as {addr[..4]}…{addr[^4..]}";
+                continueLabel.text = $"Continue as {addr.Substring(0, 4)}…{addr.Substring(addr.Length - 4)}";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/mwa-best-practices.md` at line 44, The code sample in the
continueLabel.text assignment uses C# 8 range syntax (addr[..4] and addr[^4..])
which is incompatible with Unity 2019.4. Replace this range syntax with
traditional Substring method calls instead: addr[..4] should become
addr.Substring(0, 4) and addr[^4..] should become addr.Substring(addr.Length -
4) to ensure the sample compiles on the documented minimum Unity/C# version.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@docs/mwa-best-practices.md`:
- Line 44: The code sample in the continueLabel.text assignment uses C# 8 range
syntax (addr[..4] and addr[^4..]) which is incompatible with Unity 2019.4.
Replace this range syntax with traditional Substring method calls instead:
addr[..4] should become addr.Substring(0, 4) and addr[^4..] should become
addr.Substring(addr.Length - 4) to ensure the sample compiles on the documented
minimum Unity/C# version.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6b851dd7-a1f1-4afe-9806-fecc6bcf9789

📥 Commits

Reviewing files that changed from the base of the PR and between 19cac76 and 8251503.

📒 Files selected for processing (6)
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/CapabilitiesResult.cs
  • Runtime/codebase/SolanaMobileStack/JsonRpcClient/Responses/SignAndSendResult.cs
  • Runtime/codebase/SolanaMobileStack/MobileWalletAdapterClient.cs
  • Runtime/codebase/SolanaMobileStack/MwaRpcException.cs
  • Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs
  • docs/mwa-best-practices.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs (4)

426-436: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Validate transactions before serialization in SignAndSendTransactionsImpl.

Line 435 dereferences transactions via .Select(...) without guarding null/empty input, so caller mistakes become NullReferenceException instead of a controlled result.

Suggested fix
 private async Task<SignAndSendTxResult> SignAndSendTransactionsImpl(
     Transaction[] transactions, SignAndSendTransactionsOptions options)
 {
+    if (transactions == null || transactions.Length == 0)
+    {
+        return new SignAndSendTxResult.Failed
+        {
+            Code = MwaErrorCodes.InvalidParams,
+            Message = "[MWA] SignAndSendTransactions: at least one transaction is required"
+        };
+    }
+
     SignAndSendResult res = null;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs` around lines
426 - 436, The SignAndSendTransactionsImpl method dereferences the transactions
parameter via .Select() without first validating that it is not null or empty,
which can cause a NullReferenceException instead of returning a controlled error
result. Add validation at the start of the SignAndSendTransactionsImpl method to
check if transactions is null or empty, and return an appropriate
SignAndSendTxResult indicating failure if validation fails, before proceeding to
the RunPrivileged call.

632-637: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

SIWS fallback can sign a message for one address but return another address.

Line 634 prefers payload.Address; Line 623 returns publicKey.Key. If these differ, the signed SIWS message and returned identity diverge, breaking verifier assumptions.

Suggested fix
 private static string BuildSiwsMessage(SignInPayload p, string addressBase58)
 {
-    var address = !string.IsNullOrEmpty(p.Address) ? p.Address : addressBase58;
+    if (!string.IsNullOrEmpty(p.Address) && !string.Equals(p.Address, addressBase58, StringComparison.Ordinal))
+        throw new ArgumentException("[MWA] SignInPayload.address must match the authorized account", nameof(p));
+    var address = addressBase58;

Also applies to: 621-624

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs` around lines
632 - 637, The BuildSiwsMessage method uses p.Address if available (falling back
to addressBase58) to build the SIWS message, but the caller returns
publicKey.Key instead. This creates a mismatch where the signed message and
returned identity diverge. Ensure consistency by using the same address value
that was actually used in BuildSiwsMessage as the return value. Modify the code
around lines 621-624 to return the address that was passed to or resolved within
BuildSiwsMessage (the value matching what line 634 used), rather than always
returning publicKey.Key.

729-735: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

DeauthorizeWallet can still trigger picker UI due to package resolution path.

Line 734 uses ResolveWalletPackage(), whose documented behavior includes native picker fallback. That conflicts with the no-chooser disconnect behavior described in Line 729–733.

Suggested fix
- string targetPackage = await ResolveWalletPackage();
+ // Deauthorize should be cache-only: never trigger discovery/picker UI.
+ string targetPackage = await _walletSelectionCache.GetSelectedWalletPackage();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs` around lines
729 - 735, The DeauthorizeWallet method's call to ResolveWalletPackage() at line
734 can trigger the native picker UI as a fallback behavior, which directly
contradicts the documented no-chooser requirement stated in the comments on
lines 729–733. Modify the ResolveWalletPackage invocation in DeauthorizeWallet
to ensure it does not fall back to the OS wallet chooser (either by using a
non-fallback variant of the method, passing a parameter to disable fallback, or
wrapping the call to catch the fallback scenario and skip remote revoke while
clearing local state as documented). The goal is to ensure deauthorization never
shows the picker UI, maintaining the intended disconnect behavior.

347-352: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Preserve RPC code/data on authorize failures instead of throwing generic exceptions.

At Line 351 and Line 572, throwing Exception drops wallet error Code/Data, which regresses the typed error contract introduced elsewhere in this adapter.

Suggested fix
 if (!result.WasSuccessful)
 {
-    Debug.LogError(result.Error.Message);
-    throw new Exception(result.Error.Message);
+    Debug.LogError($"[MWA] Login failed ({result.Error?.Code}): {result.Error?.Message}");
+    throw new MwaRpcException(
+        result.Error?.Code ?? 0,
+        result.Error?.Message ?? "[MWA] Login failed",
+        result.Error?.Data);
 }
 if (!result.WasSuccessful)
-    throw new Exception(result.Error?.Message ?? "[MWA] LoginWithSignIn: authorize failed");
+    throw new MwaRpcException(
+        result.Error?.Code ?? 0,
+        result.Error?.Message ?? "[MWA] LoginWithSignIn: authorize failed",
+        result.Error?.Data);

Also applies to: 571-573

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs` around lines
347 - 352, The code is throwing a generic Exception that only includes the error
message, which drops the wallet error Code and Data fields that should be
preserved per the typed error contract. Replace the generic Exception throws (in
the authorization failure handling blocks where result.WasSuccessful is false)
with an exception type that captures and preserves all error fields from
result.Error, including Code and Data. This needs to be done at both the
location with StartAndExecute and the other location mentioned in the comment,
ensuring the typed error contract is maintained throughout the adapter.
Tests/EditMode/MwaAuthCache/PlayerPrefsAuthCacheTests.cs (1)

139-147: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Idempotency test only performs one Clear() call.

Line 145 executes Clear() once, so this test no longer validates the “back-to-back” idempotency case it describes. Add a second call before asserting state.

Suggested fix
         public async Task Clear_OnEmptyCache_IsIdempotent()
         {
             var cache = new PlayerPrefsAuthCache();

             // DisconnectWallet() and DeauthorizeWallet() can both call Clear in a row,
             // so back-to-back invocations on an empty cache must be safe.
             await cache.Clear();
+            await cache.Clear();

             Assert.IsNull(await cache.Get());
         }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/EditMode/MwaAuthCache/PlayerPrefsAuthCacheTests.cs` around lines 139 -
147, The test method Clear_OnEmptyCache_IsIdempotent only invokes Clear() once,
but the test's purpose and comment indicate it should verify back-to-back
idempotency. Add a second call to cache.Clear() before the Assert.IsNull
assertion to properly test that successive Clear() invocations on an empty cache
are safe and idempotent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Runtime/codebase/Web3.cs`:
- Around line 307-311: The code in the prefab assignment block (lines 307–310)
assumes that both solanaWalletAdapterOptions and its nested
solanaWalletAdapterWebGLOptions are non-null without guards, which causes null
reference exceptions on non-WebGL setups. Add null checks to ensure
solanaWalletAdapterOptions is not null and solanaWalletAdapterWebGLOptions is
not null before attempting to access or assign the walletAdapterUIPrefab and
walletAdapterButtonPrefab properties on those objects.

---

Outside diff comments:
In `@Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs`:
- Around line 426-436: The SignAndSendTransactionsImpl method dereferences the
transactions parameter via .Select() without first validating that it is not
null or empty, which can cause a NullReferenceException instead of returning a
controlled error result. Add validation at the start of the
SignAndSendTransactionsImpl method to check if transactions is null or empty,
and return an appropriate SignAndSendTxResult indicating failure if validation
fails, before proceeding to the RunPrivileged call.
- Around line 632-637: The BuildSiwsMessage method uses p.Address if available
(falling back to addressBase58) to build the SIWS message, but the caller
returns publicKey.Key instead. This creates a mismatch where the signed message
and returned identity diverge. Ensure consistency by using the same address
value that was actually used in BuildSiwsMessage as the return value. Modify the
code around lines 621-624 to return the address that was passed to or resolved
within BuildSiwsMessage (the value matching what line 634 used), rather than
always returning publicKey.Key.
- Around line 729-735: The DeauthorizeWallet method's call to
ResolveWalletPackage() at line 734 can trigger the native picker UI as a
fallback behavior, which directly contradicts the documented no-chooser
requirement stated in the comments on lines 729–733. Modify the
ResolveWalletPackage invocation in DeauthorizeWallet to ensure it does not fall
back to the OS wallet chooser (either by using a non-fallback variant of the
method, passing a parameter to disable fallback, or wrapping the call to catch
the fallback scenario and skip remote revoke while clearing local state as
documented). The goal is to ensure deauthorization never shows the picker UI,
maintaining the intended disconnect behavior.
- Around line 347-352: The code is throwing a generic Exception that only
includes the error message, which drops the wallet error Code and Data fields
that should be preserved per the typed error contract. Replace the generic
Exception throws (in the authorization failure handling blocks where
result.WasSuccessful is false) with an exception type that captures and
preserves all error fields from result.Error, including Code and Data. This
needs to be done at both the location with StartAndExecute and the other
location mentioned in the comment, ensuring the typed error contract is
maintained throughout the adapter.

In `@Tests/EditMode/MwaAuthCache/PlayerPrefsAuthCacheTests.cs`:
- Around line 139-147: The test method Clear_OnEmptyCache_IsIdempotent only
invokes Clear() once, but the test's purpose and comment indicate it should
verify back-to-back idempotency. Add a second call to cache.Clear() before the
Assert.IsNull assertion to properly test that successive Clear() invocations on
an empty cache are safe and idempotent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7802dcbd-fc58-4c1c-9425-b0a7e5391559

📥 Commits

Reviewing files that changed from the base of the PR and between 8251503 and 03946cc.

📒 Files selected for processing (14)
  • README.md
  • Runtime/codebase/SolanaMobileStack/MwaAuthCache/IMwaAuthCache.cs
  • Runtime/codebase/SolanaMobileStack/MwaSession.cs
  • Runtime/codebase/SolanaMobileStack/SolanaMobileWalletAdapter.cs
  • Runtime/codebase/SolanaWalletAdapter.cs
  • Runtime/codebase/Web3.cs
  • Tests/EditMode/MwaAuthCache/PlayerPrefsAuthCacheTests.cs
  • Tests/EditMode/MwaClient/MobileWalletAdapterClientTests.cs
  • docs/installation.md
  • docs/installation.md.meta
  • docs/mwa-best-practices.md
  • docs/mwa-cache-guide.md
  • docs/mwa-method-reference.md
  • docs/mwa-quick-start.md

Comment thread Runtime/codebase/Web3.cs
Comment on lines +307 to +311
if (solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterUIPrefab == null)
solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterUIPrefab = Resources.Load<GameObject>("SolanaUnitySDK/WalletAdapterUI");
if (solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterButtonPrefab == null)
solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterButtonPrefab = Resources.Load<GameObject>("SolanaUnitySDK/WalletAdapterButton");
return new SolanaWalletAdapter(solanaWalletAdapterOptions, rpcCluster, customRpc, webSocketsRpc, false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard adapter options before WebGL prefab dereference.

Line 307–310 assumes solanaWalletAdapterOptions and solanaWalletAdapterWebGLOptions are non-null; on non-WebGL setups this can throw before login starts.

Suggested fix
 private SolanaWalletAdapter CreateWalletAdapter()
 {
-    if (solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterUIPrefab == null)
-        solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterUIPrefab = Resources.Load<GameObject>("SolanaUnitySDK/WalletAdapterUI");
-    if (solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterButtonPrefab == null)
-        solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterButtonPrefab = Resources.Load<GameObject>("SolanaUnitySDK/WalletAdapterButton");
+    if (solanaWalletAdapterOptions == null)
+        throw new InvalidOperationException("[Solana SDK] solanaWalletAdapterOptions is not configured.");
+#if UNITY_WEBGL
+    solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions ??= new SolanaWalletAdapterWebGLOptions();
+    if (solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterUIPrefab == null)
+        solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterUIPrefab = Resources.Load<GameObject>("SolanaUnitySDK/WalletAdapterUI");
+    if (solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterButtonPrefab == null)
+        solanaWalletAdapterOptions.solanaWalletAdapterWebGLOptions.walletAdapterButtonPrefab = Resources.Load<GameObject>("SolanaUnitySDK/WalletAdapterButton");
+#endif
     return new SolanaWalletAdapter(solanaWalletAdapterOptions, rpcCluster, customRpc, webSocketsRpc, false);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Runtime/codebase/Web3.cs` around lines 307 - 311, The code in the prefab
assignment block (lines 307–310) assumes that both solanaWalletAdapterOptions
and its nested solanaWalletAdapterWebGLOptions are non-null without guards,
which causes null reference exceptions on non-WebGL setups. Add null checks to
ensure solanaWalletAdapterOptions is not null and
solanaWalletAdapterWebGLOptions is not null before attempting to access or
assign the walletAdapterUIPrefab and walletAdapterButtonPrefab properties on
those objects.

@lopeselio

Copy link
Copy Markdown
Contributor

when is this coming out?

@Kuldotha
Kuldotha merged commit bd0d30f into main Jun 17, 2026
1 check passed
@Kuldotha
Kuldotha deleted the feat/mwa-v2 branch June 17, 2026 11:38
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