Runtime is a component that is responsible for running end user code in secure manner. It supports more or less latest ECMAScript standards, but it is not based on any existing runtime, such as that you would expect to find in browsers or in Node. The main reason why it is not based on any existing runtime is to enforce a strong security model. In other words when you copy JS/TS code that was written to work in a browser (using DOM APIs) or in Node environment (using Node modules such as fs) it may not work in our runtime, because certain functions may not be available.

Runtime supports relatively up to date JavaScript core context, plus additional functions and objects:

Standardised functions and classes:

Custom non-standard functions (native to Horizon runtime):

  • AbortProcess (custom error for indicating that the invocation needs to be aborted)

You can pull in additional functions in a form of utility libraries/packages.

More functions/object will be added over time when needed.

You can find the Runtime context TS definition file here.