JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q65305F
  • License Apache-2.0

JavaScript implementation of Algorand runtime (transaction execution + TEAL interpreter)

Package Exports

  • @algo-builder/runtime
  • @algo-builder/runtime/build/index.js
  • @algo-builder/runtime/build/types
  • @algo-builder/runtime/build/types.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@algo-builder/runtime) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Algo Builder Runtime

This package implements a light version of the go-algorand runtime. It allows to executes transactions and processes TEAL in JavaScript environment. The packages provides 4 main object:

  • Runtime: handles transaction or txn group processing and state management . User can use a Runtime object to set up accounts, create applications, opt-in to app, update app, etc...
  • AccountStore: user can create new accounts using a AccountStore object. All information about an account (apps, assets, localState, globalState etc..) is stored in AccountStore.
  • Parser: reads TEAL code and converts it to a list of opcodes which are executable by the interpreter. If a teal code contains an invalid opcode/data, parser will throw an error.
  • Interpreter: executes a list of opcodes returned by parser. Interpreter creates teal execution stack and interacts with runtime to perform changes related a TEAL code execution. At the end of execution, if the stack contains a single non-zero uint64 element then the teal code is approved, and transaction can be executed.

Usage

@algo-builder/runtime can be included as a library using yarn add @algo-builder/runtime and then import it using import * from '@algo-builder/runtime'.

Please read more about usage of runtime from here.

What we support now

runtime supports:

STATUS: production ready.

Contributing

Please read the main README.