wc_get_session
The wc_get_session method returns details for a specific WalletConnect session.
For details on a full list of active WalletConnect sessions, use the wc_get_sessions method instead.
Arguments
| Structure | Type | Description |
|---|---|---|
| with_pairing_topic | bool | Defaults to false. If true, allows using the pairing_topic hex string in the topic param to fetch session details. If false, expects topic param to be the session topic hex string. |
| topic | string | An active session topic (or pairing topic) hex string. |
Response
| Structure | Type | Description |
|---|---|---|
| session | object | A standard WcSession object. |
📌 Examples
Command via pairing topic
POST wc_get_session
{
"method": "wc_get_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": true,
"topic": "ad2fbcc28d410158431a3dc181d4365462df5cef6c90402b3e415c9d75f7c6f1"
}
} curl --url "http://127.0.0.1:7783" --data '{
"method": "wc_get_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": true,
"topic": "ad2fbcc28d410158431a3dc181d4365462df5cef6c90402b3e415c9d75f7c6f1"
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"method": "wc_get_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": true,
"topic": "ad2fbcc28d410158431a3dc181d4365462df5cef6c90402b3e415c9d75f7c6f1"
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"method": "wc_get_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": true,
"topic": "ad2fbcc28d410158431a3dc181d4365462df5cef6c90402b3e415c9d75f7c6f1"
}
};
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_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": true,
"topic": "ad2fbcc28d410158431a3dc181d4365462df5cef6c90402b3e415c9d75f7c6f1"
}
}
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_session","userpass":"RPC_UserP@SSW0RD","mmrpc":"2.0","params":{"with_pairing_topic":true,"topic":"ad2fbcc28d410158431a3dc181d4365462df5cef6c90402b3e415c9d75f7c6f1"}}`)
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_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": true,
"topic": "ad2fbcc28d410158431a3dc181d4365462df5cef6c90402b3e415c9d75f7c6f1"
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Command via session topic
POST wc_get_session
{
"method": "wc_get_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": false,
"topic": "008bb50bc495f768d74d1a0c558fc3ca32ef35f5c507790ea27d01983421ed95"
}
} curl --url "http://127.0.0.1:7783" --data '{
"method": "wc_get_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": false,
"topic": "008bb50bc495f768d74d1a0c558fc3ca32ef35f5c507790ea27d01983421ed95"
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"method": "wc_get_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": false,
"topic": "008bb50bc495f768d74d1a0c558fc3ca32ef35f5c507790ea27d01983421ed95"
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"method": "wc_get_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": false,
"topic": "008bb50bc495f768d74d1a0c558fc3ca32ef35f5c507790ea27d01983421ed95"
}
};
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_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": false,
"topic": "008bb50bc495f768d74d1a0c558fc3ca32ef35f5c507790ea27d01983421ed95"
}
}
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_session","userpass":"RPC_UserP@SSW0RD","mmrpc":"2.0","params":{"with_pairing_topic":false,"topic":"008bb50bc495f768d74d1a0c558fc3ca32ef35f5c507790ea27d01983421ed95"}}`)
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_session",
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"params": {
"with_pairing_topic": false,
"topic": "008bb50bc495f768d74d1a0c558fc3ca32ef35f5c507790ea27d01983421ed95"
}
}
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": {
"session": {
"topic": "008bb50bc495f768d74d1a0c558fc3ca32ef35f5c507790ea27d01983421ed95",
"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": "ad2fbcc28d410158431a3dc181d4365462df5cef6c90402b3e415c9d75f7c6f1",
"namespaces": {
"cosmos": {
"chains": [
"cosmos:cosmoshub-4"
],
"accounts": [
"cosmos:cosmoshub-4:cosmos1r5expjvu46u4s9yd4d2lpmss22p848lw2a7wa8"
],
"methods": [
"cosmos_getAccounts",
"cosmos_signAmino",
"cosmos_signDirect"
],
"events": []
},
"eip155": {
"chains": [
"eip155:43114"
],
"accounts": [
"eip155:43114:0x85ed99633e9d03a30ed60209079944e1f4272048"
],
"methods": [
"eth_sendTransaction",
"eth_signTransaction",
"personal_sign"
],
"events": [
"accountsChanged",
"chainChanged"
]
}
},
"expiry": 1742187410
}
},
"id": null
}