Skip to main content

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
required

an object containing a JSON-RPC request with method and params

method string

params

Returns

wallet_invokeMethodResult

Customize request
Parameter
Value
string
string
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"