Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] WalletConnect warnings #1952

Open
jribbink opened this issue Sep 24, 2024 · 0 comments
Open

[BUG] WalletConnect warnings #1952

jribbink opened this issue Sep 24, 2024 · 0 comments
Labels
Bug Something isn't working

Comments

@jribbink
Copy link
Contributor

Current Behavior

Discord report:

I am attempting to configure my website correctly to use FCL / WalletConnect 2.0

I see a bunch of warnings in my console:

WalletConnect Plugin has been already loaded with different configuration. It is not possible to change the configuration after the plugin has been loaded.

I am loading a config file that includes:

export async function setupFclConfigAndWalletConnect() {
  // Flow SDK configuration
  fcl
    .config()
    .put("accessNode.api", "https://rest-mainnet.onflow.org") // Mainnet HTTP access
    .put("discovery.wallet", "https://fcl-discovery.onflow.org/authn") // Wallet service for Flow Mainnet
    .put(
      "discovery.authn.endpoint",
      "https://fcl-discovery.onflow.org/api/authn"
    )
    .put("walletconnect.projectId", "123") // WalletConnect project ID
    .put("app.detail.title", "FlowConnect") // Your app's title
    .put("app.detail.icon", "https://flowconnect.io/logo.png") // Your app's icon URL
    .put("app.detail.description", "Connecting Flow Communities") // Your app's description
    .put("app.detail.url", "https://flowconnect.io"); // Your app's URL

  // WalletConnect configuration
  const { FclWcServicePlugin } = await init({
    projectId: "123", // Your WalletConnect project ID
    metadata: {
      name: "FlowConnect",
      description: "Connecting Flow Communities",
      url: "https://flowconnect.io",
      icons: ["https://flowconnect.io/logo.png"],
    },
    includeBaseWC: true, // Includes a basic WalletConnect service
    wcRequestHook: (wcRequestData) => {
      console.log("WalletConnect request:", wcRequestData);
    }, // Optional: Hook to handle signing requests
    pairingModalOverride: (uri, rejectPairingRequest) => {
      console.log("Override pairing modal with URI:", uri);
    }, // Optional: Custom handling for QR code pairing modal
  });

  // Register the WalletConnect plugin with FCL
  fcl.pluginRegistry.add(FclWcServicePlugin);
}

Context https://discord.com/channels/613813861610684416/1171147675895345162/1285358946097434655

Expected Behavior

Should not display warning if WalletConnect is configured correctly/once.

Maybe we can refresh the plugin when the config changes, but I think the fact that it's "changing" when it hasn't actually changed is an issue in and of itself.

Steps To Reproduce

n/a

Environment

n/a

What are you currently working on that this is blocking?

No response

@jribbink jribbink added the Bug Something isn't working label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant