ValueSet

Values for flow inputs and outputs are stored as JSONB in the database.

Values are always JSON objects with exactly 1 key. The key describes that value’s data type.

Schema: https://assets.spaceoperator.com/json-schemas/value.json

Null

{
	"N": 0
}

String

{
	"S": "<content of string>"
}

Boolean

{
	// `true` or `false`
	"B": true
}

Numbers

There are many types of numbers. All numbers are encoded as JSON string to avoid losing precision when reading in JavaScript.

U64

Unsigned 64-bit integer.

{
	"U": "1234"
}

I64

Signed 64-bit integer.

{
	"I": "-123456"
}

U128

Unsigned 128-bit integer.

{
	"U1": "340282366920938463463374607431768211455"
}

I128

Signed 128-bit integer.

{
	"I1": "-170141183460469231731687303715884105728"
}

F64

64-bit floating-point value. Support writing with scientific notation (e.g. 1e10).

{
	"F": "1e-10"
}

Decimal

A Decimal in rust_decimal library.

{
	"D": "3.1415926535897932384626433832"
}

Binary data

Binary values containing 32 or 64 bytes are encoded as base-58 string, because they are usually Solana’s pubkey or keypair. Other lengths are encoded with base-64.

32-bytes binary

A binary sequence, exactly 32-bytes long. Encoded as a base-58 string.

{
	"B3": "4pLoLKNMFNLebHQ91vHm9YqspPzpCughUfooGPPzUA6d"
}

64-bytes binary

A binary sequence, exactly 64-bytes long. Encoded as a base-58 string.

{
	"B6": "2FEonhUn96e31GtW2DNRnoeGSUfozrEVTT7JwGfQfXmDYkNSXgGSBCAzb4BPLnQXZ4y1oL4qxAa825LVtd9nyZLk"
}

Other length

Binary values with other length are encoded as base-64 strings.

{
	"BY": "U3Vubnk="
}

Array

Array contains zero or more elements, each element is another value.

e.g. an array contains an integer 10 and a string "Hello":

{
	"A": [
		{ "I": "10" },
		{ "S": "Hello" }
	]
}

Map

{
	"M": {
		"pubkey": { "B3": "4pLoLKNMFNLebHQ91vHm9YqspPzpCughUfooGPPzUA6d" },
		"memo": { "S": "Hello" }
	}
}

Last updated

Was this helpful?