Get contract map entry

Retrieves a specific entry from a contract data map.


POST
/v2/map_entry/{contract_address}/{contract_name}/{map_name}

Get specific data-map inside a contract

Attempt to fetch data from a contract data map. The contract is identified with [Stacks Address] and [Contract Name] in the URL path. The map is identified with [Map Name].

The key to lookup in the map is supplied via the POST body. This should be supplied as the hex string serialization of the key (which should be a Clarity value). Note, this is a JSON string atom.

In the response, data is the hex serialization of the map response. Note that map responses are Clarity option types, for non-existent values, this is a serialized none, and for all other responses, it is a serialized (some ...) object.

Request Body

Hex string serialization of the lookup key (which should be a Clarity value)

body
Required
string

Path Parameters

contract_address
Required
string

Stacks address

contract_name
Required
string

Contract name

map_name
Required
string

Map name

Query Parameters

proofinteger

Returns object without the proof field when set to 0

tipstring

The Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).

Status codeDescription
200Success
400Failed loading data map
/v2/map_entry/{contract_address}/{contract_name}/{map_name}

Terminal
$
curl -X POST "http://localhost:20443/v2/map_entry/string/string/string?proof=0&tip=string" \
-d 'string'

Response of get data map entry request

{
"data": "string",
"proof": "string"
}