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(self, 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
You can install from pip:
pip install beaker-pyteal
Or from github directly (no promises on stability):
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.4.post1.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 645152592a3e019e1de6a9f644ee73d0162db17a0d99ba84169eacd05859d95d |
|
MD5 | 18308f1c412a3b6d67fef658c15086e7 |
|
BLAKE2b-256 | ca82960185de86c63b6add97423f8f62e95f6722d60c10c35138b3a709c19c1c |
Close
Hashes for beaker_pyteal-0.0.4.post1.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23702e79e14523fdd8a1be4dd7b3ffbce21ab28669d1d59005ea5a4671c73047 |
|
MD5 | f1f079e2fd31ce3228ddc20f870ecf21 |
|
BLAKE2b-256 | 36c93a899c9b6fd26bc6035513145d6d56ca12b5a9b4cd7a9bc0be4e0180a679 |