question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing or invalid request chainId

See original GitHub issue

Describe the bug When making a request client.request({ topic, chainId: MAINNET, request: { method: "personal_sign", params: [] }}) I get an error “Missing or invalid request chainId”

SDK Version (if relevant) "@walletconnect/sign-client": "2.0.0-beta.100" Wallet - "react-native": "0.66.4" DAPP - "react": "18.0.0-beta-149b420f6-20211119", "blitz": "0.45.3"

To Reproduce Steps to reproduce the behavior:

  1. Init Client
const client = await client.init({
      projectId,
      relayUrl: "wss://relay.walletconnect.com",
      metadata: {
        name,
        description,
        url,
        icons: ["https://walletconnect.com/walletconnect-logo.png"],
      },
    })
  1. Make connect request
 const NAMESPACE = "somenamespace"
 const MAINNET = `${NAMESPACE}:mainnet`
 const { uri = "", approval } = await client.connect({
      requiredNamespaces: {
        [NAMESPACE]: {
          chains: [MAINNET],
          methods: ["personalSign"],
          events: [],
        },
      },
    })
  1. Wait for approval
const session = await approval()
  1. Make a request
 client
      .request({
        topic: session.topic,
        chainId: MAINNET,
        request: { method: "personal_sign", params: [] },
      })
  1. {code: 1000, message: "Missing or invalid request chainId"}

A clear and concise description of what you expected to happen. Receive a successful response from client.request

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): dApp

  • OS: Mac OS 12.3.1
  • Browser: Safari

Smartphone (please complete the following information): Wallet App

  • Device: iPhone 11
  • OS: 15.5

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
matthewcarlreetzcommented, Jun 10, 2022

@IljaDaderko that was it! Thanks!

0reactions
0xAsimetriqcommented, Jun 13, 2022

Closing this for now, we have a separate issue to improve error messages that should make it easier to debug these things in the future. Plus check has been added to ensure you can’t pass “invalid” accounts when approving the session.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Invalid Chain Id" on Kovan testnet - Ethereum Stack Exchange
The chainId field takes a number (chainId) or a string (chain name), which just acts as a query to require the data necessary...
Read more >
Hardhat metamask error - "Trying to send a raw transaction ...
Hardhat metamask error - "Trying to send a raw transaction with an invalid chainId. The expected chainId is 31337" · Ask Question. Asked...
Read more >
Contract Chain (C-Chain) API - Avalanche Docs
Dropped : The transaction was dropped by this node because it thought the transaction invalid; Unknown : The transaction hasn't been seen by...
Read more >
Error Codes — StarkEx 0.5 documentation - Starkware
Connection error with the node (for example, Infura too many requests). ... StarkEx contracts information missing or corrupt. ... Invalid HTTP request.
Read more >
Providers - Ethers.js
When a request is made, it is sent to multiple backends simultaneously. ... If no network is provided, homestead (i.e. mainnet) is used....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found