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
beaker-pyteal-0.0.4.dev0.tar.gz
(48.0 kB
view hashes)
Built Distribution
Close
Hashes for beaker_pyteal-0.0.4.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c07033920e63c99add680c6381e9bbdfb0d61160d8b790b3ae03c7eea3899b46 |
|
MD5 | 17e7bdb746a664fdc094e4537cfe3a44 |
|
BLAKE2b-256 | a6adebb0dd5073dd997f42dbea4a8bb59e21bbbcd716af9cd8b619352f131408 |