Smart Contracts

Get contract data variable

Changed on

Fetch a data variable from a smart contract. Returns the raw hex-encoded value of the variable.

get/v2/data_var/{principal}/{contract_name}/{var_name}

Request

  • Base URL
    http://localhost:20443
  • URL
    http://localhost:20443/v2/data_var/{principal}/{contract_name}/{var_name}
  • Auth
    none required

Path parameters

var_nameClarityName required(unresolved $ref)

Variable name (must be a valid Clarity name)

Parameters

./components/parameters/standard-principal.yaml (unresolved $ref)
./components/parameters/contract-name.yaml (unresolved $ref)
./components/parameters/proof.yaml (unresolved $ref)
./components/parameters/tip.yaml (unresolved $ref)

Response

The data variable value

ClarityData required(unresolved $ref)

Changes