beaker-pyteal-1.0.1b1
توضیحات
A Framework for building PyTeal Applications
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | beaker-pyteal-1.0.1b1 |
| نام | beaker-pyteal |
| نسخه کتابخانه | 1.0.1b1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Ben Guidarelli |
| ایمیل نویسنده | ben@algorand.com |
| آدرس صفحه اصلی | https://beaker.algo.xyz |
| آدرس اینترنتی | https://pypi.org/project/beaker-pyteal/ |
| مجوز | MIT |
Beaker
------
<img align="left" src="https://raw.githubusercontent.com/algorand-devrel/beaker/master/beaker.png" margin="10px" >
Beaker is a smart contract development framework for [PyTeal](https://github.com/algorand/pyteal).
## Hello, Beaker
```py
from pyteal import *
from beaker import *
hello_app = Application("HelloBeaker")
@hello_app.external
def hello(name: abi.String, *, output: abi.String) -> Expr:
# Set output to the result of `Hello, `+name
return output.set(Concat(Bytes("Hello, "), name.get()))
# Create an Application client
app_client = client.ApplicationClient(
# Get sandbox algod client
client=sandbox.get_algod_client(),
# Pass instance of app to client
app=hello_app,
# Get acct from sandbox and pass the signer
signer=sandbox.get_accounts().pop().signer,
)
# Deploy the app on-chain
app_id, app_addr, txid = app_client.create()
print(
f"""Deployed app in txid {txid}
App ID: {app_id}
Address: {app_addr}
"""
)
# Call the `hello` method
result = app_client.call(hello, name="Beaker")
print(result.return_value) # "Hello, Beaker"
```
## Install
Beaker requires Python >= 3.10
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`
# Dev Environment
Requires a local network running to compile and test contracts.
Install [AlgoKit](https://github.com/algorandfoundation/algokit-cli#install)
and start it
```sh
$ algokit localnet start
$ algokit localnet status
```
## Front End
See [Beaker TS](https://github.com/algorand-devrel/beaker-ts) to generate a front end client for a Beaker App.
## Testing
You can run tests from the root of the project using `pytest`
## Use
[Examples](/examples/)
[Docs](https://beaker.algo.xyz)
**Please report bugs and get any contracts audited**
We recommend that any production smart contracts be audited by a professional before deployment. Beaker has been thoroughly tested, but we cannot guarantee that it is entirely free of bugs.
نیازمندی
| مقدار | نام |
|---|---|
| >=1.0.0,<2.0.0 | algokit-utils |
| >=2.0.0 | py-algorand-sdk |
| >=0.23.0,<0.24.0 | pyteal |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10,<4.0 | Python |
نحوه نصب
نصب پکیج whl beaker-pyteal-1.0.1b1:
pip install beaker-pyteal-1.0.1b1.whl
نصب پکیج tar.gz beaker-pyteal-1.0.1b1:
pip install beaker-pyteal-1.0.1b1.tar.gz