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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for beaker_pyteal-0.0.3.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c86a26755e57a544269dfc9e79edbedf22193ac9c5768675342709497869fde3 |
|
MD5 | 70ff3c9e82529fad1b241218e7544193 |
|
BLAKE2b-256 | e5e2cd323494650792e1eb7d767426dedc5e9b0b22660882ccb67b70b5255481 |