A Framework for building PyTeal Applications
Project description
Beaker
Beaker is a smart contract development framework for PyTeal inspired by Flask
With Beaker, we build a class that represents our entire application including state and routing.
Mostly Untested - Expect Breaking Changes
Hello, Beaker
from pyteal import *
from beaker import *
class HelloBeaker(Application):
@external
def hello(name: abi.String, *, output: abi.String):
return output.set(Concat(Bytes("Hello, "), name.get()))
if __name__ == "__main__":
from algosdk.atomic_transaction_composer import AccountTransactionSigner
from beaker import sandbox, client
app = HelloBeaker()
addr, secret = sandbox.get_accounts().pop()
app_client = client.ApplicationClient(
sandbox.get_client(), app, signer=AccountTransactionSigner(secret)
)
app_id, app_addr, txid = app_client.create()
result = app_client.call(app.hello, name="Beaker")
print(result.return_value) # Hello, Beaker
Install
Currently only installing from github is supported
pip install git+https://github.com/algorand-devrel/beaker
Use
Please feel free to file issues/prs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for beaker-pyteal-0.0.1.post5.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 426597bc715425b079e64510c948ba3acd482d570dfdeaa8124a51c3636b0a09 |
|
MD5 | dfddbf026d678efffcb5ec4fe43051d5 |
|
BLAKE2b-256 | 949f32fce27407debc1718a6044ee8fea1cef7108c816a2a44c28dcab9668b31 |
Close
Hashes for beaker_pyteal-0.0.1.post5.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94f646e8d8fa9ed395ae8bd73c23fcf4e32c81b6c681d481d0714a2fd47d01b3 |
|
MD5 | f12c284b473d1fa25e0d622030a4dc20 |
|
BLAKE2b-256 | dfbfd5d61fefbd1931da458a67695cedadbee0417bc2197556a2fdff8704165f |