Skip to main content
Scripts exchange data with the outside world as JSON: contract parameters arrive as JSON, and return values leave as JSON.

Return values

A script’s return value is encoded as JSON under the returnValue key: Large or very precise numbers are returned as strings so that no digits are lost:
If a client needs a consistent type for a field, check whether it’s a string and parse it with an arbitrary-precision library.
Trailing zeros after the decimal point aren’t preserved: a decimal such as 72.00 is returned as 72.

Contract parameters

Contract parameters are converted from JSON to their declared types: Send int64 and decimal values as strings when they have more digits than a JSON number can safely carry. Integer parameters larger than 9,007,199,254,740,991 must be sent as strings:

Inferred types

Values without a declared type, such as the properties of an object parameter or of an object returned by a resource function, get inferred types: