wc_get_sessions
The wc_get_sessions method returns a list of active WalletConnect sessions. For details on a specific connection only, use the wc_get_session method instead.
Arguments
| Structure | Type | Description |
|---|---|---|
| None | N/A | This method takes no input parameters. |
Response
| Structure | Type | Description |
|---|---|---|
| sessions | list of objects | A list of standard WcSession objects. |
📌 Examples
Command
POST wc_get_sessions
{
"method": "wc_get_sessions",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {}
} curl --url "http://127.0.0.1:7783" --data '{
"method": "wc_get_sessions",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"method": "wc_get_sessions",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"method": "wc_get_sessions",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {}
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"method": "wc_get_sessions",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {}
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"method":"wc_get_sessions","userpass":"RPC_UserP@SSW0RD","mmrpc":"2.0","params":{}}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"method": "wc_get_sessions",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response
{
"mmrpc": "2.0",
"result": {
"sessions": [
{
"topic": "feeabbad7ac1f1ba720d4441c299eab2b239f0deefb050fe50dbc7a350d55f75",
"metadata": {
"description": "Trust Wallet is a secure and easy-to-use mobile wallet",
"url": "https://trustwallet.com",
"icons": [
"https://trustwallet.com/assets/images/media/assets/TWT.png"
],
"name": "Trust Wallet"
},
"pairing_topic": "ad604cd186f5dc9498343fbd763f6d6963ea511de0e5d557a33a8e3790d6d4d5",
"namespaces": {
"cosmos": {
"chains": [
"cosmos:cosmoshub-4"
],
"accounts": [
"cosmos:cosmoshub-4:cosmos1r5expjvu46u4s9yd4d2lpmss22p848lw2a7wa8"
],
"methods": [
"cosmos_getAccounts",
"cosmos_signAmino",
"cosmos_signDirect"
],
"events": []
},
"eip155": {
"chains": [
"eip155:1"
],
"accounts": [
"eip155:1:0x85ed99633e9d03a30ed60209079944e1f4272048"
],
"methods": [
"eth_sendTransaction",
"eth_signTransaction",
"personal_sign"
],
"events": [
"accountsChanged",
"chainChanged"
]
}
},
"expiry": 1741952829
},
{
"topic": "ed6c18e392b5d944f46b189be4403beaf8553279dfab946c333cc6d45ddb60a5",
"metadata": {
"description": "Trust Wallet is a secure and easy-to-use mobile wallet",
"url": "https://trustwallet.com",
"icons": [
"https://trustwallet.com/assets/images/media/assets/TWT.png"
],
"name": "Trust Wallet"
},
"pairing_topic": "5686b8065981fafca63bb4b2e7e9384bf348612981e69ac99fb8a698204aaed4",
"namespaces": {
"cosmos": {
"chains": [
"cosmos:cosmoshub-4"
],
"accounts": [
"cosmos:cosmoshub-4:cosmos1r5expjvu46u4s9yd4d2lpmss22p848lw2a7wa8"
],
"methods": [
"cosmos_getAccounts",
"cosmos_signAmino",
"cosmos_signDirect"
],
"events": []
},
"eip155": {
"chains": [
"eip155:1"
],
"accounts": [
"eip155:1:0x85ed99633e9d03a30ed60209079944e1f4272048"
],
"methods": [
"eth_sendTransaction",
"eth_signTransaction",
"personal_sign"
],
"events": [
"accountsChanged",
"chainChanged"
]
}
},
"expiry": 1741952162
},
{
"topic": "24880ee97c56b95491e63d45aa7c743da4ea10bdffa73de7420ed91450c79c09",
"metadata": {
"description": "Trust Wallet is a secure and easy-to-use mobile wallet",
"url": "https://trustwallet.com",
"icons": [
"https://trustwallet.com/assets/images/media/assets/TWT.png"
],
"name": "Trust Wallet"
},
"pairing_topic": "2e6e4a25f2d55c26bba9c7c8dbb4979ff6eff30adac83fbc67110d67399f6023",
"namespaces": {
"cosmos": {
"chains": [
"cosmos:cosmoshub-4"
],
"accounts": [
"cosmos:cosmoshub-4:cosmos1r5expjvu46u4s9yd4d2lpmss22p848lw2a7wa8"
],
"methods": [
"cosmos_getAccounts",
"cosmos_signAmino",
"cosmos_signDirect"
],
"events": []
},
"eip155": {
"chains": [
"eip155:1",
"eip155:137",
"eip155:43114",
"eip155:56"
],
"accounts": [
"eip155:137:0x85ed99633e9d03a30ed60209079944e1f4272048",
"eip155:1:0x85ed99633e9d03a30ed60209079944e1f4272048",
"eip155:43114:0x85ed99633e9d03a30ed60209079944e1f4272048",
"eip155:56:0x85ed99633e9d03a30ed60209079944e1f4272048"
],
"methods": [
"eth_sendTransaction",
"eth_signTransaction",
"personal_sign"
],
"events": [
"accountsChanged",
"chainChanged"
]
}
},
"expiry": 1742183855
},
{
"topic": "bdff85bde684f2f90237d37515177e21d8fa90297c0bf254393629bd9a134a92",
"metadata": {
"description": "Trust Wallet is a secure and easy-to-use mobile wallet",
"url": "https://trustwallet.com",
"icons": [
"https://trustwallet.com/assets/images/media/assets/TWT.png"
],
"name": "Trust Wallet"
},
"pairing_topic": "f8aedf596dde182559ed75ea6358db9f49cf5a8757c0f32551fca8062d613191",
"namespaces": {
"cosmos": {
"chains": [
"cosmos:cosmoshub-4"
],
"accounts": [
"cosmos:cosmoshub-4:cosmos1r5expjvu46u4s9yd4d2lpmss22p848lw2a7wa8"
],
"methods": [
"cosmos_getAccounts",
"cosmos_signAmino",
"cosmos_signDirect"
],
"events": []
},
"eip155": {
"chains": [
"eip155:1",
"eip155:137"
],
"accounts": [
"eip155:137:0x85ed99633e9d03a30ed60209079944e1f4272048",
"eip155:1:0x85ed99633e9d03a30ed60209079944e1f4272048"
],
"methods": [
"eth_sendTransaction",
"eth_signTransaction",
"personal_sign"
],
"events": [
"accountsChanged",
"chainChanged"
]
}
},
"expiry": 1741955363
}
]
},
"id": null
}