Missing or invalid request chainId
See original GitHub issueDescribe 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:
- Init Client
const client = await client.init({
projectId,
relayUrl: "wss://relay.walletconnect.com",
metadata: {
name,
description,
url,
icons: ["https://walletconnect.com/walletconnect-logo.png"],
},
})
- Make connect request
const NAMESPACE = "somenamespace"
const MAINNET = `${NAMESPACE}:mainnet`
const { uri = "", approval } = await client.connect({
requiredNamespaces: {
[NAMESPACE]: {
chains: [MAINNET],
methods: ["personalSign"],
events: [],
},
},
})
- Wait for approval
const session = await approval()
- Make a request
client
.request({
topic: session.topic,
chainId: MAINNET,
request: { method: "personal_sign", params: [] },
})
{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:
- Created a year ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@IljaDaderko that was it! Thanks!
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.