wallet_invokeMethod
note
MetaMask doesn't support session IDs.
Parameters
scope string
a valid scope
string that has been previously authorized via provider_authorize
Pattern: [-a-z0-9]{3,8}(:[-_a-zA-Z0-9]{1,32})?
request object
requiredan object containing a JSON-RPC request with method
and params
Returns
wallet_invokeMethodResult
Customize request
Parameter
Value
Connect your MetaMask wallet to run requests successfully.
Request
await window.ethereum.request({
"method": "wallet_invokeMethod",
"params": {
scope: "eip155:1",
request: {
method: "eth_getBalance",
params: []
}
},
});
Example response
"0x1"