wc_new_connection
The wc_new_connection
method returns a connection string which can be scanned as a QR code.
Once the connection has been established, you can activate EVM and Tendermint coins/tokens with WalletConnect via the priv_key_policy
parameter in enable_eth_with_tokens and enable_tendermint_with_assets.
EIP155 chain IDs are listed at https://chainid.network/. Cosmos chain IDs are listed at https://cosmos.directory/. For more detailed technical information, check out the Walletconnect documentation.
Structure | Type | Description |
---|---|---|
required_namespaces | object | Contains two WcConnNs objects under the keys eip155 and cosmos , which contain details of approved chains, methods and events while connected. |
Structure | Type | Description |
---|---|---|
url | string | A WalletConnect URI address (EIP-1328) used to send a connection request to the bridge server. |
Generally, this WalletConnect URI will be converted into a scanable QR code in graphic user interfaces, so mobile dapps can easily request a connection.
When connecting with Metamask, only the network currently active in the mobile app should be included under the required_namespaces.eip155.chains
parameter. The Metamask app will handle any subsequent coin network changes.
{
"method": "wc_new_connection",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"required_namespaces": {
"eip155": {
"chains": [
"eip155:1",
"eip155:56",
"eip155:137",
"eip155:43114"
],
"methods": [
"eth_sendTransaction",
"eth_signTransaction",
"personal_sign"
],
"events": [
"accountsChanged",
"chainChanged"
]
},
"cosmos": {
"chains": [
"cosmos:cosmoshub-4"
],
"methods": [
"cosmos_signDirect",
"cosmos_signAmino",
"cosmos_getAccounts"
],
"events": []
}
}
}
}