Skip to content

Conversation

@ganchoradkov
Copy link
Member

@ganchoradkov ganchoradkov commented Jan 12, 2026

Summary

  • Adds explicit solaxy case in UniversalProvider.createProviders() switch statement
  • Uses GenericProvider for Solaxy RPC communication (Solana VM compatible)
  • Enables WalletConnect support for Solaxy ecosystem via CAIP-2 chain ID solaxy:1936682104
  • Adds test coverage for solaxy namespace initialization

Context

This is a clean reimplementation of the feature requested in #7016, which had several issues:

  • Missing solana.ts provider file that was referenced but not included
  • Broken indentation in the switch statement
  • Mismatch between PR description and actual implementation

This PR takes a simpler approach by using the existing GenericProvider, which is sufficient for Solaxy's Solana-compatible RPC methods.

Test plan

  • Added unit test should init generic provider for solaxy namespace
  • Verify test passes: npm run test in providers/universal-provider
  • Manual testing with solaxy namespace connection

Note

Adds explicit support for the solaxy namespace in UniversalProvider and verifies it with unit tests.

  • Adds solaxy case in UniversalProvider.createProviders() to instantiate GenericProvider
  • Enables CAIP-2 chain solaxy:1936682104 with HTTP provider URL resolution validated
  • Adds test should init generic provider for solaxy namespace ensuring provider creation and RPC URL generation
  • Introduces a changeset for a minor version bump of @walletconnect/universal-provider

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

Add solaxy as an explicitly supported namespace in UniversalProvider,
using the GenericProvider for RPC communication. This enables
WalletConnect support for the Solaxy (SVM) ecosystem via CAIP-2
chain ID solaxy:1936682104.

Includes test coverage for solaxy namespace initialization.
Copilot AI review requested due to automatic review settings January 12, 2026 08:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds explicit support for the Solaxy namespace to the UniversalProvider by adding a case statement in the provider creation switch and including test coverage.

Changes:

  • Adds case "solaxy": in the createProviders() switch statement to explicitly handle Solaxy namespace
  • Adds unit test validating that solaxy namespace initializes with GenericProvider
  • Enables WalletConnect integration for Solaxy ecosystem using CAIP-2 chain ID solaxy:1936682104

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
providers/universal-provider/src/UniversalProvider.ts Adds explicit solaxy case in switch statement (falls through to default GenericProvider)
providers/universal-provider/test/index.spec.ts Adds test case validating solaxy namespace provider initialization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1633 to +1685
it("should init generic provider for solaxy namespace", async () => {
// #given
const dapp = await UniversalProvider.init({
...TEST_PROVIDER_OPTS,
name: "dapp",
});
const wallet = await UniversalProvider.init({
...TEST_PROVIDER_OPTS,
name: "wallet",
});
const solaxyChains = ["solaxy:1936682104"];
const solaxyAddress = "SoLaXyAddressExample123456789";

// #when
await testConnectMethod(
{
dapp,
wallet,
},
{
requiredNamespaces: {},
optionalNamespaces: {},
namespaces: {
solaxy: {
accounts: solaxyChains.map((chain) => `${chain}:${solaxyAddress}`),
chains: solaxyChains,
methods: ["getBlockHeight", "getBalance"],
events: ["chainChanged"],
},
},
},
);
await throttle(1_000);

// #then
expect(dapp.rpcProviders).to.be.an("object");
expect(dapp.rpcProviders.solaxy).to.exist;
expect(dapp.rpcProviders.solaxy).to.be.an("object");

const solaxyHttpProviders = dapp.rpcProviders.solaxy.httpProviders;
expect(Object.keys(solaxyHttpProviders).length).to.eql(solaxyChains.length);

Object.values(solaxyHttpProviders).forEach((provider, i) => {
const url = provider.connection.url as string;
expect(url).to.include("https://");
expect(url).to.include(RPC_URL);
expect(url).to.eql(
getRpcUrl(solaxyChains[i], {} as Namespace, TEST_PROVIDER_OPTS.projectId),
);
});

await deleteProviders({ A: dapp, B: wallet });
});
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

This test is functionally identical to the existing test "should init generic provider if provider for given namespace doesn't exist" (lines 1564-1631), which already validates that any namespace without a specific provider falls back to GenericProvider.

The test adds value as documentation showing that solaxy is supported, but consider whether this level of duplication is necessary. If the explicit case "solaxy": is removed from the switch statement (as it provides no unique behavior), this test becomes redundant since solaxy would behave identically to other namespaces like tron and zora that are already tested.

Alternatively, if you want to keep this test for documentation purposes, consider adding a comment explaining that this test serves as documentation for solaxy support rather than testing unique behavior.

Copilot uses AI. Check for mistakes.
namespace: combinedNamespace,
});
break;
case "solaxy":
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The explicit case "solaxy": statement before the default: case creates a fall-through pattern that is redundant and potentially confusing. Since there's no break statement and no code in the solaxy case, it behaves identically to any other namespace hitting the default case.

This means the solaxy namespace will already be handled by the default case without needing an explicit case statement. The explicit case adds no functionality and may mislead future maintainers into thinking solaxy requires special handling when it doesn't.

Consider either:

  1. Removing the explicit case "solaxy": line entirely, as the default case already handles it correctly
  2. Adding a comment explaining that solaxy intentionally uses GenericProvider (e.g., // solaxy uses GenericProvider (falls through to default))
Suggested change
case "solaxy":

Copilot uses AI. Check for mistakes.
@Marcolist
Copy link

Quick clarification on my side — the previously mentioned solaxy:1936682104 was my mistake.
That value is the Hyperlane chain ID, not the CAIP-2 identifier.

For Solaxy mainnet, the correct CAIP-2 chain ID (Solana cluster genesis) is:

solana:5oapfnaq6jkzYPhnrB9Rnaaff4bG2UskksEY6PvPhQan

Thanks again for the clean implementation using GenericProvider 👍

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