Task: Scan for New Addresses
task::scan_for_new_addresses::init
Arguments
| Parameter | Type | Description |
|---|---|---|
| coin | string | The ticker of the coin you want to scan addresses for |
| account_id | integer | Optional, HD wallets only. Generally this will be 0 unless you have multiple accounts registered on your HD wallet |
| gap_limit | integer | Optional. The maximum number of empty addresses in a row. Defaults to the value provided on activation or 20 if no value was provided |
Response
| Parameter | Type | Description |
|---|---|---|
| task_id | integer | An identifying number which is used to query task status. |
📌 Examples
Command
POST task::scan_for_new_addresses::init
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::init",
"params": {
"coin": "DGB",
"account_index": 0,
"gap_limit": 20
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::init",
"params": {
"coin": "DGB",
"account_index": 0,
"gap_limit": 20
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::init",
"params": {
"coin": "DGB",
"account_index": 0,
"gap_limit": 20
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::init",
"params": {
"coin": "DGB",
"account_index": 0,
"gap_limit": 20
}
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::init",
"params": {
"coin": "DGB",
"account_index": 0,
"gap_limit": 20
}
}
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(`{"userpass":"RPC_UserP@SSW0RD","mmrpc":"2.0","method":"task::scan_for_new_addresses::init","params":{"coin":"DGB","account_index":0,"gap_limit":20}}`)
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 = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::init",
"params": {
"coin": "DGB",
"account_index": 0,
"gap_limit": 20
}
}
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": {
"task_id": 3
},
"id": null
} task::scan_for_new_addresses::status
Use the task::scan_for_new_addresses::status method to query the status of a HD address scanning task.
Arguments
| Parameter | Type | Description |
|---|---|---|
| task_id | integer | The identifying number returned when initiating the task. |
| forget_if_finished | boolean | If false, will return final response for completed tasks. Optional, defaults to true. |
Response
| Parameter | Type | Description |
|---|---|---|
| status | string | Status of the task. Ok, InProgress or Error. |
| details | string or object | Once complete, a standard ScanAddressesInfo object. |
📌 Examples
Command
POST task::scan_for_new_addresses::status
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::status",
"params": {
"task_id": 3
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::status",
"params": {
"task_id": 3
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::status",
"params": {
"task_id": 3
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::status",
"params": {
"task_id": 3
}
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::status",
"params": {
"task_id": 3
}
}
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(`{"userpass":"RPC_UserP@SSW0RD","mmrpc":"2.0","method":"task::scan_for_new_addresses::status","params":{"task_id":3}}`)
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 = {
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::scan_for_new_addresses::status",
"params": {
"task_id": 3
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response (success, no new address found)
{
"mmrpc": "2.0",
"result": {
"status": "Ok",
"details": {
"account_index": 0,
"derivation_path": "m/44'/141'/0'",
"new_addresses": []
}
},
"id": null
}Response (success, new address found)
{
"mmrpc": "2.0",
"result": {
"status": "Ok",
"details": {
"account_index": 0,
"derivation_path": "m/44'/141'/0'",
"new_addresses": [
{
"address": "RXaMK6RtvwPiy67oramBfFXCgMobBofMWv",
"derivation_path": "m/44'/141'/0'/0/3",
"chain": "External",
"balance": {
"DOC": {
"spendable": "0",
"unspendable": "0"
}
}
},
{
"address": "RJkjq4DeQ5vTNJxa1gHoS4y31ZU9F3aisu",
"derivation_path": "m/44'/141'/0'/0/4",
"chain": "External",
"balance": {
"DOC": {
"spendable": "0.444",
"unspendable": "0"
}
}
}
]
}
},
"id": null
}