Skip to content

Commit 93f9c26

Browse files
authored
Merge pull request #3 from algorandfoundation/update-alogkit-utils
feat: update to algokit-utils and beaker to 1.0
2 parents 3a52a0a + 8775d1f commit 93f9c26

File tree

6 files changed

+29
-34
lines changed

6 files changed

+29
-34
lines changed

copier.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
_subdirectory: template_content
22

3-
# project_name should never get prompted, AlgoKit should always pass it by convention
4-
project_name:
5-
type: str
6-
help: Name for this project.
7-
placeholder: "algorand-app"
8-
93
# The following should never get prompted; algokit should always pass these values through by convention
104

115
algod_token:

poetry.lock

Lines changed: 12 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ readme = "README.md"
77

88
[tool.poetry.dependencies]
99
python = "^3.10"
10-
beaker-pyteal = "1.0.0b2"
11-
algokit-utils = "0.1.3"
10+
beaker-pyteal = "^1.0.0"
11+
algokit-utils = "^1.0.0"
1212
python-dotenv = "^1.0.0"
1313

1414
[tool.poetry.group.dev.dependencies]

template_content/playground/hello_world/build.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55

66
def build() -> Path:
7+
"""Build the beaker app, export it to disk, and return the Path to the app spec file"""
78
app_spec = helloworld.app.build()
89
output_dir = Path(__file__).parent / "artifacts"
9-
app_spec.export(output_dir)
1010
print(f"Dumping {app_spec.contract.name} to {output_dir}")
11+
app_spec.export(output_dir)
1112
return output_dir / "application.json"
1213

1314

template_content/playground/hello_world/demo.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@
66

77

88
def demo() -> None:
9+
# load Algorand environment variables from playground/.env
10+
# this should be pointing at a local sandbox,
911
dotenv.load_dotenv()
1012

13+
# build the app and get back the Path to app spec file
14+
app_spec_path = build()
15+
# Get sandbox algod client
1116
algod_client = algokit_utils.get_algod_client()
12-
13-
# build the app spec
14-
app_spec_json = build().read_text()
15-
app_spec = algokit_utils.ApplicationSpecification.from_json(app_spec_json)
16-
17+
# Get default account from sandbox, this will be used as the signer
18+
account = algokit_utils.get_sandbox_default_account(algod_client)
1719
# Create an Application client
1820
app_client = algokit_utils.ApplicationClient(
19-
# Get sandbox algod client
2021
algod_client=algod_client,
21-
# Pass instance of app to client
22-
app_spec=app_spec,
23-
# Get acct from sandbox and pass the signer
24-
signer=algokit_utils.get_sandbox_default_account(algod_client),
22+
app_spec=app_spec_path,
23+
signer=account,
2524
)
2625

2726
# Deploy the app on-chain
@@ -34,8 +33,8 @@ def demo() -> None:
3433
)
3534

3635
# Call the `hello` method
37-
call_response = app_client.call(helloworld.hello.method_spec(), {"name": "Beaker"})
38-
print(call_response.abi_result.return_value) # "Hello, Beaker"
36+
call_response = app_client.call(helloworld.hello, name="Beaker")
37+
print(call_response.return_value) # "Hello, Beaker"
3938

4039

4140
if __name__ == "__main__":

template_content/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ license = "MIT"
88

99
[tool.poetry.dependencies]
1010
python = "^3.10"
11-
beaker-pyteal = "1.0.0b2"
12-
algokit-utils = "0.1.3"
11+
beaker-pyteal = "^1.0.0"
12+
algokit-utils = "^1.0.0"
1313
python-dotenv = "^1.0.0"

0 commit comments

Comments
 (0)