Compile TEAL source code to binary, produce its hash | Algorand Developer Portal

Compile TEAL source code to binary, produce its hash

POST

/v2/teal/compile

Given TEAL source code in plain text, return base64 encoded program bytes and base32 SHA512_256 hash of program bytes (Address style). This endpoint is only enabled when a node’s configuration file sets EnableDeveloperAPI to true.

Authorizations

Parameters

Query Parameters

sourcemap

boolean

When set to true, returns the source map of the program as a JSON. Defaults to false.

Request Body required

TEAL source code to be compiled

Select media type: text/plain

string format: binary

Responses

200

Teal compile Result

Select media type: application/json

hash
required
Base32 SHA512_256 of program bytes (Address style)
string

result
required
Base64 encoded program bytes
string

sourcemap
JSON of the source map
object

400

Bad Request - Teal Compile Error

Select media type: application/json

An error response with optional data field.
data
object
message
required
string

401

Invalid API Token

Select media type: application/json

An error response with optional data field.
data
object
message
required
string

404

Developer API not enabled

500

Internal Error

Select media type: application/json

An error response with optional data field.
data
object
message
required
string

default

Unknown Error