7.0.0 • Published 1 year ago

@algo-builder/runtime v7.0.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 year ago

Runtime

This package implements a light version of 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.

Documentation

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.

Coming Soon

TEAL v3 Support

Contributing

Please read the main README.