Skip to content

Conversation

@elribonazo
Copy link
Contributor

@elribonazo elribonazo commented Oct 2, 2025

Explanation

The issue happens because the multichain-api-client is getting the session for the first RPC request that we run, this affects the user experience forcing the user to go back to the Dapp until the session is delivered.

I've replaced usage in RPCClient from this.provider to this.transport which does not trigger this extra RPC request.

This also makes the use of this.provider in multichain, no longer needed. We're basically using all the transport stuff from multichain-api-client but not the provider itself, not even for default transports now.

For the previous, I'd propose to create a separate PR to remove provider from the SDK and just use transports but will require a bunch of tests to be re-visited

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

Note

RPC calls now use transport.request (not provider) and invocation starts before opening the deeplink; tests updated accordingly.

  • MultichainSDK:
    • invokeMethod now instantiates RPCClient with transport and starts invokeMethod before opening the deeplink when secure && !preferDesktop; returns the invoke promise.
  • RPCClient:
    • Accepts ExtendedTransport instead of provider; redirects write/personal methods via transport.request using wallet_invokeMethod, returning response.result and handling response.error.
    • Read-only flow via HTTP unchanged (Infura/custom RPC handling, headers, parsing, errors).
  • Tests:
    • Updated to mock transport.request and expectations for redirect/fallback paths; retain fetch-based assertions for readonly cases.

Written by Cursor Bugbot for commit 90a2ca8. This will update automatically on new commits. Configure here.

@elribonazo elribonazo requested a review from a team as a code owner October 2, 2025 16:41
@elribonazo elribonazo enabled auto-merge (squash) October 2, 2025 16:51
@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.99%. Comparing base (ac8f8c3) to head (90a2ca8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1355   +/-   ##
=======================================
  Coverage   74.99%   74.99%           
=======================================
  Files         184      184           
  Lines        4519     4519           
  Branches     1108     1108           
=======================================
  Hits         3389     3389           
  Misses       1130     1130           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2025

@elribonazo elribonazo merged commit e88f671 into main Oct 2, 2025
44 checks passed
@elribonazo elribonazo deleted the fix/multichain-cold-start-issue branch October 2, 2025 17:26
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.

3 participants