Skip to content
This new developer portal is under construction. For complete documentation, please refer to the old 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

string format: binary

Responses

200

Teal compile Result

object
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

An error response with optional data field.

object
data
object
message
required
string

401

Invalid API Token

An error response with optional data field.

object
data
object
message
required
string

404

Developer API not enabled

500

Internal Error

An error response with optional data field.

object
data
object
message
required
string

default

Unknown Error