Skip to contents

Returns information about a given address, private key, or public key. Useful for checking whether an address is valid, whether it belongs to the current node, and for inspecting its associated redeem script.

Usage

mc_validate_address(conn, address_or_key)

Arguments

conn

A connection object created by mc_connect.

address_or_key

Character string. An address, private key, or public key.

Value

A list with information about the input, including:

isvalid

Logical indicating whether the input is valid.

address

The canonical address (if valid).

ismine

Logical indicating whether the address belongs to the node.

...

Other fields depending on the input type (e.g., pubkey, script).

Examples

if (FALSE) { # \dontrun{
# Validate an address
info <- mc_validate_address(conn, "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa")
print(info$isvalid)

# Validate a private key (if known)
key_info <- mc_validate_address(conn, "L5...")
} # }