wallet_sessionChanged
This notification is published by the wallet to notify the callers of updates to a shared session's authorization scopes. The event payload contains the new
sessionScopes
.
note
MetaMask doesn't support session IDs.
Parameters
sessionScopes object
requiredScope for a multi-chain connection
Returns
Customize request
Parameter
Value
Connect your MetaMask wallet to run requests successfully.
Request
await window.ethereum.request({
"method": "wallet_sessionChanged",
"params": {
sessionScopes: {
eip155:1337: {
accounts: [
"eip155:1337:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"
],
methods: [
"wallet_watchAsset",
"eth_sendTransaction",
"eth_decrypt",
"eth_getEncryptionPublicKey",
"web3_clientVersion",
"eth_subscribe",
"eth_unsubscribe",
"eth_blockNumber",
"eth_call",
"eth_chainId",
"eth_estimateGas",
"eth_feeHistory",
"eth_gasPrice",
"eth_getBalance",
"eth_getBlockByHash",
"eth_getBlockByNumber",
"eth_getBlockTransactionCountByHash",
"eth_getBlockTransactionCountByNumber",
"eth_getCode",
"eth_getFilterChanges",
"eth_getFilterLogs",
"eth_getLogs",
"eth_getProof",
"eth_getStorageAt",
"eth_getTransactionByBlockHashAndIndex",
"eth_getTransactionByBlockNumberAndIndex",
"eth_getTransactionByHash",
"eth_getTransactionCount",
"eth_getTransactionReceipt",
"eth_getUncleCountByBlockHash",
"eth_getUncleCountByBlockNumber",
"eth_newBlockFilter",
"eth_newFilter",
"eth_newPendingTransactionFilter",
"eth_sendRawTransaction",
"eth_syncing",
"eth_uninstallFilter"
],
notifications: [
"eth_subscription"
]
},
wallet: {
accounts: [],
methods: [
"wallet_registerOnboarding",
"wallet_scanQRCode"
],
notifications: []
},
wallet:eip155: {
accounts: [
"wallet:eip155:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"
],
methods: [
"wallet_addEthereumChain",
"personal_sign",
"eth_signTypedData_v4"
],
notifications: []
}
}
},
});