Package Exports
- @algo-builder/runtime
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
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
Runtimeobject to set up accounts, create applications, opt-in to app, update app, etc... - AccountStore: user can create new accounts using a
AccountStoreobject. All information about an account (apps,assets,localState,globalStateetc..) is stored inAccountStore. - 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:
Prepare account state for teal execution.
Stateless TEAL - Approve/Reject logic.
Stateful TEAL - Update and verify global/local states if teal logic is correct.
Transactions to
Full transaction processing for type
payment,application callAsset related transactions:
STATUS: production ready.
Coming Soon
TEAL v3 Support
Contributing
Please read the main README.