Cancel MetaMask Connection Task
task::connect_metamask::cancel
Use task::connect_metamask::cancel to abort the MetaMask initialisation task.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | integer | ✓ | The identifying number returned when the task was first initiated. |
Response Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| result | string | – | Returns success on success, otherwise the standard error fields below are populated. |
| error | string | – | Description of the error. |
| error_path | string | – | Used for debugging. A reference to the function in code base which returned the error. |
| error_trace | string | – | Used for debugging. A trace of lines of code which led to the returned error. |
| error_type | string | – | An enumerated error identifier to indicate the category of error. |
| error_data | string | – | Additional context for the error type. |
📌 Cancel MetaMask Connection Task
POST Cancel MetaMask Connection Task
task::connect_metamask::cancel {
"mmrpc": "2.0",
"method": "task::connect_metamask::cancel",
"params": {
"task_id": 42
},
"id": 1,
"userpass": "RPC_UserP@SSW0RD"
} curl --url "http://127.0.0.1:7783" --data '{
"mmrpc": "2.0",
"method": "task::connect_metamask::cancel",
"params": {
"task_id": 42
},
"id": 1,
"userpass": "RPC_UserP@SSW0RD"
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"mmrpc": "2.0",
"method": "task::connect_metamask::cancel",
"params": {
"task_id": 42
},
"id": 1,
"userpass": "RPC_UserP@SSW0RD"
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"mmrpc": "2.0",
"method": "task::connect_metamask::cancel",
"params": {
"task_id": 42
},
"id": 1,
"userpass": "RPC_UserP@SSW0RD"
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"mmrpc": "2.0",
"method": "task::connect_metamask::cancel",
"params": {
"task_id": 42
},
"id": 1,
"userpass": "RPC_UserP@SSW0RD"
}
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(`{"mmrpc":"2.0","method":"task::connect_metamask::cancel","params":{"task_id":42},"id":1,"userpass":"RPC_UserP@SSW0RD"}`)
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 = {
"mmrpc": "2.0",
"method": "task::connect_metamask::cancel",
"params": {
"task_id": 42
},
"id": 1,
"userpass": "RPC_UserP@SSW0RD"
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response (success)
{
"mmrpc": "2.0",
"result": "success",
"id": 1
}Response (task already finished)
{
"mmrpc": "2.0",
"error": "Task is finished already",
"error_path": "init_metamask.manager",
"error_trace": "init_metamask:215] manager:104]",
"error_type": "TaskFinished",
"error_data": 42,
"id": 1
}