From 6b2e8853dc7acb316a6745894b3f8de7882cfd0c Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Wed, 23 Oct 2024 00:01:12 +0800 Subject: [PATCH] chore: regen examples (#35) --- .../production_beaker_react/.algokit.toml | 9 - .../.algokit/.copier-answers.yml | 11 - .../create-devcontainer/copier.yaml | 4 - .../create-devcontainer/devcontainer.json | 19 - .../production_beaker_react/.editorconfig | 10 - .../production_beaker_react/.gitattributes | 1 - .../production-beaker-react-contracts-cd.yaml | 42 -- .../production-beaker-react-contracts-ci.yaml | 59 -- .../production-beaker-react-frontend-cd.yaml | 36 -- .../production-beaker-react-frontend-ci.yaml | 47 -- .../.github/workflows/release.yaml | 38 -- .../.github/workflows/validate.yaml | 14 - examples/production_beaker_react/.gitignore | 170 ----- .../.vscode/launch.json | 7 - .../.vscode/settings.json | 5 - examples/production_beaker_react/README.md | 55 -- .../production_beaker_react.code-workspace | 96 --- .../production_beaker_react/projects/.gitkeep | 0 .../.algokit.toml | 53 -- .../.algokit/.copier-answers.yml | 10 - .../generators/create_contract/copier.yaml | 10 - .../{{ contract_name }}/contract.py.j2 | 31 - .../{{ contract_name }}/deploy_config.py.j2 | 56 -- .../generators/create_env_file/copier.yaml | 49 -- ... %}.env.{{custom_network_name}}{% endif %} | 7 - ... if is_localnet %}.env.localnet{% endif %} | 7 - ...{% if is_mainnet %}.env.mainnet{% endif %} | 3 - ...{% if is_testnet %}.env.testnet{% endif %} | 3 - .../.editorconfig | 10 - .../.gitignore | 180 ------ ...ing-started-with-your-algokit-project.tour | 61 -- .../.vscode/extensions.json | 12 - .../.vscode/launch.json | 52 -- .../.vscode/settings.json | 49 -- .../.vscode/tasks.json | 79 --- .../README.md | 155 ----- .../poetry.toml | 2 - .../pyproject.toml | 51 -- .../smart_contracts/README.md | 9 - .../smart_contracts/__init__.py | 0 .../smart_contracts/__main__.py | 53 -- .../smart_contracts/_helpers/__init__.py | 0 .../smart_contracts/_helpers/build.py | 43 -- .../smart_contracts/_helpers/config.py | 65 -- .../smart_contracts/_helpers/deploy.py | 50 -- .../smart_contracts/hello_world/contract.py | 26 - .../hello_world/deploy_config.py | 47 -- .../tests/__init__.py | 0 .../tests/conftest.py | 26 - .../tests/hello_world_test.py | 50 -- .../.algokit.toml | 17 - .../.algokit/.copier-answers.yml | 9 - .../.editorconfig | 9 - .../.env.template | 67 -- .../.eslintrc | 27 - .../.gitignore | 38 -- .../production_beaker_react-frontend/.npmrc | 1 - .../.prettierignore | 12 - .../.prettierrc.cjs | 10 - .../.vscode/extensions.json | 14 - .../.vscode/launch.json | 68 -- .../.vscode/settings.json | 13 - .../.vscode/tasks.json | 15 - .../README.md | 124 ---- .../index.html | 15 - .../jest.config.ts | 20 - .../package.json | 78 --- .../playwright.config.ts | 73 --- .../postcss.config.cjs | 6 - .../public/index.html | 37 -- .../public/robots.txt | 3 - .../src/App.tsx | 57 -- .../src/Home.tsx | 76 --- .../src/assets/logo.svg | 1 - .../src/components/Account.tsx | 28 - .../src/components/AppCalls.tsx | 102 --- .../src/components/ConnectWallet.tsx | 86 --- .../src/components/ErrorBoundary.tsx | 46 -- .../src/components/Transact.tsx | 95 --- .../src/contracts/README.md | 14 - .../src/contracts/hello_world.ts | 605 ------------------ .../src/interfaces/network.ts | 26 - .../src/main.tsx | 13 - .../src/styles/main.css | 3 - .../src/utils/ellipseAddress.spec.tsx | 15 - .../src/utils/ellipseAddress.ts | 3 - .../src/utils/network/getAlgoClientConfigs.ts | 41 -- .../src/vite-env.d.ts | 24 - .../tailwind.config.js | 11 - .../tests/example.spec.ts | 38 -- .../tsconfig.json | 38 -- .../tsconfig.node.json | 9 - .../vite.config.ts | 7 - .../production-python-react-contracts-ci.yaml | 8 +- .../.algokit.toml | 3 +- .../.algokit/.copier-answers.yml | 2 +- .../.gitignore | 2 +- ...ing-started-with-your-algokit-project.tour | 2 +- .../README.md | 10 +- .../pyproject.toml | 6 +- .../smart_contracts/__main__.py | 22 +- .../smart_contracts/_helpers/build.py | 10 +- .../tests/hello_world_test.py | 7 +- .../.algokit/.copier-answers.yml | 2 +- .../src/components/Account.tsx | 12 +- .../src/contracts/HelloWorld.ts | 6 +- .../contracts/clients/CalculatorClient.ts | 2 +- .../.algokit/.copier-answers.yml | 2 +- .../src/components/Account.tsx | 12 +- .../src/contracts/Calculator.ts | 3 +- examples/starter_beaker_react/.algokit.toml | 9 - .../.algokit/.copier-answers.yml | 10 - .../create-devcontainer/copier.yaml | 4 - .../create-devcontainer/devcontainer.json | 19 - examples/starter_beaker_react/.editorconfig | 10 - examples/starter_beaker_react/.gitattributes | 1 - examples/starter_beaker_react/.gitignore | 170 ----- .../starter_beaker_react/.vscode/launch.json | 7 - .../.vscode/settings.json | 5 - examples/starter_beaker_react/README.md | 45 -- .../starter_beaker_react/projects/.gitkeep | 0 .../.algokit.toml | 42 -- .../.algokit/.copier-answers.yml | 10 - .../generators/create_contract/copier.yaml | 10 - .../{{ contract_name }}/contract.py.j2 | 31 - .../{{ contract_name }}/deploy-config.ts.j2 | 59 -- .../generators/create_env_file/copier.yaml | 49 -- ... %}.env.{{custom_network_name}}{% endif %} | 7 - ... if is_localnet %}.env.localnet{% endif %} | 7 - ...{% if is_mainnet %}.env.mainnet{% endif %} | 3 - ...{% if is_testnet %}.env.testnet{% endif %} | 3 - .../.editorconfig | 10 - .../starter_beaker_react-contracts/.gitignore | 180 ------ .../starter_beaker_react-contracts/.npmrc | 1 - .../.prettierignore | 12 - .../.prettierrc.js | 10 - ...ing-started-with-your-algokit-project.tour | 61 -- .../.vscode/extensions.json | 10 - .../.vscode/launch.json | 57 -- .../.vscode/settings.json | 33 - .../.vscode/tasks.json | 79 --- .../starter_beaker_react-contracts/README.md | 100 --- .../package.json | 26 - .../poetry.toml | 2 - .../pyproject.toml | 20 - .../smart_contracts/README.md | 10 - .../smart_contracts/__init__.py | 0 .../smart_contracts/__main__.py | 34 - .../smart_contracts/_helpers/__init__.py | 0 .../smart_contracts/_helpers/build.py | 43 -- .../smart_contracts/_helpers/config.py | 65 -- .../smart_contracts/hello_world/contract.py | 9 - .../hello_world/deploy-config.ts | 49 -- .../smart_contracts/index.ts | 47 -- .../tsconfig.json | 25 - .../.algokit.toml | 11 - .../.algokit/.copier-answers.yml | 8 - .../.env.template | 67 -- .../starter_beaker_react-frontend/.gitignore | 38 -- .../starter_beaker_react-frontend/.npmrc | 1 - .../.vscode/extensions.json | 7 - .../.vscode/launch.json | 68 -- .../.vscode/settings.json | 6 - .../.vscode/tasks.json | 15 - .../starter_beaker_react-frontend/README.md | 76 --- .../starter_beaker_react-frontend/index.html | 15 - .../package.json | 61 -- .../public/index.html | 37 -- .../public/robots.txt | 3 - .../starter_beaker_react-frontend/src/App.tsx | 57 -- .../src/Home.tsx | 76 --- .../src/assets/logo.svg | 1 - .../src/components/Account.tsx | 28 - .../src/components/AppCalls.tsx | 99 --- .../src/components/ConnectWallet.tsx | 86 --- .../src/components/ErrorBoundary.tsx | 46 -- .../src/components/Transact.tsx | 95 --- .../src/contracts/README.md | 14 - .../src/contracts/hello_world.ts | 449 ------------- .../src/interfaces/network.ts | 26 - .../src/main.tsx | 13 - .../src/styles/App.css | 126 ---- .../src/utils/ellipseAddress.ts | 3 - .../src/utils/network/getAlgoClientConfigs.ts | 41 -- .../src/vite-env.d.ts | 24 - .../tsconfig.json | 38 -- .../tsconfig.node.json | 9 - .../vite.config.ts | 7 - .../starter_beaker_react.code-workspace | 96 --- .../.algokit/.copier-answers.yml | 2 +- .../{{ contract_name }}/deploy-config.ts.j2 | 41 +- .../starter_python_react-contracts/.gitignore | 2 +- ...ing-started-with-your-algokit-project.tour | 2 +- .../starter_python_react-contracts/README.md | 6 +- .../pyproject.toml | 4 +- .../smart_contracts/__main__.py | 14 +- .../smart_contracts/_helpers/build.py | 10 +- .../hello_world/deploy-config.ts | 41 +- .../smart_contracts/index.ts | 31 +- .../.algokit/.copier-answers.yml | 2 +- .../src/components/Account.tsx | 12 +- .../src/contracts/HelloWorld.ts | 6 +- .../contracts/clients/CalculatorClient.ts | 2 +- .../.algokit/.copier-answers.yml | 2 +- .../src/components/Account.tsx | 12 +- .../src/contracts/Calculator.ts | 3 +- tests/test_templates.py | 4 +- 207 files changed, 152 insertions(+), 7152 deletions(-) delete mode 100644 examples/production_beaker_react/.algokit.toml delete mode 100644 examples/production_beaker_react/.algokit/.copier-answers.yml delete mode 100644 examples/production_beaker_react/.algokit/generators/create-devcontainer/copier.yaml delete mode 100644 examples/production_beaker_react/.algokit/generators/create-devcontainer/devcontainer.json delete mode 100644 examples/production_beaker_react/.editorconfig delete mode 100644 examples/production_beaker_react/.gitattributes delete mode 100644 examples/production_beaker_react/.github/workflows/production-beaker-react-contracts-cd.yaml delete mode 100644 examples/production_beaker_react/.github/workflows/production-beaker-react-contracts-ci.yaml delete mode 100644 examples/production_beaker_react/.github/workflows/production-beaker-react-frontend-cd.yaml delete mode 100644 examples/production_beaker_react/.github/workflows/production-beaker-react-frontend-ci.yaml delete mode 100644 examples/production_beaker_react/.github/workflows/release.yaml delete mode 100644 examples/production_beaker_react/.github/workflows/validate.yaml delete mode 100644 examples/production_beaker_react/.gitignore delete mode 100644 examples/production_beaker_react/.vscode/launch.json delete mode 100644 examples/production_beaker_react/.vscode/settings.json delete mode 100644 examples/production_beaker_react/README.md delete mode 100644 examples/production_beaker_react/production_beaker_react.code-workspace delete mode 100644 examples/production_beaker_react/projects/.gitkeep delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit.toml delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/.copier-answers.yml delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/copier.yaml delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy_config.py.j2 delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/copier.yaml delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_customnet %}.env.{{custom_network_name}}{% endif %} delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_localnet %}.env.localnet{% endif %} delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_mainnet %}.env.mainnet{% endif %} delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_testnet %}.env.testnet{% endif %} delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.editorconfig delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.gitignore delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.tours/getting-started-with-your-algokit-project.tour delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/extensions.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/launch.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/settings.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/tasks.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/README.md delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/poetry.toml delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/pyproject.toml delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/README.md delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/__init__.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/__main__.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/__init__.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/build.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/config.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/deploy.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/hello_world/contract.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/hello_world/deploy_config.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/tests/__init__.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/tests/conftest.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-contracts/tests/hello_world_test.py delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.algokit.toml delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.algokit/.copier-answers.yml delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.editorconfig delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.env.template delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.eslintrc delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.gitignore delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.npmrc delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.prettierignore delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.prettierrc.cjs delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/extensions.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/launch.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/settings.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/tasks.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/README.md delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/index.html delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/jest.config.ts delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/package.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/playwright.config.ts delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/postcss.config.cjs delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/public/index.html delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/public/robots.txt delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/App.tsx delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/Home.tsx delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/assets/logo.svg delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/Account.tsx delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/AppCalls.tsx delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/ConnectWallet.tsx delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/ErrorBoundary.tsx delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/Transact.tsx delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/contracts/README.md delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/contracts/hello_world.ts delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/interfaces/network.ts delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/main.tsx delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/styles/main.css delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/ellipseAddress.spec.tsx delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/ellipseAddress.ts delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/network/getAlgoClientConfigs.ts delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/src/vite-env.d.ts delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/tailwind.config.js delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/tests/example.spec.ts delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/tsconfig.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/tsconfig.node.json delete mode 100644 examples/production_beaker_react/projects/production_beaker_react-frontend/vite.config.ts delete mode 100644 examples/starter_beaker_react/.algokit.toml delete mode 100644 examples/starter_beaker_react/.algokit/.copier-answers.yml delete mode 100644 examples/starter_beaker_react/.algokit/generators/create-devcontainer/copier.yaml delete mode 100644 examples/starter_beaker_react/.algokit/generators/create-devcontainer/devcontainer.json delete mode 100644 examples/starter_beaker_react/.editorconfig delete mode 100644 examples/starter_beaker_react/.gitattributes delete mode 100644 examples/starter_beaker_react/.gitignore delete mode 100644 examples/starter_beaker_react/.vscode/launch.json delete mode 100644 examples/starter_beaker_react/.vscode/settings.json delete mode 100644 examples/starter_beaker_react/README.md delete mode 100644 examples/starter_beaker_react/projects/.gitkeep delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit.toml delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/.copier-answers.yml delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/copier.yaml delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/copier.yaml delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_customnet %}.env.{{custom_network_name}}{% endif %} delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_localnet %}.env.localnet{% endif %} delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_mainnet %}.env.mainnet{% endif %} delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_testnet %}.env.testnet{% endif %} delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.editorconfig delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.gitignore delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.npmrc delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.prettierignore delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.prettierrc.js delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.tours/getting-started-with-your-algokit-project.tour delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/extensions.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/launch.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/settings.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/tasks.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/README.md delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/package.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/poetry.toml delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/pyproject.toml delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/README.md delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/__init__.py delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/__main__.py delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/__init__.py delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/build.py delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/config.py delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/hello_world/contract.py delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/hello_world/deploy-config.ts delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/index.ts delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-contracts/tsconfig.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/.algokit.toml delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/.algokit/.copier-answers.yml delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/.env.template delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/.gitignore delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/.npmrc delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/extensions.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/launch.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/settings.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/tasks.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/README.md delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/index.html delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/package.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/public/index.html delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/public/robots.txt delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/App.tsx delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/Home.tsx delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/assets/logo.svg delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/Account.tsx delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/AppCalls.tsx delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/ConnectWallet.tsx delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/ErrorBoundary.tsx delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/Transact.tsx delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/contracts/README.md delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/contracts/hello_world.ts delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/interfaces/network.ts delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/main.tsx delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/styles/App.css delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/utils/ellipseAddress.ts delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/utils/network/getAlgoClientConfigs.ts delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/vite-env.d.ts delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/tsconfig.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/tsconfig.node.json delete mode 100644 examples/starter_beaker_react/projects/starter_beaker_react-frontend/vite.config.ts delete mode 100644 examples/starter_beaker_react/starter_beaker_react.code-workspace diff --git a/examples/production_beaker_react/.algokit.toml b/examples/production_beaker_react/.algokit.toml deleted file mode 100644 index 34f7638..0000000 --- a/examples/production_beaker_react/.algokit.toml +++ /dev/null @@ -1,9 +0,0 @@ -[algokit] -min_version = "v2.0.0" - -[project] -type = 'workspace' -projects_root_path = 'projects' - -[project.run] -build = ['production_beaker_react-contracts', 'production_beaker_react-frontend'] diff --git a/examples/production_beaker_react/.algokit/.copier-answers.yml b/examples/production_beaker_react/.algokit/.copier-answers.yml deleted file mode 100644 index 33579f8..0000000 --- a/examples/production_beaker_react/.algokit/.copier-answers.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: -_src_path: -author_email: None -author_name: None -cloud_provider: netlify -contract_name: hello_world -deployment_language: python -preset_name: production -project_name: production_beaker_react - diff --git a/examples/production_beaker_react/.algokit/generators/create-devcontainer/copier.yaml b/examples/production_beaker_react/.algokit/generators/create-devcontainer/copier.yaml deleted file mode 100644 index e98f334..0000000 --- a/examples/production_beaker_react/.algokit/generators/create-devcontainer/copier.yaml +++ /dev/null @@ -1,4 +0,0 @@ -_tasks: - - "echo '==== Successfully generated new .devcontainer.json file 🚀 ===='" - -_templates_suffix: ".j2" diff --git a/examples/production_beaker_react/.algokit/generators/create-devcontainer/devcontainer.json b/examples/production_beaker_react/.algokit/generators/create-devcontainer/devcontainer.json deleted file mode 100644 index 6452c65..0000000 --- a/examples/production_beaker_react/.algokit/generators/create-devcontainer/devcontainer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "forwardPorts": [4001, 4002, 8980, 5173], - "portsAttributes": { - "4001": { - "label": "algod" - }, - "4002": { - "label": "kmd" - }, - "8980": { - "label": "indexer" - }, - "5173": { - "label": "vite" - } - }, - "postCreateCommand": "mkdir -p ~/.config/algokit && pipx install algokit && sudo chown -R codespace:codespace ~/.config/algokit", - "postStartCommand": "for i in {1..5}; do algokit localnet status > /dev/null 2>&1 && break || sleep 30; algokit localnet reset; done" -} diff --git a/examples/production_beaker_react/.editorconfig b/examples/production_beaker_react/.editorconfig deleted file mode 100644 index 5e550a1..0000000 --- a/examples/production_beaker_react/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -[*] -charset = utf-8 -insert_final_newline = true -end_of_line = lf -indent_style = space -indent_size = 2 -tab_width = 2 -max_line_length = 140 -trim_trailing_whitespace = true -single_quote = true diff --git a/examples/production_beaker_react/.gitattributes b/examples/production_beaker_react/.gitattributes deleted file mode 100644 index 6313b56..0000000 --- a/examples/production_beaker_react/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto eol=lf diff --git a/examples/production_beaker_react/.github/workflows/production-beaker-react-contracts-cd.yaml b/examples/production_beaker_react/.github/workflows/production-beaker-react-contracts-cd.yaml deleted file mode 100644 index e005a47..0000000 --- a/examples/production_beaker_react/.github/workflows/production-beaker-react-contracts-cd.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Release production_beaker_react-contracts - -on: - workflow_call: - -jobs: - deploy-testnet: - runs-on: "ubuntu-latest" - - environment: contract-testnet - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Install poetry - run: pipx install poetry - - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: "poetry" - - - name: Install algokit - run: pipx install algokit - - - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name 'production_beaker_react-contracts' - - - name: Configure git - shell: bash - run: | - # set git user and email as test invoke git - git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - - - name: Deploy to testnet - run: algokit deploy testnet --project-name 'production_beaker_react-contracts' - env: - # This is the account that becomes the creator of the contract - DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }} - # The dispenser account is used to ensure the deployer account is funded - DISPENSER_MNEMONIC: ${{ secrets.DISPENSER_MNEMONIC }} diff --git a/examples/production_beaker_react/.github/workflows/production-beaker-react-contracts-ci.yaml b/examples/production_beaker_react/.github/workflows/production-beaker-react-contracts-ci.yaml deleted file mode 100644 index 5e8fc74..0000000 --- a/examples/production_beaker_react/.github/workflows/production-beaker-react-contracts-ci.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: Validate production_beaker_react-contracts - -on: - workflow_call: - -jobs: - validate: - runs-on: "ubuntu-latest" - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Install poetry - run: pipx install poetry - - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: "poetry" - - - name: Install algokit - run: pipx install algokit - - - name: Start LocalNet - run: algokit localnet start - - - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name 'production_beaker_react-contracts' - - - name: Configure git - shell: bash - run: | - # set git user and email as test invoke git - git config --global user.email "actions@github.com" && git config --global user.name "github-actions" - - - name: Audit python dependencies - run: algokit project run audit --project-name 'production_beaker_react-contracts' - - - name: Lint and format python dependencies - run: algokit project run lint --project-name 'production_beaker_react-contracts' - - - name: Run tests - shell: bash - run: | - set -o pipefail - algokit project run test --project-name 'production_beaker_react-contracts' - - - name: Build smart contracts - run: algokit project run build --project-name 'production_beaker_react-contracts' - - - name: Scan TEAL files for issues - run: algokit project run audit-teal --project-name 'production_beaker_react-contracts' - - - name: Check output stability of the smart contracts - run: algokit project run ci-teal-diff --project-name 'production_beaker_react-contracts' - - - name: Run deployer against LocalNet - run: algokit project deploy localnet --project-name 'production_beaker_react-contracts' diff --git a/examples/production_beaker_react/.github/workflows/production-beaker-react-frontend-cd.yaml b/examples/production_beaker_react/.github/workflows/production-beaker-react-frontend-cd.yaml deleted file mode 100644 index ff718e2..0000000 --- a/examples/production_beaker_react/.github/workflows/production-beaker-react-frontend-cd.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Release production_beaker_react-frontend - -on: - workflow_call: -permissions: - contents: read - packages: read - -jobs: - - deploy: - runs-on: ubuntu-latest - name: Deploy to Netlify - environment: frontend-prod - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Install algokit - run: pipx install algokit - - - name: Bootstrap dependencies - run: algokit project bootstrap all --project-name 'production_beaker_react-frontend' - - - name: Publish to Netlify - env: - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - run: algokit project run ci-deploy-netlify - \ No newline at end of file diff --git a/examples/production_beaker_react/.github/workflows/production-beaker-react-frontend-ci.yaml b/examples/production_beaker_react/.github/workflows/production-beaker-react-frontend-ci.yaml deleted file mode 100644 index 0781a13..0000000 --- a/examples/production_beaker_react/.github/workflows/production-beaker-react-frontend-ci.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: Validate production_beaker_react-frontend - -on: - - workflow_call: - - -jobs: - validate: - runs-on: 'ubuntu-latest' - steps: - - name: Check out repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Install poetry - run: pipx install poetry - - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: "3.12" - cache: "poetry" - - - name: Install algokit - run: pipx install algokit - - - name: Install dependencies - run: algokit project bootstrap all --project-name 'production_beaker_react-frontend' - - - - name: Run linters - run: algokit project run lint --project-name 'production_beaker_react-frontend' - - - - name: Run unit tests - run: algokit project run test --project-name 'production_beaker_react-frontend' - - - - name: Build - run: algokit project run build --project-name 'production_beaker_react-frontend' diff --git a/examples/production_beaker_react/.github/workflows/release.yaml b/examples/production_beaker_react/.github/workflows/release.yaml deleted file mode 100644 index c51a0c1..0000000 --- a/examples/production_beaker_react/.github/workflows/release.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Release - -on: - push: - branches: - - main - paths-ignore: - - 'docs/**' - - '**.md' - - '.vscode/**' - - '.idea/**' - -permissions: - contents: read - packages: read - -jobs: - production_beaker_react-contracts-validate: - name: Run production_beaker_react-contracts release - secrets: inherit - uses: ./.github/workflows/production_beaker_react-contracts-ci.yaml - - production_beaker_react-contracts-release: - name: Run production_beaker_react-contracts release - secrets: inherit - uses: ./.github/workflows/production_beaker_react-contracts-cd.yaml - needs: production_beaker_react-contracts-validate - - production_beaker_react-frontend-validate: - name: Run production_beaker_react-frontend release - secrets: inherit - uses: ./.github/workflows/production_beaker_react-frontend-ci.yaml - - production_beaker_react-frontend-release: - name: Run production_beaker_react-frontend release - secrets: inherit - uses: ./.github/workflows/production_beaker_react-frontend-cd.yaml - needs: production_beaker_react-frontend-validate diff --git a/examples/production_beaker_react/.github/workflows/validate.yaml b/examples/production_beaker_react/.github/workflows/validate.yaml deleted file mode 100644 index c15c6c0..0000000 --- a/examples/production_beaker_react/.github/workflows/validate.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: Pull Request validation - -on: [pull_request] - - -jobs: - production_beaker_react-contracts-ci: - name: Run production_beaker_react-contracts validation - uses: ./.github/workflows/production_beaker_react-contracts-ci.yaml - - production_beaker_react-frontend-ci: - name: Run production_beaker_react-frontend validation - uses: ./.github/workflows/production_beaker_react-frontend-ci.yaml - diff --git a/examples/production_beaker_react/.gitignore b/examples/production_beaker_react/.gitignore deleted file mode 100644 index 4105eb2..0000000 --- a/examples/production_beaker_react/.gitignore +++ /dev/null @@ -1,170 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide -.pdm.toml - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Ruff (linter) -.ruff_cache/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -.idea/ -!.idea/runConfigurations - -# macOS -.DS_Store - -# Received approval test files -*.received.* - -# NPM -node_modules - diff --git a/examples/production_beaker_react/.vscode/launch.json b/examples/production_beaker_react/.vscode/launch.json deleted file mode 100644 index 1b8aa88..0000000 --- a/examples/production_beaker_react/.vscode/launch.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [] -} diff --git a/examples/production_beaker_react/.vscode/settings.json b/examples/production_beaker_react/.vscode/settings.json deleted file mode 100644 index 033fd10..0000000 --- a/examples/production_beaker_react/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - // Disabled due to matangover.mypy extension not supporting monorepos - // To be addressed as part of https://github.com/matangover/mypy-vscode/issues/82 - "mypy.enabled": false -} diff --git a/examples/production_beaker_react/README.md b/examples/production_beaker_react/README.md deleted file mode 100644 index 18dc1dc..0000000 --- a/examples/production_beaker_react/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# production_beaker_react - -This starter full stack project has been generated using AlgoKit. See below for default getting started instructions. - -## Setup - -### Initial setup -1. Clone this repository to your local machine. -2. Ensure [Docker](https://www.docker.com/) is installed and operational. Then, install `AlgoKit` following this [guide](https://github.com/algorandfoundation/algokit-cli#install). -3. Run `algokit project bootstrap all` in the project directory. This command sets up your environment by installing necessary dependencies, setting up a Python virtual environment, and preparing your `.env` file. -4. In the case of a smart contract project, execute `algokit generate env-file -a target_network localnet` from the `production_beaker_react-contracts` directory to create a `.env.localnet` file with default configuration for `localnet`. -5. To build your project, execute `algokit project run build`. This compiles your project and prepares it for running. -6. For project-specific instructions, refer to the READMEs of the child projects: - - Smart Contracts: [production_beaker_react-contracts](projects/production_beaker_react-contracts/README.md) - - Frontend Application: [production_beaker_react-frontend](projects/production_beaker_react-frontend/README.md) - -> This project is structured as a monorepo, refer to the [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md) to learn more about custom command orchestration via `algokit project run`. - -### Subsequently - -1. If you update to the latest source code and there are new dependencies, you will need to run `algokit project bootstrap all` again. -2. Follow step 3 above. - -### Continuous Integration / Continuous Deployment (CI/CD) - -This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [`.github/workflows`](./.github/workflows) folder. You can configure these actions to suit your project's needs, including CI checks, audits, linting, type checking, testing, and deployments to TestNet. - -For pushes to `main` branch, after the above checks pass, the following deployment actions are performed: - - The smart contract(s) are deployed to TestNet using [AlgoNode](https://algonode.io). - - The frontend application is deployed to a provider of your choice (Netlify, Vercel, etc.). See [frontend README](frontend/README.md) for more information. - -> Please note deployment of smart contracts is done via `algokit deploy` command which can be invoked both via CI as seen on this project, or locally. For more information on how to use `algokit deploy` please see [AlgoKit documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/deploy.md). - -## Tools - -This project makes use of Python and React to build Algorand smart contracts and to provide a base project configuration to develop frontends for your Algorand dApps and interactions with smart contracts. The following tools are in use: - -- Algorand, AlgoKit, and AlgoKit Utils -- Python dependencies including Poetry, Black, Ruff or Flake8, mypy, pytest, and pip-audit -- React and related dependencies including AlgoKit Utils, Tailwind CSS, daisyUI, use-wallet, npm, jest, playwright, Prettier, ESLint, and Github Actions workflows for build validation - -### VS Code - -It has also been configured to have a productive dev experience out of the box in [VS Code](https://code.visualstudio.com/), see the [backend .vscode](./backend/.vscode) and [frontend .vscode](./frontend/.vscode) folders for more details. - -## Integrating with smart contracts and application clients - -Refer to the [production_beaker_react-contracts](projects/production_beaker_react-contracts/README.md) folder for overview of working with smart contracts, [projects/production_beaker_react-frontend](projects/production_beaker_react-frontend/README.md) for overview of the React project and the [projects/production_beaker_react-frontend/contracts](projects/production_beaker_react-frontend/src/contracts/README.md) folder for README on adding new smart contracts from backend as application clients on your frontend. The templates provided in these folders will help you get started. -When you compile and generate smart contract artifacts, your frontend component will automatically generate typescript application clients from smart contract artifacts and move them to `frontend/src/contracts` folder, see [`generate:app-clients` in package.json](projects/production_beaker_react-frontend/package.json). Afterwards, you are free to import and use them in your frontend application. - -The frontend starter also provides an example of interactions with your HelloWorldClient in [`AppCalls.tsx`](projects/production_beaker_react-frontend/src/components/AppCalls.tsx) component by default. - -## Next Steps - -You can take this project and customize it to build your own decentralized applications on Algorand. Make sure to understand how to use AlgoKit and how to write smart contracts for Algorand before you start. diff --git a/examples/production_beaker_react/production_beaker_react.code-workspace b/examples/production_beaker_react/production_beaker_react.code-workspace deleted file mode 100644 index a55781d..0000000 --- a/examples/production_beaker_react/production_beaker_react.code-workspace +++ /dev/null @@ -1,96 +0,0 @@ -{ - "folders": [ - { - "path": "./", - "name": "ROOT" - }, - { - "path": "./projects/production_beaker_react-contracts" - }, - { - "path": "./projects/production_beaker_react-frontend" - }, - { - "path": "." - }, - { - "path": "projects/production_beaker_react-frontend" - }, - { - "path": "projects/production_beaker_react-contracts" - }, - { - "path": "." - } - ], - "settings": { - "files.exclude": { - "projects/": true - }, - "jest.disabledWorkspaceFolders": [ - "ROOT", - "projects" - ], - "dotenv.enableAutocloaking": false - }, - "extensions": { - "recommendations": [ - "joshx.workspace-terminals" - ] - }, - "tasks": { - "version": "2.0.0", - "tasks": [ - { - "label": "Build artifacts (+ LocalNet)", - "command": "algokit", - "args": [ - "project", - "run", - "build" - ], - "options": { - "cwd": "${workspaceFolder}" - }, - "dependsOn": "Start AlgoKit LocalNet", - "problemMatcher": [] - }, - { - "label": "Start AlgoKit LocalNet", - "command": "algokit", - "args": [ - "localnet", - "start" - ], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - } - ] - }, - "launch": { - "configurations": [], - "compounds": [ - { - "preLaunchTask": "Build artifacts (+ LocalNet)", - "name": "Run Frontend (+ LocalNet and Smart Contract)", - "configurations": [ - { - "name": "Deploy contracts", - "folder": "production_beaker_react-contracts" - }, - { - "name": "Run dApp", - "folder": "production_beaker_react-frontend" - } - ], - "presentation": { - "hidden": false, - "group": "0. Run workspace" - } - } - ] - } -} \ No newline at end of file diff --git a/examples/production_beaker_react/projects/.gitkeep b/examples/production_beaker_react/projects/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit.toml b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit.toml deleted file mode 100644 index 9b72684..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit.toml +++ /dev/null @@ -1,53 +0,0 @@ -[algokit] -min_version = "v2.0.0" - -[generate.smart-contract] -description = "Adds new smart contract to existing project" -path = ".algokit/generators/create_contract" - -[generate.env-file] -description = "Generate a new generic or Algorand network specific .env file" -path = ".algokit/generators/create_env_file" - -[project] -type = 'contract' -name = 'production_beaker_react-contracts' -artifacts = 'smart_contracts/artifacts' - -[project.deploy] -command = "poetry run python -m smart_contracts deploy" -environment_secrets = [ - "DEPLOYER_MNEMONIC", - "DISPENSER_MNEMONIC", -] - -[project.deploy.localnet] -environment_secrets = [] - -[project.run] -# Commands intented for use locally and in CI -build = { commands = [ - 'poetry run python -m smart_contracts build', -], description = 'Build all smart contracts in the project' } -test = { commands = [ - 'poetry run pytest', -], description = 'Run smart contract tests' } -audit = { commands = [ - 'poetry export --without=dev -o requirements.txt', - 'poetry run pip-audit -r requirements.txt', -], description = 'Audit with pip-audit' } -lint = { commands = [ - 'poetry run black --check .', - 'poetry run ruff .', - 'poetry run mypy', -], description = 'Perform linting' } -audit-teal = { commands = [ - # 🚨 IMPORTANT 🚨: For strict TEAL validation, remove --exclude statements. The default starter contract is not for production. Ensure thorough testing and adherence to best practices in smart contract development. This is not a replacement for a professional audit. - 'algokit task analyze smart_contracts/artifacts --recursive --force --exclude rekey-to --exclude is-updatable --exclude missing-fee-check --exclude is-deletable --exclude can-close-asset --exclude can-close-account --exclude unprotected-deletable --exclude unprotected-updatable', -], description = 'Audit TEAL files' } - -# Commands indented for CI only, prefixed with `ci-` by convention -ci-teal-diff = { commands = [ - 'git add -N ./smart_contracts/artifacts', - 'git diff --exit-code --minimal ./smart_contracts/artifacts', -], description = 'Check TEAL files for differences' } diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/.copier-answers.yml b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/.copier-answers.yml deleted file mode 100644 index c721c2b..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/.copier-answers.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 2.1.4 -_src_path: gh:algorandfoundation/algokit-beaker-default-template -author_email: None -author_name: None -contract_name: hello_world -deployment_language: python -preset_name: production -project_name: production_beaker_react-contracts - diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/copier.yaml b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/copier.yaml deleted file mode 100644 index 73805de..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/copier.yaml +++ /dev/null @@ -1,10 +0,0 @@ -_tasks: - - "echo '==== Successfully initialized new smart contract 🚀 ===='" - -contract_name: - type: str - help: Name of your new contract. - placeholder: "my-new-contract" - default: "my-new-contract" - -_templates_suffix: ".j2" diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 deleted file mode 100644 index 8240dd0..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 +++ /dev/null @@ -1,31 +0,0 @@ -import beaker -import pyteal as pt -{%- if preset_name == 'starter' %} - -app = beaker.Application("{{ contract_name }}") -{%- elif preset_name == 'production' %} -from algokit_utils import DELETABLE_TEMPLATE_NAME, UPDATABLE_TEMPLATE_NAME - -app = beaker.Application("{{ contract_name }}") - - -@app.update(authorize=beaker.Authorize.only_creator(), bare=True) -def update() -> pt.Expr: - return pt.Assert( - pt.Tmpl.Int(UPDATABLE_TEMPLATE_NAME), - comment="Check app is updatable", - ) - - -@app.delete(authorize=beaker.Authorize.only_creator(), bare=True) -def delete() -> pt.Expr: - return pt.Assert( - pt.Tmpl.Int(DELETABLE_TEMPLATE_NAME), - comment="Check app is deletable", - ) -{%- endif %} - - -@app.external -def hello(name: pt.abi.String, *, output: pt.abi.String) -> pt.Expr: - return output.set(pt.Concat(pt.Bytes("Hello, "), name.get())) diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy_config.py.j2 b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy_config.py.j2 deleted file mode 100644 index 76a5a6c..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy_config.py.j2 +++ /dev/null @@ -1,56 +0,0 @@ -import logging - -import algokit_utils -from algosdk.v2client.algod import AlgodClient -from algosdk.v2client.indexer import IndexerClient - -logger = logging.getLogger(__name__) - - -# define deployment behaviour based on supplied app spec -def deploy( - algod_client: AlgodClient, - indexer_client: IndexerClient, - app_spec: algokit_utils.ApplicationSpecification, - deployer: algokit_utils.Account, -) -> None: - from smart_contracts.artifacts.{{ contract_name }}.client import ( - {{ contract_name.split('_')|map('capitalize')|join }}Client, - ) - - app_client = {{ contract_name.split('_')|map('capitalize')|join }}Client( - algod_client, - creator=deployer, - indexer_client=indexer_client, - ) - - - {%- if preset_name == 'starter' %} - app_client.deploy( - on_schema_break=algokit_utils.OnSchemaBreak.AppendApp, - on_update=algokit_utils.OnUpdate.AppendApp, - ) - {%- elif preset_name == 'production' %} - is_mainnet = algokit_utils.is_mainnet(algod_client) - app_client.deploy( - on_schema_break=( - algokit_utils.OnSchemaBreak.AppendApp - if is_mainnet - else algokit_utils.OnSchemaBreak.ReplaceApp - ), - on_update=( - algokit_utils.OnUpdate.AppendApp - if is_mainnet - else algokit_utils.OnUpdate.UpdateApp - ), - allow_delete=not is_mainnet, - allow_update=not is_mainnet, - ) - {%- endif %} - - name = "world" - response = app_client.hello(name=name) - logger.info( - f"Called hello on {app_spec.contract.name} ({app_client.app_id}) " - f"with name={name}, received: {response.return_value}" - ) diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/copier.yaml b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/copier.yaml deleted file mode 100644 index afa2cac..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/copier.yaml +++ /dev/null @@ -1,49 +0,0 @@ -_tasks: - - "echo '==== Successfully generated new .env file 🚀 ===='" - -target_network: - type: str - help: Name of your target network. - choices: - - mainnet - - testnet - - localnet - - custom - default: "localnet" - when: "{{ not use_generic_env }}" - -custom_network_name: - type: str - help: Name of your custom Algorand network. - placeholder: "custom" - when: "{{ not use_generic_env and target_network == 'custom' }}" - -is_localnet: - type: bool - help: Whether to deploy on localnet. - placeholder: "true" - default: "{{ target_network == 'localnet' and not use_generic_env }}" - when: 'false' - -is_testnet: - type: bool - help: Whether to deploy on testnet. - placeholder: "true" - default: "{{ target_network == 'testnet' and not use_generic_env }}" - when: 'false' - -is_mainnet: - type: bool - help: Whether to deploy on mainnet. - placeholder: "true" - default: "{{ target_network == 'mainnet' and not use_generic_env }}" - when: 'false' - -is_customnet: - type: bool - help: Whether to deploy on custom network. - placeholder: "true" - default: "{{ target_network == 'custom' and not use_generic_env }}" - when: 'false' - -_templates_suffix: ".j2" diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_customnet %}.env.{{custom_network_name}}{% endif %} b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_customnet %}.env.{{custom_network_name}}{% endif %} deleted file mode 100644 index cfc9f21..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_customnet %}.env.{{custom_network_name}}{% endif %} +++ /dev/null @@ -1,7 +0,0 @@ -# this file contains algorand network settings for interacting with testnet via algonode -ALGOD_TOKEN={YOUR_ALGOD_TOKEN} -ALGOD_SERVER={YOUR_ALGOD_SERVER_URL} -ALGOD_PORT={YOUR_ALGOD_PORT} -INDEXER_TOKEN={YOUR_INDEXER_TOKEN} -INDEXER_SERVER={YOUR_INDEXER_SERVER_URL} -INDEXER_PORT={YOUR_INDEXER_PORT} diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_localnet %}.env.localnet{% endif %} b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_localnet %}.env.localnet{% endif %} deleted file mode 100644 index fcbf442..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_localnet %}.env.localnet{% endif %} +++ /dev/null @@ -1,7 +0,0 @@ -# this file should contain environment variables specific to algokit localnet -ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -ALGOD_SERVER=http://localhost -ALGOD_PORT=4001 -INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -INDEXER_SERVER=http://localhost -INDEXER_PORT=8980 diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_mainnet %}.env.mainnet{% endif %} b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_mainnet %}.env.mainnet{% endif %} deleted file mode 100644 index bb9a787..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_mainnet %}.env.mainnet{% endif %} +++ /dev/null @@ -1,3 +0,0 @@ -# this file contains algorand network settings for interacting with testnet via algonode -ALGOD_SERVER=https://mainnet-api.algonode.cloud -INDEXER_SERVER=https://mainnet-idx.algonode.cloud diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_testnet %}.env.testnet{% endif %} b/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_testnet %}.env.testnet{% endif %} deleted file mode 100644 index eeea43d..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_testnet %}.env.testnet{% endif %} +++ /dev/null @@ -1,3 +0,0 @@ -# this file contains algorand network settings for interacting with testnet via algonode -ALGOD_SERVER=https://testnet-api.algonode.cloud -INDEXER_SERVER=https://testnet-idx.algonode.cloud diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.editorconfig b/examples/production_beaker_react/projects/production_beaker_react-contracts/.editorconfig deleted file mode 100644 index e2fda34..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -root=true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true - -[*.py] -indent_size = 4 diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.gitignore b/examples/production_beaker_react/projects/production_beaker_react-contracts/.gitignore deleted file mode 100644 index e5f0b9e..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.gitignore +++ /dev/null @@ -1,180 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ -coverage/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide -.pdm.toml - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -.env.* -!.env.*.template -!.env.template -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Ruff (linter) -.ruff_cache/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -.idea -!.idea/ -.idea/* -!.idea/runConfigurations/ - -# macOS -.DS_Store - -# Received approval test files -*.received.* - -# NPM -node_modules - -# AlgoKit -debug_traces/ - -.algokit/static-analysis/tealer/ diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.tours/getting-started-with-your-algokit-project.tour b/examples/production_beaker_react/projects/production_beaker_react-contracts/.tours/getting-started-with-your-algokit-project.tour deleted file mode 100644 index 95626ad..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.tours/getting-started-with-your-algokit-project.tour +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$schema": "https://aka.ms/codetour-schema", - "title": "Getting Started with Your AlgoKit Project", - "steps": [ - { - "file": "README.md", - "description": "Welcome to your brand new AlgoKit template-based project. In this tour, we will guide you through the main features and capabilities included in the template.", - "line": 3 - }, - { - "file": "README.md", - "description": "Start by ensuring you have followed the setup of pre-requisites.", - "line": 9 - }, - { - "file": "smart_contracts/__main__.py", - "description": "This is the main entry point for building your smart contracts. The default template includes a starter 'Hello World' contract that is deployed via the `algokit-utils` package (either `ts` or `py`, depending on your choice). To create a new smart contract, you can use the [`algokit generate`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md) command and invoke a pre-bundled generator template by running `algokit generate smart-contract`. This action will create a new folder in the `smart_contracts` directory, named after your project. Each folder contains a `contract.py` file, which is the entry point for your contract implementation, and `deploy_config.py` | `deployConfig.ts` files (depending on the language chosen for the template), that perform the deployment of the contract.", - "line": 26 - }, - { - "file": "smart_contracts/hello_world/deploy_config.py", - "description": "The default deployment scripts invoke a sample method on the starter contract that demonstrates how to interact with your deployed Algorand on-chain applications using the [`AlgoKit Typed Clients`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients) feature.", - "line": 32 - }, - { - "file": "tests/hello_world_test.py", - "description": "If you opted to include unit tests, the default tests provided demonstrate an example of mocking, setting up fixtures, and testing smart contract calls on an AlgoKit typed client.", - "line": 36 - }, - { - "file": ".env.localnet.template", - "description": "Environment files are a crucial mechanism that allows you to set up the [`algokit deploy`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/deploy.md) feature to simplify deploying your contracts in CI/CD environments (please note we still recommend careful evaluation when it comes to deployment to MainNet). Clone the file and remove the `.template` suffix to apply the changes to deployment scripts and launch configurations. The network prefix `localnet|testnet|mainnet` is primarily optimized for `algokit deploy`. The order of loading the variables is `.env.{network}` < `.env`.", - "line": 2 - }, - { - "file": ".algokit.toml", - "description": "This is the configuration file used by AlgoKit to determine version requirements, `algokit deploy` settings, and references to custom generators.", - "line": 5 - }, - { - "file": ".vscode/launch.json", - "description": "Refer to the pre-bundled Visual Studio launch configurations, offering various options on how to execute the build and deployment of your smart contracts.", - "line": 5 - }, - { - "file": ".vscode/extensions.json", - "description": "We highly recommend installing the recommended extensions to get the most out of this template starter project in your VSCode IDE.", - "line": 3 - }, - { - "file": "smart_contracts/__main__.py", - "description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin available on the [VSCode Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.", - "line": 13 - }, - { - "file": "smart_contracts/_helpers/__init__.py", - "description": "This folder contains helper scripts for contract management. These automate tasks like compiling, generating clients, and deploying. Usually, you won't need to edit these files, but advanced users can expand them for custom needs.", - "line": 1 - } - ] -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/extensions.json b/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/extensions.json deleted file mode 100644 index 1d2e7cf..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/extensions.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "recommendations": [ - "ms-python.python", - "charliermarsh.ruff", - "matangover.mypy", - "ms-python.black-formatter", - "tamasfe.even-better-toml", - "editorconfig.editorconfig", - "vsls-contrib.codetour", - "algorandfoundation.algokit-avm-vscode-debugger" - ] -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/launch.json b/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/launch.json deleted file mode 100644 index 864c1ac..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/launch.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Build & Deploy contracts", - "type": "python", - "request": "launch", - "module": "smart_contracts", - "cwd": "${workspaceFolder}", - "preLaunchTask": "Start AlgoKit LocalNet", - "env": { - "ALGOD_TOKEN": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "ALGOD_SERVER": "http://localhost", - "ALGOD_PORT": "4001", - "INDEXER_TOKEN": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "INDEXER_SERVER": "http://localhost", - "INDEXER_PORT": "8980" - } - }, - { - "name": "Deploy contracts", - "type": "python", - "request": "launch", - "module": "smart_contracts", - "args": ["deploy"], - "cwd": "${workspaceFolder}", - "env": { - "ALGOD_TOKEN": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "ALGOD_SERVER": "http://localhost", - "ALGOD_PORT": "4001", - "INDEXER_TOKEN": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "INDEXER_SERVER": "http://localhost", - "INDEXER_PORT": "8980" - } - }, - { - "name": "Build contracts", - "type": "python", - "request": "launch", - "module": "smart_contracts", - "args": ["build"], - "cwd": "${workspaceFolder}" - }, - { - "type": "avm", - "request": "launch", - "name": "Debug TEAL via AlgoKit AVM Debugger", - "simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}", - "stopOnEntry": true - } - ] -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/settings.json b/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/settings.json deleted file mode 100644 index 0c2dfec..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/settings.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - // General - see also /.editorconfig - "editor.formatOnSave": true, - "files.exclude": { - "**/.git": true, - "**/.DS_Store": true, - "**/Thumbs.db": true, - ".mypy_cache": true, - ".pytest_cache": true, - ".ruff_cache": true, - "**/__pycache__": true, - ".idea": true - }, - - // Python - "python.analysis.extraPaths": ["${workspaceFolder}/smart_contracts"], - "python.defaultInterpreterPath": "${workspaceFolder}/.venv", - "[python]": { - "editor.codeActionsOnSave": { - "source.fixAll": true, - // Prevent default import sorting from running; Ruff will sort imports for us anyway - "source.organizeImports": false - }, - "editor.defaultFormatter": "ms-python.black-formatter", - }, - "black-formatter.args": ["--config=pyproject.toml"], - "python.testing.pytestEnabled": true, - "ruff.enable": true, - "ruff.lint.run": "onSave", - "ruff.lint.args": ["--config=pyproject.toml"], - "ruff.importStrategy": "fromEnvironment", - "ruff.fixAll": true, //lint and fix all files in workspace - "ruff.organizeImports": true, //organize imports on save - "ruff.codeAction.disableRuleComment": { - "enable": true - }, - "ruff.codeAction.fixViolation": { - "enable": true - }, - "python.analysis.typeCheckingMode": "off", - "mypy.configFile": "pyproject.toml", - // set to empty array to use config from project - "mypy.targets": [], - "mypy.runUsingActiveInterpreter": true, - - // On Windows, if execution policy is set to Signed (default) then it won't be able to activate the venv - // so instead let's set it to RemoteSigned for VS Code terminal - "terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "RemoteSigned"], -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/tasks.json b/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/tasks.json deleted file mode 100644 index eb1e767..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/.vscode/tasks.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "Build contracts", - "command": "${workspaceFolder}/.venv/bin/python", - "windows": { - "command": "${workspaceFolder}/.venv/Scripts/python.exe" - }, - "args": ["-m", "smart_contracts", "build"], - "options": { - "cwd": "${workspaceFolder}" - }, - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [] - }, - { - "label": "Build contracts (+ LocalNet)", - "command": "${workspaceFolder}/.venv/bin/python", - "windows": { - "command": "${workspaceFolder}/.venv/Scripts/python.exe" - }, - "args": ["-m", "smart_contracts", "build"], - "options": { - "cwd": "${workspaceFolder}" - }, - "dependsOn": "Start AlgoKit LocalNet", - "problemMatcher": [] - }, - { - "label": "Start AlgoKit LocalNet", - "command": "algokit", - "args": ["localnet", "start"], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - }, - { - "label": "Stop AlgoKit LocalNet", - "command": "algokit", - "args": ["localnet", "stop"], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - }, - { - "label": "Reset AlgoKit LocalNet", - "command": "algokit", - "args": ["localnet", "reset"], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - }, - { - "label": "Analyze TEAL contracts with AlgoKit Tealer integration", - "command": "algokit", - "args": [ - "task", - "analyze", - "${workspaceFolder}/.algokit", - "--recursive", - "--force" - ], - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - } - ] -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/README.md b/examples/production_beaker_react/projects/production_beaker_react-contracts/README.md deleted file mode 100644 index 2457f7c..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/README.md +++ /dev/null @@ -1,155 +0,0 @@ -# production_beaker_react-contracts - -This project has been generated using AlgoKit. See below for default getting started instructions. - -# Setup - -### Pre-requisites - -- [Python 3.10+](https://www.python.org/downloads/) (we recommended 3.12+) -- [Docker](https://www.docker.com/) (for LocalNet only) - -> For interactive tour over the codebase, download [vsls-contrib.codetour](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) extension for VS Code, then open the [`.codetour.json`](./.tours/getting-started-with-your-algokit-project.tour) file in code tour extension. - -### Initial Setup - -#### 1. Clone the Repository -Start by cloning this repository to your local machine. - -#### 2. Install Pre-requisites -Ensure the following pre-requisites are installed and properly configured: - -- **Docker**: Required for running a local Algorand network. [Install Docker](https://www.docker.com/). -- **AlgoKit CLI**: Essential for project setup and operations. Install the latest version from [AlgoKit CLI Installation Guide](https://github.com/algorandfoundation/algokit-cli#install). Verify installation with `algokit --version`, expecting `2.0.0` or later. - -#### 3. Bootstrap Your Local Environment -Run the following commands within the project folder: - -- **Install Poetry**: Required for Python dependency management. [Installation Guide](https://python-poetry.org/docs/#installation). Verify with `poetry -V` to see version `1.2`+. -- **Setup Project**: Execute `algokit project bootstrap all` to install dependencies and setup a Python virtual environment in `.venv`. -- **Configure environment**: Execute `algokit generate env-file -a target_network localnet` to create a `.env.localnet` file with default configuration for `localnet`. -- **Start LocalNet**: Use `algokit localnet start` to initiate a local Algorand network. - -### Development Workflow - -#### Terminal -Directly manage and interact with your project using AlgoKit commands: - -1. **Build Contracts**: `algokit project run build` compiles all smart contracts. -2. **Deploy**: Use `algokit project deploy localnet` to deploy contracts to the local network. - -#### VS Code -For a seamless experience with breakpoint debugging and other features: - -1. **Open Project**: In VS Code, open the repository root. -2. **Install Extensions**: Follow prompts to install recommended extensions. -3. **Debugging**: - - Use `F5` to start debugging. - - **Windows Users**: Select the Python interpreter at `./.venv/Scripts/python.exe` via `Ctrl/Cmd + Shift + P` > `Python: Select Interpreter` before the first run. - -#### JetBrains IDEs -While primarily optimized for VS Code, JetBrains IDEs are supported: - -1. **Open Project**: In your JetBrains IDE, open the repository root. -2. **Automatic Setup**: The IDE should configure the Python interpreter and virtual environment. -3. **Debugging**: Use `Shift+F10` or `Ctrl+R` to start debugging. Note: Windows users may encounter issues with pre-launch tasks due to a known bug. See [JetBrains forums](https://youtrack.jetbrains.com/issue/IDEA-277486/Shell-script-configuration-cannot-run-as-before-launch-task) for workarounds. - -## AlgoKit Workspaces and Project Management -This project supports both standalone and monorepo setups through AlgoKit workspaces. Leverage [`algokit project run`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md) commands for efficient monorepo project orchestration and management across multiple projects within a workspace. - -## AlgoKit Generators - -This template provides a set of [algokit generators](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md) that allow you to further modify the project instantiated from the template to fit your needs, as well as giving you a base to build your own extensions to invoke via the `algokit generate` command. - -### Generate Smart Contract - -By default the template creates a single `HelloWorld` contract under hello_world folder in the `smart_contracts` directory. To add a new contract: - -1. From the root of the project (`../`) execute `algokit generate smart-contract`. This will create a new starter smart contract and deployment configuration file under `{your_contract_name}` subfolder in the `smart_contracts` directory. -2. Each contract potentially has different creation parameters and deployment steps. Hence, you need to define your deployment logic in `deploy_config.py`file. -3. `config.py` file will automatically build all contracts in the `smart_contracts` directory. If you want to build specific contracts manually, modify the default code provided by the template in `config.py` file. - -> Please note, above is just a suggested convention tailored for the base configuration and structure of this template. The default code supplied by the template in `config.py` and `index.ts` (if using ts clients) files are tailored for the suggested convention. You are free to modify the structure and naming conventions as you see fit. - -### Generate '.env' files - -By default the template instance does not contain any env files. Using [`algokit project deploy`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/deploy.md) against `localnet` | `testnet` | `mainnet` will use default values for `algod` and `indexer` unless overwritten via `.env` or `.env.{target_network}`. - -To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file`### Continuous Integration / Continuous Deployment (CI/CD) - -This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [.github/workflows](`../../.github/workflows`) folder. - -> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace. - -### AlgoKit Workspaces - -To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo). - -### Debugging Smart Contracts - -This project is optimized to work with AlgoKit AVM Debugger extension. To activate it: -Refer to the commented header in the `__main__.py` file in the `smart_contracts` folder. - -If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract. - -For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). - -#### Setting up GitHub for CI/CD workflow and TestNet deployment - - 1. Every time you have a change to your smart contract, and when you first initialize the project you need to [build the contract](#initial-setup) and then commit the `smart_contracts/artifacts` folder so the [output stability](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/articles/output_stability.md) tests pass - 2. Decide what values you want to use for the `allow_update`, `allow_delete` and the `on_schema_break`, `on_update` parameters specified in [`contract.py`](./smart_contracts/hello_world/contract.py). - When deploying to LocalNet these values are both set to allow update and replacement of the app for convenience. But for non-LocalNet networks - the defaults are more conservative. - These default values will allow the smart contract to be deployed initially, but will not allow the app to be updated or deleted if is changed and the build will instead fail. - To help you decide it may be helpful to read the [AlgoKit Utils app deployment documentation](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/docs/capabilities/app-deploy.md) or the [AlgoKit smart contract deployment architecture](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md#upgradeable-and-deletable-contracts). - 3. Create a [Github Environment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#creating-an-environment) named `Test`. - Note: If you have a private repository and don't have GitHub Enterprise then Environments won't work and you'll need to convert the GitHub Action to use a different approach. Ignore this step if you picked `Starter` preset. - 4. Create or obtain a mnemonic for an Algorand account for use on TestNet to deploy apps, referred to as the `DEPLOYER` account. - 5. Store the mnemonic as a [secret](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-secrets) `DEPLOYER_MNEMONIC` - in the Test environment created in step 3. - 6. The account used to deploy the smart contract will require enough funds to create the app, and also fund it. There are two approaches available here: - * Either, ensure the account is funded outside of CI/CD. - In Testnet, funds can be obtained by using the [Algorand TestNet dispenser](https://bank.testnet.algorand.network/) and we recommend provisioning 50 ALGOs. - * Or, fund the account as part of the CI/CD process by using a `DISPENSER_MNEMONIC` GitHub Environment secret to point to a separate `DISPENSER` account that you maintain ALGOs in (similarly, you need to provision ALGOs into this account using the [TestNet dispenser](https://bank.testnet.algorand.network/)). - -#### Continuous Integration - -For pull requests and pushes to `main` branch against this repository the following checks are automatically performed by GitHub Actions: - - Python dependencies are audited using [pip-audit](https://pypi.org/project/pip-audit/) - - Code formatting is checked using [Black](https://github.com/psf/black) - - Linting is checked using [Ruff](https://github.com/charliermarsh/ruff) - - Types are checked using [mypy](https://mypy-lang.org/) - - Python tests are executed using [pytest](https://docs.pytest.org/) - - Smart contract artifacts are built - - Smart contract artifacts are checked for [output stability](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/articles/output_stability.md) - - Smart contract is deployed to a AlgoKit LocalNet instance - -#### Continuous Deployment - -For pushes to `main` branch, after the above checks pass, the following deployment actions are performed: - - The smart contract(s) are deployed to TestNet using [AlgoNode](https://algonode.io). - -> Please note deployment is also performed via `algokit deploy` command which can be invoked both via CI as seen on this project, or locally. For more information on how to use `algokit deploy` please see [AlgoKit documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/deploy.md). - -# Tools - -This project makes use of Python to build Algorand smart contracts. The following tools are in use: - -- [Algorand](https://www.algorand.com/) - Layer 1 Blockchain; [Developer portal](https://developer.algorand.org/), [Why Algorand?](https://developer.algorand.org/docs/get-started/basics/why_algorand/) -- [AlgoKit](https://github.com/algorandfoundation/algokit-cli) - One-stop shop tool for developers building on the Algorand network; [docs](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/algokit.md), [intro tutorial](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/tutorials/intro.md) -- [Beaker](https://github.com/algorand-devrel/beaker) - Smart contract development framework for PyTeal; [docs](https://beaker.algo.xyz), [examples](https://github.com/algorand-devrel/beaker/tree/master/examples) -- [PyTEAL](https://github.com/algorand/pyteal) - Python language binding for Algorand smart contracts; [docs](https://pyteal.readthedocs.io/en/stable/) -- [AlgoKit Utils](https://github.com/algorandfoundation/algokit-utils-py) - A set of core Algorand utilities that make it easier to build solutions on Algorand. -- [Poetry](https://python-poetry.org/): Python packaging and dependency management. -- [Black](https://github.com/psf/black): A Python code formatter. -- [Ruff](https://github.com/charliermarsh/ruff): An extremely fast Python linter. -- [mypy](https://mypy-lang.org/): Static type checker. -- [pytest](https://docs.pytest.org/): Automated testing. -- [pip-audit](https://pypi.org/project/pip-audit/): Tool for scanning Python environments for packages with known vulnerabilities. - -It has also been configured to have a productive dev experience out of the box in [VS Code](https://code.visualstudio.com/), see the [.vscode](./.vscode) folder. -- [AlgoKit Tealer Integration](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/tasks/analyze.md): AlgoKit Tealer Integration is a feature in the CLI that allows you to run [Tealer](https://github.com/crytic/tealer) static analyzer on your TEAL -source code. The invocation of this command is included in: -- The github actions workflow file. -- A VSCode task ('Shift+CMD|CTRL+P' and search for 'Tasks: Run Task' and select 'Analyze TEAL contracts with AlgoKit Tealer integration'). -- A `pre-commit` hook (if you have enabled `pre-commit` in your project). diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/poetry.toml b/examples/production_beaker_react/projects/production_beaker_react-contracts/poetry.toml deleted file mode 100644 index ab1033b..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/poetry.toml +++ /dev/null @@ -1,2 +0,0 @@ -[virtualenvs] -in-project = true diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/pyproject.toml b/examples/production_beaker_react/projects/production_beaker_react-contracts/pyproject.toml deleted file mode 100644 index d3b4b98..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/pyproject.toml +++ /dev/null @@ -1,51 +0,0 @@ -[tool.poetry] -name = "production_beaker_react-contracts" -version = "0.1.0" -description = "Algorand smart contracts" -authors = ["None "] -readme = "README.md" - -[tool.poetry.dependencies] -python = "^3.10" -beaker-pyteal = "^1.1.1" -algokit-utils = "^2.2.0" -python-dotenv = "^1.0.0" - -[tool.poetry.group.dev.dependencies] -setuptools = "^69.0.2" # Adding explicitly to work around pyteal https://github.com/algorand/pyteal/issues/712 -algokit-client-generator = "^1.1.3" -black = {extras = ["d"], version = "*"} -ruff = "^0.1.6" -mypy = "*" -pytest = "*" -pytest-cov = "*" -pip-audit = "*" - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.ruff] -line-length = 120 -select = ["E", "F", "ANN", "UP", "N", "C4", "B", "A", "YTT", "W", "FBT", "Q", "RUF", "I"] -ignore = [ - "ANN101", # no type for self - "ANN102", # no type for cls -] -unfixable = ["B", "RUF"] - -[tool.ruff.flake8-annotations] -allow-star-arg-any = true -suppress-none-returning = true - -[tool.pytest.ini_options] -pythonpath = ["smart_contracts", "tests"] - -[tool.mypy] -files = "smart_contracts/" -python_version = "3.10" -check_untyped_defs = true -warn_redundant_casts = true -warn_unused_ignores = true -allow_untyped_defs = false -strict_equality = true diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/README.md b/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/README.md deleted file mode 100644 index f765c95..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -## How to add new smart contracts? - -By the default the template creates a single `HelloWorld` contract under hello_world folder in the `smart_contracts` directory. To add a new contract: - -1. From the root of the project (`../`) execute `algokit generate smart-contract`. This will create a new starter smart contract and deployment configuration file under `{your_contract_name}` subfolder under `smart_contracts` directory. -2. Each contract potentially has different creation parameters and deployment steps. Hence, you need to define your deployment logic in `deploy_config.py`file. -3. `config.py` file will automatically build all contracts under `smart_contracts` directory. If you want to build specific contracts manually, modify the default code provided by the template in `config.py` file. - -> Please note, above is just a suggested convention tailored for the base configuration and structure of this template. Default code supplied by the template in `config.py` and `index.ts` (if using ts clients) files are tailored for the suggested convention. You are free to modify the structure and naming conventions as you see fit. diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/__init__.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/__main__.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/__main__.py deleted file mode 100644 index cce5633..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/__main__.py +++ /dev/null @@ -1,53 +0,0 @@ -import logging -import sys -from pathlib import Path - -from dotenv import load_dotenv - -from smart_contracts._helpers.build import build -from smart_contracts._helpers.config import contracts -from smart_contracts._helpers.deploy import deploy - -# Uncomment the following lines to enable auto generation of AVM Debugger compliant sourcemap and simulation trace file. -# Learn more about using AlgoKit AVM Debugger to debug your TEAL source codes and inspect various kinds of -# Algorand transactions in atomic groups -> https://github.com/algorandfoundation/algokit-avm-vscode-debugger -# from algokit_utils.config import config -# config.configure(debug=True, trace_all=True) -logging.basicConfig( - level=logging.DEBUG, format="%(asctime)s %(levelname)-10s: %(message)s" -) -logger = logging.getLogger(__name__) -logger.info("Loading .env") -# For manual script execution (bypassing `algokit project deploy`) with a custom .env, -# modify `load_dotenv()` accordingly. For example, `load_dotenv('.env.localnet')`. -load_dotenv() -root_path = Path(__file__).parent - - -def main(action: str) -> None: - artifact_path = root_path / "artifacts" - match action: - case "build": - for contract in contracts: - logger.info(f"Building app {contract.app.name}") - build(artifact_path / contract.app.name, contract.app) - case "deploy": - for contract in contracts: - logger.info(f"Deploying app {contract.app.name}") - app_spec_path = artifact_path / contract.app.name / "application.json" - if contract.deploy: - deploy(app_spec_path, contract.deploy) - case "all": - for contract in contracts: - logger.info(f"Building app {contract.app.name}") - app_spec_path = build(artifact_path / contract.app.name, contract.app) - logger.info(f"Deploying {contract.app.name}") - if contract.deploy: - deploy(app_spec_path, contract.deploy) - - -if __name__ == "__main__": - if len(sys.argv) > 1: - main(sys.argv[1]) - else: - main("all") diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/__init__.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/build.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/build.py deleted file mode 100644 index cd2098d..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/build.py +++ /dev/null @@ -1,43 +0,0 @@ -import logging -import subprocess -from pathlib import Path -from shutil import rmtree - -import beaker - -logger = logging.getLogger(__name__) -deployment_extension = "py" - - -def build(output_dir: Path, app: beaker.Application) -> Path: - output_dir = output_dir.resolve() - if output_dir.exists(): - rmtree(output_dir) - output_dir.mkdir(exist_ok=True, parents=True) - logger.info(f"Exporting {app.name} to {output_dir}") - specification = app.build() - specification.export(output_dir) - - result = subprocess.run( - [ - "algokit", - "generate", - "client", - output_dir / "application.json", - "--output", - output_dir / f"client.{deployment_extension}", - ], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - text=True, - ) - if result.returncode: - if "No such command" in result.stdout: - raise Exception( - "Could not generate typed client, requires AlgoKit 2.0.0 or " - "later. Please update AlgoKit" - ) - else: - raise Exception(f"Could not generate typed client:\n{result.stdout}") - - return output_dir / "application.json" diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/config.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/config.py deleted file mode 100644 index 89d948d..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/config.py +++ /dev/null @@ -1,65 +0,0 @@ -import dataclasses -import importlib -from collections.abc import Callable -from pathlib import Path - -from algokit_utils import Account, ApplicationSpecification -from algosdk.v2client.algod import AlgodClient -from algosdk.v2client.indexer import IndexerClient -from beaker import Application - - -@dataclasses.dataclass -class SmartContract: - app: Application - deploy: ( - Callable[[AlgodClient, IndexerClient, ApplicationSpecification, Account], None] - | None - ) = None - - -def import_contract(folder: Path) -> Application: - """Imports the contract from a folder if it exists.""" - try: - contract_module = importlib.import_module( - f"{folder.parent.name}.{folder.name}.contract" - ) - return contract_module.app - except ImportError as e: - raise Exception(f"Contract not found in {folder}") from e - - -def import_deploy_if_exists( - folder: Path, -) -> ( - Callable[[AlgodClient, IndexerClient, ApplicationSpecification, Account], None] - | None -): - """Imports the deploy function from a folder if it exists.""" - try: - deploy_module = importlib.import_module( - f"{folder.parent.name}.{folder.name}.deploy_config" - ) - return deploy_module.deploy - except ImportError: - return None - - -def has_contract_file(directory: Path) -> bool: - """Checks whether the directory contains contract.py file.""" - return (directory / "contract.py").exists() - - -# define contracts to build and/or deploy -base_dir = Path("smart_contracts") -contracts = [ - SmartContract(app=import_contract(folder), deploy=import_deploy_if_exists(folder)) - for folder in base_dir.iterdir() - if folder.is_dir() and has_contract_file(folder) -] - -## Comment the above and uncomment the below and define contracts manually if you want to build and specify them -## manually otherwise the above code will always include all contracts under contract.py file for any subdirectory -## in the smart_contracts directory. Optionally it will grab the deploy function from deploy_config.py if it exists. - -# contracts = [] diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/deploy.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/deploy.py deleted file mode 100644 index 08367a3..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/_helpers/deploy.py +++ /dev/null @@ -1,50 +0,0 @@ -import logging -from collections.abc import Callable -from pathlib import Path - -from algokit_utils import ( - Account, - ApplicationSpecification, - EnsureBalanceParameters, - ensure_funded, - get_account, - get_algod_client, - get_indexer_client, -) -from algosdk.util import algos_to_microalgos -from algosdk.v2client.algod import AlgodClient -from algosdk.v2client.indexer import IndexerClient - -logger = logging.getLogger(__name__) - - -def deploy( - app_spec_path: Path, - deploy_callback: Callable[ - [AlgodClient, IndexerClient, ApplicationSpecification, Account], None - ], - deployer_initial_funds: int = 2, -) -> None: - # get clients - # by default client configuration is loaded from environment variables - algod_client = get_algod_client() - indexer_client = get_indexer_client() - - # get app spec - app_spec = ApplicationSpecification.from_json(app_spec_path.read_text()) - - # get deployer account by name - deployer = get_account(algod_client, "DEPLOYER", fund_with_algos=0) - - minimum_funds_micro_algos = algos_to_microalgos(deployer_initial_funds) - ensure_funded( - algod_client, - EnsureBalanceParameters( - account_to_fund=deployer, - min_spending_balance_micro_algos=minimum_funds_micro_algos, - min_funding_increment_micro_algos=minimum_funds_micro_algos, - ), - ) - - # use provided callback to deploy the app - deploy_callback(algod_client, indexer_client, app_spec, deployer) diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/hello_world/contract.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/hello_world/contract.py deleted file mode 100644 index bfda2ca..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/hello_world/contract.py +++ /dev/null @@ -1,26 +0,0 @@ -import beaker -import pyteal as pt -from algokit_utils import DELETABLE_TEMPLATE_NAME, UPDATABLE_TEMPLATE_NAME - -app = beaker.Application("hello_world") - - -@app.update(authorize=beaker.Authorize.only_creator(), bare=True) -def update() -> pt.Expr: - return pt.Assert( - pt.Tmpl.Int(UPDATABLE_TEMPLATE_NAME), - comment="Check app is updatable", - ) - - -@app.delete(authorize=beaker.Authorize.only_creator(), bare=True) -def delete() -> pt.Expr: - return pt.Assert( - pt.Tmpl.Int(DELETABLE_TEMPLATE_NAME), - comment="Check app is deletable", - ) - - -@app.external -def hello(name: pt.abi.String, *, output: pt.abi.String) -> pt.Expr: - return output.set(pt.Concat(pt.Bytes("Hello, "), name.get())) diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/hello_world/deploy_config.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/hello_world/deploy_config.py deleted file mode 100644 index 46eeb59..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/smart_contracts/hello_world/deploy_config.py +++ /dev/null @@ -1,47 +0,0 @@ -import logging - -import algokit_utils -from algosdk.v2client.algod import AlgodClient -from algosdk.v2client.indexer import IndexerClient - -logger = logging.getLogger(__name__) - - -# define deployment behaviour based on supplied app spec -def deploy( - algod_client: AlgodClient, - indexer_client: IndexerClient, - app_spec: algokit_utils.ApplicationSpecification, - deployer: algokit_utils.Account, -) -> None: - from smart_contracts.artifacts.hello_world.client import ( - HelloWorldClient, - ) - - app_client = HelloWorldClient( - algod_client, - creator=deployer, - indexer_client=indexer_client, - ) - is_mainnet = algokit_utils.is_mainnet(algod_client) - app_client.deploy( - on_schema_break=( - algokit_utils.OnSchemaBreak.AppendApp - if is_mainnet - else algokit_utils.OnSchemaBreak.ReplaceApp - ), - on_update=( - algokit_utils.OnUpdate.AppendApp - if is_mainnet - else algokit_utils.OnUpdate.UpdateApp - ), - allow_delete=not is_mainnet, - allow_update=not is_mainnet, - ) - - name = "world" - response = app_client.hello(name=name) - logger.info( - f"Called hello on {app_spec.contract.name} ({app_client.app_id}) " - f"with name={name}, received: {response.return_value}" - ) diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/tests/__init__.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/tests/conftest.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/tests/conftest.py deleted file mode 100644 index aec2485..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/tests/conftest.py +++ /dev/null @@ -1,26 +0,0 @@ -import pytest -from algokit_utils import ( - get_algod_client, - get_default_localnet_config, - get_indexer_client, -) -from algosdk.v2client.algod import AlgodClient -from algosdk.v2client.indexer import IndexerClient - -# Uncomment if you want to load network specific or generic .env file -# @pytest.fixture(autouse=True, scope="session") -# def environment_fixture() -> None: -# env_path = Path(__file__).parent.parent / ".env" -# load_dotenv(env_path) - - -@pytest.fixture(scope="session") -def algod_client() -> AlgodClient: - # by default we are using localnet algod - client = get_algod_client(get_default_localnet_config("algod")) - return client - - -@pytest.fixture(scope="session") -def indexer_client() -> IndexerClient: - return get_indexer_client(get_default_localnet_config("indexer")) diff --git a/examples/production_beaker_react/projects/production_beaker_react-contracts/tests/hello_world_test.py b/examples/production_beaker_react/projects/production_beaker_react-contracts/tests/hello_world_test.py deleted file mode 100644 index 0506685..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-contracts/tests/hello_world_test.py +++ /dev/null @@ -1,50 +0,0 @@ -import algokit_utils -import pytest -from algokit_utils import get_localnet_default_account -from algokit_utils.config import config -from algosdk.v2client.algod import AlgodClient -from algosdk.v2client.indexer import IndexerClient - -from smart_contracts.artifacts.hello_world.client import HelloWorldClient - - -@pytest.fixture(scope="session") -def hello_world_client( - algod_client: AlgodClient, indexer_client: IndexerClient -) -> HelloWorldClient: - config.configure( - debug=True, - # trace_all=True, - ) - - client = HelloWorldClient( - algod_client, - creator=get_localnet_default_account(algod_client), - indexer_client=indexer_client, - ) - - client.deploy( - on_schema_break=algokit_utils.OnSchemaBreak.ReplaceApp, - on_update=algokit_utils.OnUpdate.UpdateApp, - allow_delete=True, - allow_update=True, - ) - return client - - -def test_says_hello(hello_world_client: HelloWorldClient) -> None: - result = hello_world_client.hello(name="World") - - assert result.return_value == "Hello, World" - - -def test_simulate_says_hello_with_correct_budget_consumed( - hello_world_client: HelloWorldClient, algod_client: AlgodClient -) -> None: - result = ( - hello_world_client.compose().hello(name="World").hello(name="Jane").simulate() - ) - - assert result.abi_results[0].return_value == "Hello, World" - assert result.abi_results[1].return_value == "Hello, Jane" - assert result.simulate_response["txn-groups"][0]["app-budget-consumed"] < 100 diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.algokit.toml b/examples/production_beaker_react/projects/production_beaker_react-frontend/.algokit.toml deleted file mode 100644 index f94278b..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.algokit.toml +++ /dev/null @@ -1,17 +0,0 @@ -[algokit] -min_version = "v2.0.0" - -[project] -type = "frontend" -name = 'production_beaker_react-frontend' -artifacts = "src/contracts" - -[project.run] -build = { commands = ['npm run build'], description = 'Build frontend' } -test = { commands = ['npm run test'], description = 'Run frontend tests' } -lint = { commands = ['npm run lint'], description = 'Lint frontend code' } -ci-deploy-netlify = { commands = [ - 'npm install --global netlify-cli@latest', - 'netlify login', - 'netlify deploy --build --prod' - ], description = 'Deploy to Netlify' } diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.algokit/.copier-answers.yml b/examples/production_beaker_react/projects/production_beaker_react-frontend/.algokit/.copier-answers.yml deleted file mode 100644 index 7b190e8..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.algokit/.copier-answers.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 1.0.7 -_src_path: gh:algorandfoundation/algokit-react-frontend-template -author_email: None -author_name: None -cloud_provider: netlify -preset_name: production -project_name: production_beaker_react-frontend - diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.editorconfig b/examples/production_beaker_react/projects/production_beaker_react-frontend/.editorconfig deleted file mode 100644 index a83b72c..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -[*] -charset = utf-8 -insert_final_newline = true -end_of_line = lf -indent_style = space -indent_size = 2 -tab_width = 2 -max_line_length = 140 -trim_trailing_whitespace = true diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.env.template b/examples/production_beaker_react/projects/production_beaker_react-frontend/.env.template deleted file mode 100644 index e05d499..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.env.template +++ /dev/null @@ -1,67 +0,0 @@ -# ====================== -# LocalNet configuration -# uncomment below to use -# ====================== - -VITE_ENVIRONMENT=local - -# Algod -VITE_ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -VITE_ALGOD_SERVER=http://localhost -VITE_ALGOD_PORT=4001 -VITE_ALGOD_NETWORK="" - -# Indexer -VITE_INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -VITE_INDEXER_SERVER=http://localhost -VITE_INDEXER_PORT=8980 - -# KMD -# Please note: -# 1. This is only needed for LocalNet since -# by default KMD provider is ignored on other networks. -# 2. AlgoKit LocalNet starts with a single wallet called 'unencrypted-default-wallet', -# with heaps of tokens available for testing. -VITE_KMD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -VITE_KMD_SERVER=http://localhost -VITE_KMD_PORT=4002 -VITE_KMD_WALLET="unencrypted-default-wallet" -VITE_KMD_PASSWORD="" - -# # ====================== -# # TestNet configuration: -# # uncomment below to use -# # ====================== - -# VITE_ENVIRONMENT=local - -# # Algod -# VITE_ALGOD_TOKEN="" -# VITE_ALGOD_SERVER="https://testnet-api.algonode.cloud" -# VITE_ALGOD_PORT="" -# VITE_ALGOD_NETWORK="testnet" - -# # Indexer -# VITE_INDEXER_TOKEN="" -# VITE_INDEXER_SERVER="https://testnet-idx.algonode.cloud" -# VITE_INDEXER_PORT="" - - -# # ====================== -# # MainNet configuration: -# # uncomment below to use -# # ====================== - -# VITE_ENVIRONMENT=production - -# # Algod -# VITE_ALGOD_TOKEN="" -# VITE_ALGOD_SERVER="https://mainnet-api.algonode.cloud" -# VITE_ALGOD_PORT="" -# VITE_ALGOD_NETWORK="mainnet" - -# # Indexer -# VITE_INDEXER_TOKEN="" -# VITE_INDEXER_SERVER="https://mainnet-idx.algonode.cloud" -# VITE_INDEXER_PORT="" - diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.eslintrc b/examples/production_beaker_react/projects/production_beaker_react-frontend/.eslintrc deleted file mode 100644 index 868fe37..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.eslintrc +++ /dev/null @@ -1,27 +0,0 @@ -{ - "root": true, - "env": { - "node": true - }, - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "prettier"], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended" - ], - "rules": { - "prettier/prettier": "warn", - "no-console": "warn", - "@typescript-eslint/no-unused-vars": [ - "warn", - { - "ignoreRestSiblings": true, - "argsIgnorePattern": "^_", - "destructuredArrayIgnorePattern": "^_" - } - ], - "prefer-template": "error" - } -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.gitignore b/examples/production_beaker_react/projects/production_beaker_react-frontend/.gitignore deleted file mode 100644 index b1ce837..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - - -# dotenv environment variable files -.env -env/ - -# misc -/dist -.DS_Store - - -npm-debug.log* -yarn-debug.log* -yarn-error.log* -/test-results/ -/playwright-report/ -/playwright/.cache/ - -# PyCharm -.idea -!.idea/ -.idea/* -!.idea/runConfigurations/ - -.vercel -.netlify diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.npmrc b/examples/production_beaker_react/projects/production_beaker_react-frontend/.npmrc deleted file mode 100644 index c42da84..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.npmrc +++ /dev/null @@ -1 +0,0 @@ -engine-strict = true diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.prettierignore b/examples/production_beaker_react/projects/production_beaker_react-frontend/.prettierignore deleted file mode 100644 index dbda6ae..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.prettierignore +++ /dev/null @@ -1,12 +0,0 @@ -# don't ever format node_modules -node_modules -# don't lint format output (make sure it's set to your correct build folder name) -dist -build -# don't format nyc coverage output -coverage -# don't format generated types -**/generated/types.d.ts -**/generated/types.ts -# don't format ide files -.idea diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.prettierrc.cjs b/examples/production_beaker_react/projects/production_beaker_react-frontend/.prettierrc.cjs deleted file mode 100644 index 066b8e5..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.prettierrc.cjs +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - singleQuote: true, - jsxSingleQuote: false, - semi: false, - tabWidth: 2, - trailingComma: 'all', - printWidth: 140, - endOfLine: 'lf', - arrowParens: 'always', -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/extensions.json b/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/extensions.json deleted file mode 100644 index 5c94122..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/extensions.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "recommendations": [ - "EditorConfig.EditorConfig", - "dotenv.dotenv-vscode", - "esbenp.prettier-vscode", - "dbaeumer.vscode-eslint", - "krysenlo.vite-plugin-eslint-problemmatcher", - "ms-playwright.playwright", - "Orta.vscode-jest", - "bradlc.vscode-tailwindcss", - "csstools.postcss", - ] -} - diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/launch.json b/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/launch.json deleted file mode 100644 index 7edaf04..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/launch.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "configurations": [ - { - "type": "msedge", - "request": "launch", - "name": "Run (Edge)", - "url": "http://localhost:5173", - "webRoot": "${workspaceFolder}", - "presentation": { - "hidden": false, - "group": "2. Web" - } - }, - { - "type": "chrome", - "request": "launch", - "name": "Run (Chrome)", - "url": "http://localhost:5173", - "webRoot": "${workspaceFolder}", - "presentation": { - "hidden": false, - "group": "2. Web" - } - }, - { - "type": "firefox", - "request": "launch", - "name": "Run (Firefox)", - "url": "http://localhost:5173", - "webRoot": "${workspaceFolder}", - "presentation": { - "hidden": false, - "group": "2. Web" - } - }, - { - "name": "Run dApp", - "type": "node", - "request": "launch", - "runtimeExecutable": "npm", - "runtimeArgs": ["run", "dev"], - "cwd": "${workspaceRoot}", - "console": "integratedTerminal", - "skipFiles": ["/**", "node_modules/**"], - "presentation": { - "hidden": false, - "group": "1. Run Project", - "order": 1 - } - }, - { - "name": "Run dApp (+ LocalNet)", - "type": "node", - "request": "launch", - "runtimeExecutable": "npm", - "runtimeArgs": ["run", "dev"], - "cwd": "${workspaceRoot}", - "console": "integratedTerminal", - "skipFiles": ["/**", "node_modules/**"], - "preLaunchTask": "Start AlgoKit LocalNet", - "presentation": { - "hidden": false, - "group": "1. Run Project", - "order": 1 - } - } - ] -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/settings.json b/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/settings.json deleted file mode 100644 index 6ffe6b3..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/settings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true, - "source.organizeImports": true - }, - "dotenv.enableAutocloaking": false, - "jest.autoRun": { - "watch": false, - "onSave": "test-file" - } -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/tasks.json b/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/tasks.json deleted file mode 100644 index d611c4f..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/.vscode/tasks.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "Start AlgoKit LocalNet", - "command": "algokit", - "args": ["localnet", "start"], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - } - ] -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/README.md b/examples/production_beaker_react/projects/production_beaker_react-frontend/README.md deleted file mode 100644 index d976473..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# production_beaker_react-frontend - -This starter React project has been generated using AlgoKit. See below for default getting started instructions. - -# Setup - -### Initial Setup - -#### 1. Clone the Repository -Start by cloning this repository to your local machine. - -#### 2. Install Pre-requisites -Ensure the following pre-requisites are installed and properly configured: - -- **npm**: Node package manager. Install from [Node.js Installation Guide](https://nodejs.org/en/download/). Verify with `npm -v` to see version `18.12`+. -- **AlgoKit CLI**: Essential for project setup and operations. Install the latest version from [AlgoKit CLI Installation Guide](https://github.com/algorandfoundation/algokit-cli#install). Verify installation with `algokit --version`, expecting `2.0.0` or later. - -#### 3. Bootstrap Your Local Environment -Run the following commands within the project folder: - -- **Install Project Dependencies**: With `algokit project bootstrap all`, ensure all dependencies are ready. - -### Development Workflow - -#### Terminal -Directly manage and interact with your project using AlgoKit commands: - -1. **Build Contracts**: `algokit project run build` builds react web app and links with smart contracts in workspace, if any. -2. Remaining set of command for linting, testing and deployment can be found in respective [package.json](./package.json) file and [.algokit.toml](./.algokit.toml) files. - -#### VS Code -For a seamless experience with breakpoint debugging and other features: - -1. **Open Project**: In VS Code, open the repository root. -2. **Install Extensions**: Follow prompts to install recommended extensions. -3. **Debugging**: - - Use `F5` to start debugging. - - **Windows Users**: Select the Python interpreter at `./.venv/Scripts/python.exe` via `Ctrl/Cmd + Shift + P` > `Python: Select Interpreter` before the first run. - -#### Other IDEs -While primarily optimized for VS Code, Jetbrains WebStorm has base support for this project: - -1. **Open Project**: In your JetBrains IDE, open the repository root. -2. **Automatic Setup**: The IDE should configure the Python interpreter and virtual environment. -3. **Debugging**: Use `Shift+F10` or `Ctrl+R` to start debugging. Note: Windows users may encounter issues with pre-launch tasks due to a known bug. See [JetBrains forums](https://youtrack.jetbrains.com/issue/IDEA-277486/Shell-script-configuration-cannot-run-as-before-launch-task) for workarounds. - -## AlgoKit Workspaces and Project Management -This project supports both standalone and monorepo setups through AlgoKit workspaces. Leverage [`algokit project run`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md) commands for efficient monorepo project orchestration and management across multiple projects within a workspace. - -> Please note, by default frontend is pre configured to run against Algorand LocalNet. If you want to run against TestNet or MainNet, comment out the current environment variable and uncomment the relevant one in [`.env`](.env) file that is created after running bootstrap command and based on [`.env.template`](.env.template). - -### Continuous Integration - -This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI workflows, which are located in the [.github/workflows](`../../.github/workflows`) folder. - -For pull requests and pushes to `main` branch against this repository the following checks are automatically performed by GitHub Actions: - -- `install`: Installs dependencies using `npm` -- `lint`: Lints the codebase using `ESLint` -- `build`: Builds the codebase using `vite` - -> Please note, if you instantiated the project via `algokit init` without explicitly specifying the `--no-workspace` flag, we will automatically attempt to move the contents of the `.github` folder to the root of the workspace. - -### Continuous Deployment - -The project template provides base Github Actions workflows for continuous deployment to [Netlify](https://www.netlify.com/) or [Vercel](https://vercel.com/). These workflows are located in the [`.github/workflows`](./.github/workflows) folder. - -**Please note**: when configuring the github repository for the first time. Depending on selected provider you will need to set the provider secrets in the repository settings. Default setup provided by the template allows you to manage the secrets via environment variables and secrets on your github repository. - - -#### Setting up environment variables and secrets for webapp deployment - -For Vercel: -1. Retrieve your [Vercel Access Token](https://vercel.com/support/articles/how-do-i-use-a-vercel-api-access-token) -2. Install the [Vercel CLI](https://vercel.com/cli) and run `vercel login` -3. Inside your folder, run `vercel link` to create a new Vercel project -4. Inside the generated `.vercel` folder, save the `projectId` and `orgId` from the `project.json` -5. Inside GitHub, add `VERCEL_TOKEN`, `VERCEL_ORG_ID`, and `VERCEL_PROJECT_ID` as [secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets). -6. Create an .env file containing ENV vars for the project (pointing to testnet or mainnet), drag and drop the .env file to upload initial batch of default environment variables to your vercel project. -7. Upon invocation, CD pipeline will pull the VITE_ prefixed environment variables, build the project and deploy to the specified environment. - -For Netlify: -1. Retrieve your [Netlify Access Token](https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui) -2. Inside your folder run `netlify login` -3. Inside your folder run `netlify sites:create` to create a new site, obtain NETLIFY_SITE_ID from the output -4. Inside GitHub, add `NETLIFY_AUTH_TOKEN` and `NETLIFY_SITE_ID` as [secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets). -5. Define the VITE_ prefixed environment variables in netlify environment variables under site settings. -6. Upon invocation, CD pipeline will build the project and deploy to the specified environment. - -> If you prefer alternative deployment methods, you can modify the relevant workflow files from the [`.github/workflows`](./.github/workflows) folder or modify deploy scripts in `.algokit.toml`. - - -# Algorand Wallet integrations - -The template comes with [`use-wallet`](https://github.com/txnlab/use-wallet) integration, which provides a React hook for connecting to an Algorand wallet providers. The following wallet providers are included by default: -- LocalNet: -- - [KMD/Local Wallet](https://github.com/TxnLab/use-wallet#kmd-algorand-key-management-daemon) - Algorand's Key Management Daemon (KMD) is a service that manages Algorand private keys and signs transactions. Works best with AlgoKit LocalNet and allows you to easily test and interact with your dApps locally. -- TestNet and others: -- - [Pera Wallet](https://perawallet.app). -- - [Defly Wallet](https://defly.app). -- - [Exodus Wallet](https://www.exodus.com). -- - [Daffi Wallet](https://www.daffi.me). - -Refer to official [`use-wallet`](https://github.com/txnlab/use-wallet) documentation for detailed guidelines on how to integrate with other wallet providers (such as WalletConnect v2). Too see implementation details on the use wallet hook and initialization of extra wallet providers refer to [`App.tsx`](./src/App.tsx). - -# Tools - -This project makes use of React and Tailwind to provider a base project configuration to develop frontends for your Algorand dApps and interactions with smart contracts. The following tools are in use: - -- [AlgoKit Utils](https://github.com/algorandfoundation/algokit-utils-ts) - Various TypeScript utilities to simplify interactions with Algorand and AlgoKit. -- [React](https://reactjs.org/) - A JavaScript library for building user interfaces. -- [Tailwind CSS](https://tailwindcss.com/) - A utility-first CSS framework for rapidly building custom designs. -- [daisyUI](https://daisyui.com/) - A component library for Tailwind CSS. -- [use-wallet](https://github.com/txnlab/use-wallet) - A React hook for connecting to an Algorand wallet providers. -- [npm](https://www.npmjs.com/): Node.js package manager -- [jest](https://jestjs.io/): JavaScript testing framework -- [playwright](https://playwright.dev/): Browser automation library -- [Prettier](https://prettier.io/): Opinionated code formatter -- [ESLint](https://eslint.org/): Tool for identifying and reporting on patterns in JavaScript -- Github Actions workflows for build validation -It has also been configured to have a productive dev experience out of the box in [VS Code](https://code.visualstudio.com/), see the [.vscode](./.vscode) folder. -# Integrating with smart contracts and application clients - -Refer to the detailed guidance on [integrating with smart contracts and application clients](./src/contracts/README.md). In essence, for any smart contract codebase generated with AlgoKit or other tools that produce compile contracts into ARC34 compliant app specifications, you can use the `algokit generate` command to generate TypeScript or Python typed client. Once generated simply drag and drop the generated client into `./src/contracts` and import it into your React components as you see fit. diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/index.html b/examples/production_beaker_react/projects/production_beaker_react-frontend/index.html deleted file mode 100644 index a85566a..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - AlgoKit React Template - - -
- - - - diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/jest.config.ts b/examples/production_beaker_react/projects/production_beaker_react-frontend/jest.config.ts deleted file mode 100644 index 28a8c3d..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/jest.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Config } from '@jest/types' - -const config: Config.InitialOptions = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/*.spec.ts', '**/*.spec.tsx'], - moduleDirectories: ['node_modules', 'src'], - transform: { - '': [ - 'ts-jest', - { - tsconfig: 'tsconfig.test.json', - }, - ], - }, - coveragePathIgnorePatterns: ['tests'], - testPathIgnorePatterns: ['/tests/'], - } - -export default config diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/package.json b/examples/production_beaker_react/projects/production_beaker_react-frontend/package.json deleted file mode 100644 index 771ddb7..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "production_beaker_react-frontend", - "version": "0.1.0", - "author": { - "name": "None", - "email": "None" - }, - "private": true, - "type": "module", - "engines": { - "node": ">=18.0", - "npm": ">=9.0" - }, - "devDependencies": { - "@algorandfoundation/algokit-client-generator": "^3.0.3", - "@types/node": "^18.17.14", - "@types/react": "^18.2.11", - "@types/react-dom": "^18.2.4", - "@vitejs/plugin-react": "^4.2.1", - "autoprefixer": "^10.4.14", - "eslint": "^8.42.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-prettier": "^5.0.0", - "@typescript-eslint/eslint-plugin": "^6.5.0", - "@typescript-eslint/parser": "^6.5.0", - "postcss": "^8.4.24", - "tailwindcss": "3.3.2", - "ts-jest": "^29.1.1", - "@types/jest": "29.5.2", - "ts-node": "^10.9.1", - "typescript": "^5.1.6", - "@playwright/test": "^1.35.0", - "playwright": "^1.35.0", - "vite": "^5.0.0" - }, - "dependencies": { - "@walletconnect/modal-sign-html": "^2.6.1", - "@algorandfoundation/algokit-utils": "^6.0.2", - "@blockshake/defly-connect": "^1.1.6", - "@daffiwallet/connect": "^1.0.3", - "@perawallet/connect": "^1.3.1", - "@txnlab/use-wallet": "^2.4.0", - "algosdk": "^2.7.0", - "daisyui": "^4.0.0", - "notistack": "^3.0.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "tslib": "^2.6.2" - }, - "scripts": { - "generate:app-clients": "algokit project link --all", - "dev": "npm run generate:app-clients && vite", - "build": "npm run generate:app-clients && tsc && vite build", - "test": "jest --coverage --passWithNoTests", - "playwright:test": "playwright test", - "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "lint:fix": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix", - "preview": "vite preview" - }, - "eslintConfig": { - "extends": [ - "react-app/jest", - "react-app" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/playwright.config.ts b/examples/production_beaker_react/projects/production_beaker_react-frontend/playwright.config.ts deleted file mode 100644 index d7cbca6..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/playwright.config.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { defineConfig, devices } from '@playwright/test' - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -// require('dotenv').config(); - -/** - * See https://playwright.dev/docs/test-configuration. - */ -export default defineConfig({ - testDir: './tests', - /* Run tests in files in parallel */ - fullyParallel: true, - /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, - /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - /* Base URL to use in actions like `await page.goto('/')`. */ - // baseURL: 'http://127.0.0.1:3000', - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', - testIdAttribute: 'data-test-id', - }, - - /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, - - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, - - /* Test against mobile viewports. */ - // { - // name: 'Mobile Chrome', - // use: { ...devices['Pixel 5'] }, - // }, - // { - // name: 'Mobile Safari', - // use: { ...devices['iPhone 12'] }, - // }, - - /* Test against branded browsers. */ - // { - // name: 'Microsoft Edge', - // use: { ...devices['Desktop Edge'], channel: 'msedge' }, - // }, - // { - // name: 'Google Chrome', - // use: { ..devices['Desktop Chrome'], channel: 'chrome' }, - // }, - ], - - /* Run your local dev server before starting the tests */ - webServer: { - command: 'npm run dev', - url: 'http://localhost:5173', - reuseExistingServer: !process.env.CI, - }, -}) diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/postcss.config.cjs b/examples/production_beaker_react/projects/production_beaker_react-frontend/postcss.config.cjs deleted file mode 100644 index 33ad091..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/postcss.config.cjs +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/public/index.html b/examples/production_beaker_react/projects/production_beaker_react-frontend/public/index.html deleted file mode 100644 index 0d3a3a5..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/public/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - React App - - - -
- - - diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/public/robots.txt b/examples/production_beaker_react/projects/production_beaker_react-frontend/public/robots.txt deleted file mode 100644 index e9e57dc..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/App.tsx b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/App.tsx deleted file mode 100644 index 58feddf..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/App.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { DeflyWalletConnect } from '@blockshake/defly-connect' -import { DaffiWalletConnect } from '@daffiwallet/connect' -import { PeraWalletConnect } from '@perawallet/connect' -import { PROVIDER_ID, ProvidersArray, WalletProvider, useInitializeProviders } from '@txnlab/use-wallet' -import algosdk from 'algosdk' -import { SnackbarProvider } from 'notistack' -import Home from './Home' -import { getAlgodConfigFromViteEnvironment, getKmdConfigFromViteEnvironment } from './utils/network/getAlgoClientConfigs' - -let providersArray: ProvidersArray -if (import.meta.env.VITE_ALGOD_NETWORK === '') { - const kmdConfig = getKmdConfigFromViteEnvironment() - providersArray = [ - { - id: PROVIDER_ID.KMD, - clientOptions: { - wallet: kmdConfig.wallet, - password: kmdConfig.password, - host: kmdConfig.server, - token: String(kmdConfig.token), - port: String(kmdConfig.port), - }, - }, - ] -} else { - providersArray = [ - { id: PROVIDER_ID.DEFLY, clientStatic: DeflyWalletConnect }, - { id: PROVIDER_ID.PERA, clientStatic: PeraWalletConnect }, - { id: PROVIDER_ID.DAFFI, clientStatic: DaffiWalletConnect }, - { id: PROVIDER_ID.EXODUS }, - // If you are interested in WalletConnect v2 provider - // refer to https://github.com/TxnLab/use-wallet for detailed integration instructions - ] -} - -export default function App() { - const algodConfig = getAlgodConfigFromViteEnvironment() - - const walletProviders = useInitializeProviders({ - providers: providersArray, - nodeConfig: { - network: algodConfig.network, - nodeServer: algodConfig.server, - nodePort: String(algodConfig.port), - nodeToken: String(algodConfig.token), - }, - algosdkStatic: algosdk, - }) - - return ( - - - - - - ) -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/Home.tsx b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/Home.tsx deleted file mode 100644 index 192f3b9..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/Home.tsx +++ /dev/null @@ -1,76 +0,0 @@ -// src/components/Home.tsx -import { useWallet } from '@txnlab/use-wallet' -import React, { useState } from 'react' -import ConnectWallet from './components/ConnectWallet' -import Transact from './components/Transact' -import AppCalls from './components/AppCalls' - -interface HomeProps {} - -const Home: React.FC = () => { - const [openWalletModal, setOpenWalletModal] = useState(false) - const [openDemoModal, setOpenDemoModal] = useState(false) - const [appCallsDemoModal, setAppCallsDemoModal] = useState(false) - const { activeAddress } = useWallet() - - const toggleWalletModal = () => { - setOpenWalletModal(!openWalletModal) - } - - const toggleDemoModal = () => { - setOpenDemoModal(!openDemoModal) - } - - const toggleAppCallsModal = () => { - setAppCallsDemoModal(!appCallsDemoModal) - } - - return ( -
-
-
-

- Welcome to
AlgoKit 🙂
-

-

- This starter has been generated using official AlgoKit React template. Refer to the resource below for next steps. -

- -
- - Getting started - - -
- - - {activeAddress && ( - - )} - - {activeAddress && ( - - )} -
- - - - -
-
-
- ) -} - -export default Home diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/assets/logo.svg b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/assets/logo.svg deleted file mode 100644 index 7169476..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/assets/logo.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/Account.tsx b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/Account.tsx deleted file mode 100644 index 6a6345e..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/Account.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { useWallet } from '@txnlab/use-wallet' -import { useMemo } from 'react' -import { ellipseAddress } from '../utils/ellipseAddress' -import { getAlgodConfigFromViteEnvironment } from '../utils/network/getAlgoClientConfigs' - -const Account = () => { - const { activeAddress } = useWallet() - const algoConfig = getAlgodConfigFromViteEnvironment() - - const dappFlowNetworkName = useMemo(() => { - return algoConfig.network === '' ? 'sandbox' : algoConfig.network.toLocaleLowerCase() - }, [algoConfig.network]) - - return ( -
- - Address: {ellipseAddress(activeAddress)} - -
Network: {algoConfig.network === '' ? 'localnet' : algoConfig.network}
-
- ) -} - -export default Account diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/AppCalls.tsx b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/AppCalls.tsx deleted file mode 100644 index c440768..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/AppCalls.tsx +++ /dev/null @@ -1,102 +0,0 @@ -import * as algokit from '@algorandfoundation/algokit-utils' -import { TransactionSignerAccount } from '@algorandfoundation/algokit-utils/types/account' -import { useWallet } from '@txnlab/use-wallet' -import { useSnackbar } from 'notistack' -import { useState } from 'react' -import { AppDetails } from '@algorandfoundation/algokit-utils/types/app-client' -import { HelloWorldClient } from '../contracts/hello_world' -import { OnSchemaBreak, OnUpdate } from '@algorandfoundation/algokit-utils/types/app' -import { getAlgodConfigFromViteEnvironment, getIndexerConfigFromViteEnvironment } from '../utils/network/getAlgoClientConfigs' - -interface AppCallsInterface { - openModal: boolean - setModalState: (value: boolean) => void -} - -const AppCalls = ({ openModal, setModalState }: AppCallsInterface) => { - const [loading, setLoading] = useState(false) - const [contractInput, setContractInput] = useState('') - - const algodConfig = getAlgodConfigFromViteEnvironment() - const algodClient = algokit.getAlgoClient({ - server: algodConfig.server, - port: algodConfig.port, - token: algodConfig.token, - }) - const indexerConfig = getIndexerConfigFromViteEnvironment() - const indexer = algokit.getAlgoIndexerClient({ - server: indexerConfig.server, - port: indexerConfig.port, - token: indexerConfig.token, - }) - - const { enqueueSnackbar } = useSnackbar() - const { signer, activeAddress } = useWallet() - - const sendAppCall = async () => { - setLoading(true) - - // Please note, in typical production scenarios, - // you wouldn't want to use deploy directly from your frontend. - // Instead, you would deploy your contract on your backend and reference it by id. - // Given the simplicity of the starter contract, we are deploying it on the frontend - // for demonstration purposes. - const appDetails = { - resolveBy: 'creatorAndName', - sender: { signer, addr: activeAddress } as TransactionSignerAccount, - creatorAddress: activeAddress, - findExistingUsing: indexer, - } as AppDetails - - const appClient = new HelloWorldClient(appDetails, algodClient) - const isLocal = await algokit.isLocalNet(algodClient) - const deployParams: Parameters[0] = { - allowDelete: isLocal, - allowUpdate: isLocal, - onSchemaBreak: isLocal ? OnSchemaBreak.ReplaceApp : OnSchemaBreak.Fail, - onUpdate: isLocal ? OnUpdate.UpdateApp : OnUpdate.Fail, - } - await appClient.deploy(deployParams).catch((e: Error) => { - enqueueSnackbar(`Error deploying the contract: ${e.message}`, { variant: 'error' }) - setLoading(false) - return - }) - - const response = await appClient.hello({ name: contractInput }).catch((e: Error) => { - enqueueSnackbar(`Error calling the contract: ${e.message}`, { variant: 'error' }) - setLoading(false) - return - }) - - enqueueSnackbar(`Response from the contract: ${response?.return}`, { variant: 'success' }) - setLoading(false) - } - - return ( - -
-

Say hello to your Algorand smart contract

-
- { - setContractInput(e.target.value) - }} - /> -
- - -
-
-
- ) -} - -export default AppCalls diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/ConnectWallet.tsx b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/ConnectWallet.tsx deleted file mode 100644 index c4225bc..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/ConnectWallet.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { Provider, useWallet } from '@txnlab/use-wallet' -import Account from './Account' - -interface ConnectWalletInterface { - openModal: boolean - closeModal: () => void -} - -const ConnectWallet = ({ openModal, closeModal }: ConnectWalletInterface) => { - const { providers, activeAddress } = useWallet() - - const isKmd = (provider: Provider) => provider.metadata.name.toLowerCase() === 'kmd' - - return ( - -
-

Select wallet provider

- -
- {activeAddress && ( - <> - -
- - )} - - {!activeAddress && - providers?.map((provider) => ( - - ))} -
- -
- - {activeAddress && ( - - )} -
- -
- ) -} -export default ConnectWallet diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/ErrorBoundary.tsx b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/ErrorBoundary.tsx deleted file mode 100644 index 435bf61..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/ErrorBoundary.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React, { ReactNode } from 'react' - -interface ErrorBoundaryProps { - children: ReactNode -} - -interface ErrorBoundaryState { - hasError: boolean - error: Error | null -} - -class ErrorBoundary extends React.Component { - constructor(props: ErrorBoundaryProps) { - super(props) - this.state = { hasError: false, error: null } - } - - static getDerivedStateFromError(error: Error): ErrorBoundaryState { - // Update state so the next render will show the fallback UI. - return { hasError: true, error: error } - } - - render(): ReactNode { - if (this.state.hasError) { - // You can render any custom fallback UI - return ( -
-
-
-

Error occured

-

- {this.state.error?.message.includes('Attempt to get default algod configuration') - ? 'Please make sure to set up your environment variables correctly. Create a .env file based on .env.template and fill in the required values. This controls the network and credentials for connections with Algod and Indexer.' - : this.state.error?.message} -

-
-
-
- ) - } - - return this.props.children - } -} - -export default ErrorBoundary diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/Transact.tsx b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/Transact.tsx deleted file mode 100644 index 16bd932..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/components/Transact.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import * as algokit from '@algorandfoundation/algokit-utils' -import { useWallet } from '@txnlab/use-wallet' -import algosdk from 'algosdk' -import { useSnackbar } from 'notistack' -import { useState } from 'react' -import { getAlgodConfigFromViteEnvironment } from '../utils/network/getAlgoClientConfigs' - -interface TransactInterface { - openModal: boolean - setModalState: (value: boolean) => void -} - -const Transact = ({ openModal, setModalState }: TransactInterface) => { - const [loading, setLoading] = useState(false) - const [receiverAddress, setReceiverAddress] = useState('') - - const algodConfig = getAlgodConfigFromViteEnvironment() - const algodClient = algokit.getAlgoClient({ - server: algodConfig.server, - port: algodConfig.port, - token: algodConfig.token, - }) - - const { enqueueSnackbar } = useSnackbar() - - const { signer, activeAddress, signTransactions, sendTransactions } = useWallet() - - const handleSubmitAlgo = async () => { - setLoading(true) - - if (!signer || !activeAddress) { - enqueueSnackbar('Please connect wallet first', { variant: 'warning' }) - return - } - - const suggestedParams = await algodClient.getTransactionParams().do() - - const transaction = algosdk.makePaymentTxnWithSuggestedParamsFromObject({ - from: activeAddress, - to: receiverAddress, - amount: 1e6, - suggestedParams, - }) - - const encodedTransaction = algosdk.encodeUnsignedTransaction(transaction) - - const signedTransactions = await signTransactions([encodedTransaction]) - - const waitRoundsToConfirm = 4 - - try { - enqueueSnackbar('Sending transaction...', { variant: 'info' }) - const { id } = await sendTransactions(signedTransactions, waitRoundsToConfirm) - enqueueSnackbar(`Transaction sent: ${id}`, { variant: 'success' }) - setReceiverAddress('') - } catch (e) { - enqueueSnackbar('Failed to send transaction', { variant: 'error' }) - } - - setLoading(false) - } - - return ( - -
-

Send payment transaction

-
- { - setReceiverAddress(e.target.value) - }} - /> -
- - -
-
-
- ) -} - -export default Transact diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/contracts/README.md b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/contracts/README.md deleted file mode 100644 index 04629b1..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/contracts/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## How to connect my web app with Algorand smart contracts? - -The following folder is reserved for the Algorand Application Clients. The clients are used to interact with instances of Algorand Smart Contracts (ASC1s) deployed on-chain. - -To integrate this react frontend template with your smart contracts codebase, perform the following steps: - -1. Generate the typed client using `algokit generate client -l typescript -o {path/to/this/folder}` or using the dedicated `link` command `algokit project link` (ensure to invoke it from the root of this react project). Using the `link` command is especially useful within workspaces that have multiple contract projects. -2. The generated typescript client should be ready to be imported and used in this react frontend template, making it a full fledged dApp. - -> Please note, by default this template defines `"generate:app-clients": "algokit project link --all"` which is a shortcut to automatically link TEAL code from all `contract` projects in the workspace as typed clients into the `frontend` project that is invoking the `link` command. Refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/link.md) to read more about `link` command. - -## **How to interact with the smart contract?** - -The generated client provides a set of functions that can be used to interact with the ABI (Application Binary Interface) compliant Algorand smart contract. For example, if the smart contract has a function called `hello`, the generated client will have a function called `hello` that can be used to interact with the smart contract. Refer to a [full-stack end-to-end starter template](https://github.com/algorandfoundation/algokit-fullstack-template) for a reference example on invoking and interacting with typescript typed clients generated. diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/contracts/hello_world.ts b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/contracts/hello_world.ts deleted file mode 100644 index 790466b..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/contracts/hello_world.ts +++ /dev/null @@ -1,605 +0,0 @@ -/* eslint-disable */ -/** - * This file was automatically generated by @algorandfoundation/algokit-client-generator. - * DO NOT MODIFY IT BY HAND. - * requires: @algorandfoundation/algokit-utils: ^2 - */ -import * as algokit from '@algorandfoundation/algokit-utils' -import type { - ABIAppCallArg, - AppCallTransactionResult, - AppCallTransactionResultOfType, - AppCompilationResult, - AppReference, - AppState, - AppStorageSchema, - CoreAppCallArgs, - RawAppCallArgs, - TealTemplateParams, -} from '@algorandfoundation/algokit-utils/types/app' -import type { - AppClientCallCoreParams, - AppClientCompilationParams, - AppClientDeployCoreParams, - AppDetails, - ApplicationClient, -} from '@algorandfoundation/algokit-utils/types/app-client' -import type { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec' -import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, SendTransactionParams } from '@algorandfoundation/algokit-utils/types/transaction' -import type { ABIResult, TransactionWithSigner } from 'algosdk' -import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk' -export const APP_SPEC: AppSpec = { - "hints": { - "hello(string)string": { - "call_config": { - "no_op": "CALL" - } - } - }, - "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDgKaW50Y2Jsb2NrIDAgMQpieXRlY2Jsb2NrIDB4CnR4biBOdW1BcHBBcmdzCmludGNfMCAvLyAwCj09CmJueiBtYWluX2w0CnR4bmEgQXBwbGljYXRpb25BcmdzIDAKcHVzaGJ5dGVzIDB4MDJiZWNlMTEgLy8gImhlbGxvKHN0cmluZylzdHJpbmciCj09CmJueiBtYWluX2wzCmVycgptYWluX2wzOgp0eG4gT25Db21wbGV0aW9uCmludGNfMCAvLyBOb09wCj09CnR4biBBcHBsaWNhdGlvbklECmludGNfMCAvLyAwCiE9CiYmCmFzc2VydApjYWxsc3ViIGhlbGxvY2FzdGVyXzMKaW50Y18xIC8vIDEKcmV0dXJuCm1haW5fbDQ6CnR4biBPbkNvbXBsZXRpb24KaW50Y18wIC8vIE5vT3AKPT0KYm56IG1haW5fbDEwCnR4biBPb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IC0xCmV4dHJhY3QgMiAwCmNvbmNhdApmcmFtZV9idXJ5IDAKZnJhbWVfZGlnIDAKbGVuCml0b2IKZXh0cmFjdCA2IDAKZnJhbWVfZGlnIDAKY29uY2F0CmZyYW1lX2J1cnkgMApyZXRzdWIKCi8vIGhlbGxvX2Nhc3RlcgpoZWxsb2Nhc3Rlcl8zOgpwcm90byAwIDAKYnl0ZWNfMCAvLyAiIgpkdXAKdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQpmcmFtZV9idXJ5IDEKZnJhbWVfZGlnIDEKY2FsbHN1YiBoZWxsb18yCmZyYW1lX2J1cnkgMApwdXNoYnl0ZXMgMHgxNTFmN2M3NSAvLyAweDE1MWY3Yzc1CmZyYW1lX2RpZyAwCmNvbmNhdApsb2cKcmV0c3Vi", - "clear": "I3ByYWdtYSB2ZXJzaW9uIDgKcHVzaGludCAwIC8vIDAKcmV0dXJu" - }, - "state": { - "global": { - "num_byte_slices": 0, - "num_uints": 0 - }, - "local": { - "num_byte_slices": 0, - "num_uints": 0 - } - }, - "schema": { - "global": { - "declared": {}, - "reserved": {} - }, - "local": { - "declared": {}, - "reserved": {} - } - }, - "contract": { - "name": "hello_world", - "methods": [ - { - "name": "hello", - "args": [ - { - "type": "string", - "name": "name" - } - ], - "returns": { - "type": "string" - } - } - ], - "networks": {} - }, - "bare_call_config": { - "delete_application": "CALL", - "no_op": "CREATE", - "update_application": "CALL" - } -} - -/** - * Defines an onCompletionAction of 'no_op' - */ -export type OnCompleteNoOp = { onCompleteAction?: 'no_op' | OnApplicationComplete.NoOpOC } -/** - * Defines an onCompletionAction of 'opt_in' - */ -export type OnCompleteOptIn = { onCompleteAction: 'opt_in' | OnApplicationComplete.OptInOC } -/** - * Defines an onCompletionAction of 'close_out' - */ -export type OnCompleteCloseOut = { onCompleteAction: 'close_out' | OnApplicationComplete.CloseOutOC } -/** - * Defines an onCompletionAction of 'delete_application' - */ -export type OnCompleteDelApp = { onCompleteAction: 'delete_application' | OnApplicationComplete.DeleteApplicationOC } -/** - * Defines an onCompletionAction of 'update_application' - */ -export type OnCompleteUpdApp = { onCompleteAction: 'update_application' | OnApplicationComplete.UpdateApplicationOC } -/** - * A state record containing a single unsigned integer - */ -export type IntegerState = { - /** - * Gets the state value as a BigInt. - */ - asBigInt(): bigint - /** - * Gets the state value as a number. - */ - asNumber(): number -} -/** - * A state record containing binary data - */ -export type BinaryState = { - /** - * Gets the state value as a Uint8Array - */ - asByteArray(): Uint8Array - /** - * Gets the state value as a string - */ - asString(): string -} - -export type AppCreateCallTransactionResult = AppCallTransactionResult & Partial & AppReference -export type AppUpdateCallTransactionResult = AppCallTransactionResult & Partial - -export type AppClientComposeCallCoreParams = Omit & { - sendParams?: Omit -} -export type AppClientComposeExecuteParams = Pick - -export type IncludeSchema = { - /** - * Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used. - */ - schema?: Partial -} - -/** - * Defines the types of available calls and state of the HelloWorld smart contract. - */ -export type HelloWorld = { - /** - * Maps method signatures / names to their argument and return types. - */ - methods: - & Record<'hello(string)string' | 'hello', { - argsObj: { - name: string - } - argsTuple: [name: string] - returns: string - }> -} -/** - * Defines the possible abi call signatures - */ -export type HelloWorldSig = keyof HelloWorld['methods'] -/** - * Defines an object containing all relevant parameters for a single call to the contract. Where TSignature is undefined, a bare call is made - */ -export type TypedCallParams = { - method: TSignature - methodArgs: TSignature extends undefined ? undefined : Array -} & AppClientCallCoreParams & CoreAppCallArgs -/** - * Defines the arguments required for a bare call - */ -export type BareCallArgs = Omit -/** - * Maps a method signature from the HelloWorld smart contract to the method's arguments in either tuple of struct form - */ -export type MethodArgs = HelloWorld['methods'][TSignature]['argsObj' | 'argsTuple'] -/** - * Maps a method signature from the HelloWorld smart contract to the method's return type - */ -export type MethodReturn = HelloWorld['methods'][TSignature]['returns'] - -/** - * A factory for available 'create' calls - */ -export type HelloWorldCreateCalls = (typeof HelloWorldCallFactory)['create'] -/** - * Defines supported create methods for this smart contract - */ -export type HelloWorldCreateCallParams = - | (TypedCallParams & (OnCompleteNoOp)) -/** - * A factory for available 'update' calls - */ -export type HelloWorldUpdateCalls = (typeof HelloWorldCallFactory)['update'] -/** - * Defines supported update methods for this smart contract - */ -export type HelloWorldUpdateCallParams = - | TypedCallParams -/** - * A factory for available 'delete' calls - */ -export type HelloWorldDeleteCalls = (typeof HelloWorldCallFactory)['delete'] -/** - * Defines supported delete methods for this smart contract - */ -export type HelloWorldDeleteCallParams = - | TypedCallParams -/** - * Defines arguments required for the deploy method. - */ -export type HelloWorldDeployArgs = { - deployTimeParams?: TealTemplateParams - /** - * A delegate which takes a create call factory and returns the create call params for this smart contract - */ - createCall?: (callFactory: HelloWorldCreateCalls) => HelloWorldCreateCallParams - /** - * A delegate which takes a update call factory and returns the update call params for this smart contract - */ - updateCall?: (callFactory: HelloWorldUpdateCalls) => HelloWorldUpdateCallParams - /** - * A delegate which takes a delete call factory and returns the delete call params for this smart contract - */ - deleteCall?: (callFactory: HelloWorldDeleteCalls) => HelloWorldDeleteCallParams -} - - -/** - * Exposes methods for constructing all available smart contract calls - */ -export abstract class HelloWorldCallFactory { - /** - * Gets available create call factories - */ - static get create() { - return { - /** - * Constructs a create call for the hello_world smart contract using a bare call - * - * @param params Any parameters for the call - * @returns A TypedCallParams object for the call - */ - bare(params: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs & AppClientCompilationParams & (OnCompleteNoOp) = {}) { - return { - method: undefined, - methodArgs: undefined, - ...params, - } - }, - } - } - - /** - * Gets available update call factories - */ - static get update() { - return { - /** - * Constructs an update call for the hello_world smart contract using a bare call - * - * @param params Any parameters for the call - * @returns A TypedCallParams object for the call - */ - bare(params: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs & AppClientCompilationParams = {}) { - return { - method: undefined, - methodArgs: undefined, - ...params, - } - }, - } - } - - /** - * Gets available delete call factories - */ - static get delete() { - return { - /** - * Constructs a delete call for the hello_world smart contract using a bare call - * - * @param params Any parameters for the call - * @returns A TypedCallParams object for the call - */ - bare(params: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs = {}) { - return { - method: undefined, - methodArgs: undefined, - ...params, - } - }, - } - } - - /** - * Constructs a no op call for the hello(string)string ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - static hello(args: MethodArgs<'hello(string)string'>, params: AppClientCallCoreParams & CoreAppCallArgs) { - return { - method: 'hello(string)string' as const, - methodArgs: Array.isArray(args) ? args : [args.name], - ...params, - } - } -} - -/** - * A client to make calls to the hello_world smart contract - */ -export class HelloWorldClient { - /** - * The underlying `ApplicationClient` for when you want to have more flexibility - */ - public readonly appClient: ApplicationClient - - private readonly sender: SendTransactionFrom | undefined - - /** - * Creates a new instance of `HelloWorldClient` - * - * @param appDetails appDetails The details to identify the app to deploy - * @param algod An algod client instance - */ - constructor(appDetails: AppDetails, private algod: Algodv2) { - this.sender = appDetails.sender - this.appClient = algokit.getAppClient({ - ...appDetails, - app: APP_SPEC - }, algod) - } - - /** - * Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type - * - * @param result The AppCallTransactionResult to be mapped - * @param returnValueFormatter An optional delegate to format the return value if required - * @returns The smart contract response with an updated return value - */ - protected mapReturnValue(result: AppCallTransactionResult, returnValueFormatter?: (value: any) => TReturn): AppCallTransactionResultOfType & TResult { - if(result.return?.decodeError) { - throw result.return.decodeError - } - const returnValue = result.return?.returnValue !== undefined && returnValueFormatter !== undefined - ? returnValueFormatter(result.return.returnValue) - : result.return?.returnValue as TReturn | undefined - return { ...result, return: returnValue } as AppCallTransactionResultOfType & TResult - } - - /** - * Calls the ABI method with the matching signature using an onCompletion code of NO_OP - * - * @param typedCallParams An object containing the method signature, args, and any other relevant parameters - * @param returnValueFormatter An optional delegate which when provided will be used to map non-undefined return values to the target type - * @returns The result of the smart contract call - */ - public async call(typedCallParams: TypedCallParams, returnValueFormatter?: (value: any) => MethodReturn) { - return this.mapReturnValue>(await this.appClient.call(typedCallParams), returnValueFormatter) - } - - /** - * Idempotently deploys the hello_world smart contract. - * - * @param params The arguments for the contract calls and any additional parameters for the call - * @returns The deployment result - */ - public deploy(params: HelloWorldDeployArgs & AppClientDeployCoreParams & IncludeSchema = {}): ReturnType { - const createArgs = params.createCall?.(HelloWorldCallFactory.create) - const updateArgs = params.updateCall?.(HelloWorldCallFactory.update) - const deleteArgs = params.deleteCall?.(HelloWorldCallFactory.delete) - return this.appClient.deploy({ - ...params, - updateArgs, - deleteArgs, - createArgs, - createOnCompleteAction: createArgs?.onCompleteAction, - }) - } - - /** - * Gets available create methods - */ - public get create() { - const $this = this - return { - /** - * Creates a new instance of the hello_world smart contract using a bare call. - * - * @param args The arguments for the bare call - * @returns The create result - */ - async bare(args: BareCallArgs & AppClientCallCoreParams & AppClientCompilationParams & IncludeSchema & CoreAppCallArgs & (OnCompleteNoOp) = {}) { - return $this.mapReturnValue(await $this.appClient.create(args)) - }, - } - } - - /** - * Gets available update methods - */ - public get update() { - const $this = this - return { - /** - * Updates an existing instance of the hello_world smart contract using a bare call. - * - * @param args The arguments for the bare call - * @returns The update result - */ - async bare(args: BareCallArgs & AppClientCallCoreParams & AppClientCompilationParams & CoreAppCallArgs = {}) { - return $this.mapReturnValue(await $this.appClient.update(args)) - }, - } - } - - /** - * Gets available delete methods - */ - public get delete() { - const $this = this - return { - /** - * Deletes an existing instance of the hello_world smart contract using a bare call. - * - * @param args The arguments for the bare call - * @returns The delete result - */ - async bare(args: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs = {}) { - return $this.mapReturnValue(await $this.appClient.delete(args)) - }, - } - } - - /** - * Makes a clear_state call to an existing instance of the hello_world smart contract. - * - * @param args The arguments for the bare call - * @returns The clear_state result - */ - public clearState(args: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.appClient.clearState(args) - } - - /** - * Calls the hello(string)string ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The result of the call - */ - public hello(args: MethodArgs<'hello(string)string'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.call(HelloWorldCallFactory.hello(args, params)) - } - - public compose(): HelloWorldComposer { - const client = this - const atc = new AtomicTransactionComposer() - let promiseChain:Promise = Promise.resolve() - const resultMappers: Array any)> = [] - return { - hello(args: MethodArgs<'hello(string)string'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.hello(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - get update() { - const $this = this - return { - bare(args?: BareCallArgs & AppClientComposeCallCoreParams & AppClientCompilationParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.update.bare({...args, sendParams: {...args?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return $this - }, - } - }, - get delete() { - const $this = this - return { - bare(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.delete.bare({...args, sendParams: {...args?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return $this - }, - } - }, - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.clearState({...args, sendParams: {...args?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom) { - promiseChain = promiseChain.then(async () => atc.addTransaction(await algokit.getTransactionWithSigner(txn, defaultSender ?? client.sender))) - return this - }, - async atc() { - await promiseChain - return atc - }, - async simulate(options?: SimulateOptions) { - await promiseChain - const result = await atc.simulate(client.algod, new modelsv2.SimulateRequest({ txnGroups: [], ...options })) - return { - ...result, - returns: result.methodResults?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - }, - async execute(sendParams?: AppClientComposeExecuteParams) { - await promiseChain - const result = await algokit.sendAtomicTransactionComposer({ atc, sendParams }, client.algod) - return { - ...result, - returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - } - } as unknown as HelloWorldComposer - } -} -export type HelloWorldComposer = { - /** - * Calls the hello(string)string ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - hello(args: MethodArgs<'hello(string)string'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): HelloWorldComposer<[...TReturns, MethodReturn<'hello(string)string'>]> - - /** - * Gets available update methods - */ - readonly update: { - /** - * Updates an existing instance of the hello_world smart contract using a bare call. - * - * @param args The arguments for the bare call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - bare(args?: BareCallArgs & AppClientComposeCallCoreParams & AppClientCompilationParams & CoreAppCallArgs): HelloWorldComposer<[...TReturns, undefined]> - } - - /** - * Gets available delete methods - */ - readonly delete: { - /** - * Deletes an existing instance of the hello_world smart contract using a bare call. - * - * @param args The arguments for the bare call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - bare(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs): HelloWorldComposer<[...TReturns, undefined]> - } - - /** - * Makes a clear_state call to an existing instance of the hello_world smart contract. - * - * @param args The arguments for the bare call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs): HelloWorldComposer<[...TReturns, undefined]> - - /** - * Adds a transaction to the composer - * - * @param txn One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by one of algokit utils helpers (signer is obtained from the defaultSender parameter) - * @param defaultSender The default sender to be used to obtain a signer where the object provided to the transaction parameter does not include a signer. - */ - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom): HelloWorldComposer - /** - * Returns the underlying AtomicTransactionComposer instance - */ - atc(): Promise - /** - * Simulates the transaction group and returns the result - */ - simulate(options?: SimulateOptions): Promise> - /** - * Executes the transaction group and returns the results - */ - execute(sendParams?: AppClientComposeExecuteParams): Promise> -} -export type SimulateOptions = Omit[0], 'txnGroups'> -export type HelloWorldComposerSimulateResult = { - returns: TReturns - methodResults: ABIResult[] - simulateResponse: modelsv2.SimulateResponse -} -export type HelloWorldComposerResults = { - returns: TReturns - groupId: string - txIds: string[] - transactions: Transaction[] -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/interfaces/network.ts b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/interfaces/network.ts deleted file mode 100644 index a458edc..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/interfaces/network.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { AlgoClientConfig } from '@algorandfoundation/algokit-utils/types/network-client' -import type { TokenHeader } from 'algosdk/dist/types/client/urlTokenBaseHTTPClient' - -export interface AlgoViteClientConfig extends AlgoClientConfig { - /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */ - server: string - /** The port to use e.g. 4001, 443, etc. */ - port: string | number - /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */ - token: string | TokenHeader - /** String representing current Algorand Network type (testnet/mainnet and etc) */ - network: string -} - -export interface AlgoViteKMDConfig extends AlgoClientConfig { - /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */ - server: string - /** The port to use e.g. 4001, 443, etc. */ - port: string | number - /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */ - token: string | TokenHeader - /** KMD wallet name */ - wallet: string - /** KMD wallet password */ - password: string -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/main.tsx b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/main.tsx deleted file mode 100644 index adf72ec..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/main.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App' -import './styles/main.css' -import ErrorBoundary from './components/ErrorBoundary' - -ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - - - - - , -) diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/styles/main.css b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/styles/main.css deleted file mode 100644 index b5c61c9..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/styles/main.css +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/ellipseAddress.spec.tsx b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/ellipseAddress.spec.tsx deleted file mode 100644 index 2cbff10..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/ellipseAddress.spec.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { ellipseAddress } from './ellipseAddress' - -describe('ellipseAddress', () => { - it('should return ellipsed address with specified width', () => { - const address = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - const result = ellipseAddress(address, 4) - expect(result).toBe('aaaa...aaaa') - }) - - it('should return empty string when address is empty', () => { - const address = '' - const result = ellipseAddress(address) - expect(result).toBe('') - }) -}) diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/ellipseAddress.ts b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/ellipseAddress.ts deleted file mode 100644 index 542f46f..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/ellipseAddress.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function ellipseAddress(address = ``, width = 6): string { - return address ? `${address.slice(0, width)}...${address.slice(-width)}` : address -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/network/getAlgoClientConfigs.ts b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/network/getAlgoClientConfigs.ts deleted file mode 100644 index b5121f8..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/utils/network/getAlgoClientConfigs.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { AlgoViteClientConfig, AlgoViteKMDConfig } from '../../interfaces/network' - -export function getAlgodConfigFromViteEnvironment(): AlgoViteClientConfig { - if (!import.meta.env.VITE_ALGOD_SERVER) { - throw new Error('Attempt to get default algod configuration without specifying VITE_ALGOD_SERVER in the environment variables') - } - - return { - server: import.meta.env.VITE_ALGOD_SERVER, - port: import.meta.env.VITE_ALGOD_PORT, - token: import.meta.env.VITE_ALGOD_TOKEN, - network: import.meta.env.VITE_ALGOD_NETWORK, - } -} - -export function getIndexerConfigFromViteEnvironment(): AlgoViteClientConfig { - if (!import.meta.env.VITE_INDEXER_SERVER) { - throw new Error('Attempt to get default algod configuration without specifying VITE_INDEXER_SERVER in the environment variables') - } - - return { - server: import.meta.env.VITE_INDEXER_SERVER, - port: import.meta.env.VITE_INDEXER_PORT, - token: import.meta.env.VITE_INDEXER_TOKEN, - network: import.meta.env.VITE_ALGOD_NETWORK, - } -} - -export function getKmdConfigFromViteEnvironment(): AlgoViteKMDConfig { - if (!import.meta.env.VITE_KMD_SERVER) { - throw new Error('Attempt to get default kmd configuration without specifying VITE_KMD_SERVER in the environment variables') - } - - return { - server: import.meta.env.VITE_KMD_SERVER, - port: import.meta.env.VITE_KMD_PORT, - token: import.meta.env.VITE_KMD_TOKEN, - wallet: import.meta.env.VITE_KMD_WALLET, - password: import.meta.env.VITE_KMD_PASSWORD, - } -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/vite-env.d.ts b/examples/production_beaker_react/projects/production_beaker_react-frontend/src/vite-env.d.ts deleted file mode 100644 index 67c2d30..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/src/vite-env.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/// - -interface ImportMetaEnv { - readonly VITE_ENVIRONMENT: string - - readonly VITE_ALGOD_TOKEN: string - readonly VITE_ALGOD_SERVER: string - readonly VITE_ALGOD_PORT: string - readonly VITE_ALGOD_NETWORK: string - - readonly VITE_INDEXER_TOKEN: string - readonly VITE_INDEXER_SERVER: string - readonly VITE_INDEXER_PORT: string - - readonly VITE_KMD_TOKEN: string - readonly VITE_KMD_SERVER: string - readonly VITE_KMD_PORT: string - readonly VITE_KMD_PASSWORD: string - readonly VITE_KMD_WALLET: string -} - -interface ImportMeta { - readonly env: ImportMetaEnv -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/tailwind.config.js b/examples/production_beaker_react/projects/production_beaker_react-frontend/tailwind.config.js deleted file mode 100644 index a9f7a95..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/tailwind.config.js +++ /dev/null @@ -1,11 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: ['./src/**/*.{js,ts,jsx,tsx}'], - theme: { - extend: {}, - }, - daisyui: { - themes: ['lofi'], - }, - plugins: [require('daisyui')], - } diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/tests/example.spec.ts b/examples/production_beaker_react/projects/production_beaker_react-frontend/tests/example.spec.ts deleted file mode 100644 index df83322..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/tests/example.spec.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { randomAccount } from '@algorandfoundation/algokit-utils' -import { expect, test } from '@playwright/test' - -test.beforeEach(async ({ page }) => { - await page.goto('http://localhost:5173/') -}) - -test('has title', async ({ page }) => { - // Expect a title "to contain" a substring. - await expect(page).toHaveTitle('AlgoKit React Template') -}) - -test('get started link', async ({ page }) => { - await expect(page.getByTestId('getting-started')).toHaveText('Getting started') -}) - -test('authentication and dummy payment transaction', async ({ page }) => { - page.on('dialog', async (dialog) => { - dialog.message() === 'KMD password' ? await dialog.accept() : await dialog.dismiss() - }) - - // 1. Must be able to connect to a KMD wallet provider - await page.getByTestId('connect-wallet').click() - await page.getByTestId('kmd-connect').click() - await page.getByTestId('close-wallet-modal').click() - - // 2. Must be able to send a dummy payment transaction - await page.getByTestId('transactions-demo').click() - - const dummyAccount = randomAccount() - await page.getByTestId('receiver-address').fill(dummyAccount.addr) - await page.getByTestId('send-algo').click() - - // 3. Must be able to see a notification that the transaction was sent - const notification = await page.getByText('Transaction sent:') - await notification.waitFor() - expect(notification).toBeTruthy() -}) diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/tsconfig.json b/examples/production_beaker_react/projects/production_beaker_react-frontend/tsconfig.json deleted file mode 100644 index 5cde02a..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/tsconfig.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - "module": "ES2022" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - "declaration": true /* Generates corresponding '.d.ts' file. */, - "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, - "sourceMap": true /* Generates corresponding '.map' file. */, - "strict": true /* Enable all strict type-checking options. */, - "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, - "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */, - "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */, - "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, - "allowJs": false, - "allowSyntheticDefaultImports": true, - "moduleResolution": "Node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - "outDir": "./dist/" - }, - "include": [ - "src/**/*.ts", - "src/**/*.tsx", - "vite.config.js", - "src/utils/ellipseAddress.spec.tsx", - "src/utils/ellipseAddress.spec.tsx", - "src/main.tsx", - ], - "references": [ - { - "path": "./tsconfig.node.json" - } - ] -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/tsconfig.node.json b/examples/production_beaker_react/projects/production_beaker_react-frontend/tsconfig.node.json deleted file mode 100644 index 9d31e2a..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/tsconfig.node.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "module": "ESNext", - "moduleResolution": "Node", - "allowSyntheticDefaultImports": true - }, - "include": ["vite.config.ts"] -} diff --git a/examples/production_beaker_react/projects/production_beaker_react-frontend/vite.config.ts b/examples/production_beaker_react/projects/production_beaker_react-frontend/vite.config.ts deleted file mode 100644 index 36f7f4e..0000000 --- a/examples/production_beaker_react/projects/production_beaker_react-frontend/vite.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import react from '@vitejs/plugin-react' -import { defineConfig } from 'vite' - -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react()], -}) diff --git a/examples/production_python_react/.github/workflows/production-python-react-contracts-ci.yaml b/examples/production_python_react/.github/workflows/production-python-react-contracts-ci.yaml index 5e9c494..67097ff 100644 --- a/examples/production_python_react/.github/workflows/production-python-react-contracts-ci.yaml +++ b/examples/production_python_react/.github/workflows/production-python-react-contracts-ci.yaml @@ -52,8 +52,12 @@ jobs: - name: Scan TEAL files for issues run: algokit project run audit-teal --project-name 'production_python_react-contracts' - - name: Check output stability of the smart contracts - run: algokit project run ci-teal-diff --project-name 'production_python_react-contracts' + # # Uncomment to enable TEAL static analysis with snapshoting using Tealer package + # # Would first require running locally using audit-teal command and committing the snapshots into source control + # # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here: + # # https://github.com/crytic/tealer/issues/101 + # - name: Check output stability of the smart contracts + # run: algokit project run ci-teal-diff --project-name 'production_python_react-contracts' - name: Run deployer against LocalNet run: algokit project deploy localnet --project-name 'production_python_react-contracts' diff --git a/examples/production_python_react/projects/production_python_react-contracts/.algokit.toml b/examples/production_python_react/projects/production_python_react-contracts/.algokit.toml index 2b13c8e..172e5dd 100644 --- a/examples/production_python_react/projects/production_python_react-contracts/.algokit.toml +++ b/examples/production_python_react/projects/production_python_react-contracts/.algokit.toml @@ -33,8 +33,7 @@ test = { commands = [ 'poetry run pytest', ], description = 'Run smart contract tests' } audit = { commands = [ - 'poetry export --without=dev -o requirements.txt', - 'poetry run pip-audit -r requirements.txt', + 'poetry run pip-audit', ], description = 'Audit with pip-audit' } lint = { commands = [ 'poetry run black --check --diff .', diff --git a/examples/production_python_react/projects/production_python_react-contracts/.algokit/.copier-answers.yml b/examples/production_python_react/projects/production_python_react-contracts/.algokit/.copier-answers.yml index 76e0cc2..196fdd6 100644 --- a/examples/production_python_react/projects/production_python_react-contracts/.algokit/.copier-answers.yml +++ b/examples/production_python_react/projects/production_python_react-contracts/.algokit/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 1.2.4 +_commit: 1.3.3 _src_path: gh:algorandfoundation/algokit-python-template author_email: None author_name: None diff --git a/examples/production_python_react/projects/production_python_react-contracts/.gitignore b/examples/production_python_react/projects/production_python_react-contracts/.gitignore index a858d63..070829c 100644 --- a/examples/production_python_react/projects/production_python_react-contracts/.gitignore +++ b/examples/production_python_react/projects/production_python_react-contracts/.gitignore @@ -176,5 +176,5 @@ node_modules # AlgoKit debug_traces/ -.algokit/static-analysis/tealer/ +.algokit/static-analysis/ # Replace with .algokit/static-analysis/tealer/ to enable snapshot checks in CI .algokit/sources diff --git a/examples/production_python_react/projects/production_python_react-contracts/.tours/getting-started-with-your-algokit-project.tour b/examples/production_python_react/projects/production_python_react-contracts/.tours/getting-started-with-your-algokit-project.tour index 6d0f8b2..48867d6 100644 --- a/examples/production_python_react/projects/production_python_react-contracts/.tours/getting-started-with-your-algokit-project.tour +++ b/examples/production_python_react/projects/production_python_react-contracts/.tours/getting-started-with-your-algokit-project.tour @@ -46,7 +46,7 @@ "file": "smart_contracts/__main__.py", "description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin available on the [VSCode Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.", "line": 15 - } + }, { "file": "smart_contracts/_helpers/__init__.py", "description": "This folder contains helper scripts for contract management. These automate tasks like compiling, generating clients, and deploying. Usually, you won't need to edit these files, but advanced users can expand them for custom needs.", diff --git a/examples/production_python_react/projects/production_python_react-contracts/README.md b/examples/production_python_react/projects/production_python_react-contracts/README.md index 67c45b6..21a3499 100644 --- a/examples/production_python_react/projects/production_python_react-contracts/README.md +++ b/examples/production_python_react/projects/production_python_react-contracts/README.md @@ -35,8 +35,10 @@ Run the following commands within the project folder: #### Terminal Directly manage and interact with your project using AlgoKit commands: -1. **Build Contracts**: `algokit project run build` compiles all smart contracts. -2. **Deploy**: Use `algokit project deploy localnet` to deploy contracts to the local network. +1. **Build Contracts**: `algokit project run build` compiles all smart contracts. You can also specify a specific contract by passing the name of the contract folder as an extra argument. +For example: `algokit project run build -- hello_world` will only build the `hello_world` contract. +2. **Deploy**: Use `algokit project deploy localnet` to deploy contracts to the local network. You can also specify a specific contract by passing the name of the contract folder as an extra argument. +For example: `algokit project deploy localnet -- hello_world` will only deploy the `hello_world` contract. #### VS Code For a seamless experience with breakpoint debugging and other features: @@ -123,9 +125,11 @@ For pull requests and pushes to `main` branch against this repository the follow - - `Algorand Python` smart contract unit tests, that are run using [`algorand-python-testing`](https://pypi.org/project/algorand-python-testing/), which are executed in a Python intepreter emulating major AVM behaviour - - Python `ApplicationClient` tests that are run against `algokit localnet` and test the behaviour in a real network enviornment - Smart contract artifacts are built - - Smart contract artifacts are checked for [output stability](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/articles/output_stability.md) + - Smart contract artifacts are checked for [output stability](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/articles/output_stability.md). - Smart contract is deployed to a AlgoKit LocalNet instance +> NOTE: By default smart contract artifacts are compiled with `--debug-level` set to 0, to change this, modify the compiler invocation under `smart_contracts/_helpers/build.py` + #### Continuous Deployment For pushes to `main` branch, after the above checks pass, the following deployment actions are performed: diff --git a/examples/production_python_react/projects/production_python_react-contracts/pyproject.toml b/examples/production_python_react/projects/production_python_react-contracts/pyproject.toml index bf78dd3..2cc3238 100644 --- a/examples/production_python_react/projects/production_python_react-contracts/pyproject.toml +++ b/examples/production_python_react/projects/production_python_react-contracts/pyproject.toml @@ -9,14 +9,14 @@ readme = "README.md" python = "^3.12" algokit-utils = "^2.3.0" python-dotenv = "^1.0.0" -algorand-python = "^1.0.0" -algorand-python-testing = "^0.2.1" +algorand-python = "^2.0.0" +algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] algokit-client-generator = "^1.1.3" black = {extras = ["d"], version = "*"} ruff = "^0.1.6" -mypy = "*" +mypy = "1.11.0" pytest = "*" pytest-cov = "*" pip-audit = "*" diff --git a/examples/production_python_react/projects/production_python_react-contracts/smart_contracts/__main__.py b/examples/production_python_react/projects/production_python_react-contracts/smart_contracts/__main__.py index ab2e910..9c691ba 100644 --- a/examples/production_python_react/projects/production_python_react-contracts/smart_contracts/__main__.py +++ b/examples/production_python_react/projects/production_python_react-contracts/smart_contracts/__main__.py @@ -24,16 +24,21 @@ root_path = Path(__file__).parent -def main(action: str) -> None: +def main(action: str, contract_name: str | None = None) -> None: artifact_path = root_path / "artifacts" + + # Filter contracts if a specific contract name is provided + filtered_contracts = [ + c for c in contracts if contract_name is None or c.name == contract_name + ] + match action: case "build": - for contract in contracts: + for contract in filtered_contracts: logger.info(f"Building app at {contract.path}") build(artifact_path / contract.name, contract.path) case "deploy": - for contract in contracts: - logger.info(f"Deploying app {contract.name}") + for contract in filtered_contracts: output_dir = artifact_path / contract.name app_spec_file_name = next( ( @@ -47,18 +52,21 @@ def main(action: str) -> None: raise Exception("Could not deploy app, .arc32.json file not found") app_spec_path = output_dir / app_spec_file_name if contract.deploy: + logger.info(f"Deploying app {contract.name}") deploy(app_spec_path, contract.deploy) case "all": - for contract in contracts: + for contract in filtered_contracts: logger.info(f"Building app at {contract.path}") app_spec_path = build(artifact_path / contract.name, contract.path) - logger.info(f"Deploying {contract.path.name}") if contract.deploy: + logger.info(f"Deploying {contract.path.name}") deploy(app_spec_path, contract.deploy) if __name__ == "__main__": - if len(sys.argv) > 1: + if len(sys.argv) > 2: + main(sys.argv[1], sys.argv[2]) + elif len(sys.argv) > 1: main(sys.argv[1]) else: main("all") diff --git a/examples/production_python_react/projects/production_python_react-contracts/smart_contracts/_helpers/build.py b/examples/production_python_react/projects/production_python_react-contracts/smart_contracts/_helpers/build.py index 771b585..0afee9c 100644 --- a/examples/production_python_react/projects/production_python_react-contracts/smart_contracts/_helpers/build.py +++ b/examples/production_python_react/projects/production_python_react-contracts/smart_contracts/_helpers/build.py @@ -31,6 +31,7 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", + "--debug-level=0", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, @@ -40,12 +41,13 @@ def build(output_dir: Path, contract_path: Path) -> Path: raise Exception(f"Could not build contract:\n{build_result.stdout}") app_spec_file_names = [file.name for file in output_dir.glob("*.arc32.json")] - + app_spec_file_name = None for app_spec_file_name in app_spec_file_names: if app_spec_file_name is None: - raise Exception( - "Could not generate typed client, .arc32.json file not found" + logger.warning( + "No '*.arc32.json' file found (likely a logic signature being compiled). Skipping client generation." ) + continue print(app_spec_file_name) generate_result = subprocess.run( [ @@ -71,4 +73,4 @@ def build(output_dir: Path, contract_path: Path) -> Path: f"Could not generate typed client:\n{generate_result.stdout}" ) - return output_dir / app_spec_file_name + return output_dir / app_spec_file_name if app_spec_file_name else output_dir diff --git a/examples/production_python_react/projects/production_python_react-contracts/tests/hello_world_test.py b/examples/production_python_react/projects/production_python_react-contracts/tests/hello_world_test.py index 8e2afc1..b2d41ee 100644 --- a/examples/production_python_react/projects/production_python_react-contracts/tests/hello_world_test.py +++ b/examples/production_python_react/projects/production_python_react-contracts/tests/hello_world_test.py @@ -1,4 +1,4 @@ -from collections.abc import Generator +from collections.abc import Iterator import pytest from algopy_testing import AlgopyTestContext, algopy_testing_context @@ -7,15 +7,14 @@ @pytest.fixture() -def context() -> Generator[AlgopyTestContext, None, None]: +def context() -> Iterator[AlgopyTestContext]: with algopy_testing_context() as ctx: yield ctx - ctx.reset() def test_hello(context: AlgopyTestContext) -> None: # Arrange - dummy_input = context.any_string() + dummy_input = context.any.string(length=10) contract = HelloWorld() # Act diff --git a/examples/production_python_react/projects/production_python_react-frontend/.algokit/.copier-answers.yml b/examples/production_python_react/projects/production_python_react-frontend/.algokit/.copier-answers.yml index e567feb..0fe3e6f 100644 --- a/examples/production_python_react/projects/production_python_react-frontend/.algokit/.copier-answers.yml +++ b/examples/production_python_react/projects/production_python_react-frontend/.algokit/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 1.0.7 +_commit: 1.0.8 _src_path: gh:algorandfoundation/algokit-react-frontend-template author_email: None author_name: None diff --git a/examples/production_python_react/projects/production_python_react-frontend/src/components/Account.tsx b/examples/production_python_react/projects/production_python_react-frontend/src/components/Account.tsx index 6a6345e..8324312 100644 --- a/examples/production_python_react/projects/production_python_react-frontend/src/components/Account.tsx +++ b/examples/production_python_react/projects/production_python_react-frontend/src/components/Account.tsx @@ -7,20 +7,16 @@ const Account = () => { const { activeAddress } = useWallet() const algoConfig = getAlgodConfigFromViteEnvironment() - const dappFlowNetworkName = useMemo(() => { - return algoConfig.network === '' ? 'sandbox' : algoConfig.network.toLocaleLowerCase() + const networkName = useMemo(() => { + return algoConfig.network === '' ? 'localnet' : algoConfig.network.toLocaleLowerCase() }, [algoConfig.network]) return (
- + Address: {ellipseAddress(activeAddress)} -
Network: {algoConfig.network === '' ? 'localnet' : algoConfig.network}
+
Network: {networkName}
) } diff --git a/examples/production_python_react/projects/production_python_react-frontend/src/contracts/HelloWorld.ts b/examples/production_python_react/projects/production_python_react-frontend/src/contracts/HelloWorld.ts index c65399a..48df604 100644 --- a/examples/production_python_react/projects/production_python_react-frontend/src/contracts/HelloWorld.ts +++ b/examples/production_python_react/projects/production_python_react-frontend/src/contracts/HelloWorld.ts @@ -1,4 +1,5 @@ /* eslint-disable */ +// @ts-nocheck /** * This file was automatically generated by @algorandfoundation/algokit-client-generator. * DO NOT MODIFY IT BY HAND. @@ -37,8 +38,8 @@ export const APP_SPEC: AppSpec = { } }, "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMuaGVsbG9fd29ybGQuY29udHJhY3QuSGVsbG9Xb3JsZC5hcHByb3ZhbF9wcm9ncmFtOgogICAgLy8gc21hcnRfY29udHJhY3RzL2hlbGxvX3dvcmxkL2NvbnRyYWN0LnB5OjUKICAgIC8vIGNsYXNzIEhlbGxvV29ybGQoQVJDNENvbnRyYWN0KToKICAgIHR4biBOdW1BcHBBcmdzCiAgICBieiBtYWluX2JhcmVfcm91dGluZ0A1CiAgICBtZXRob2QgImhlbGxvKHN0cmluZylzdHJpbmciCiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAwCiAgICBtYXRjaCBtYWluX2hlbGxvX3JvdXRlQDIKICAgIGVyciAvLyByZWplY3QgdHJhbnNhY3Rpb24KCm1haW5faGVsbG9fcm91dGVAMjoKICAgIC8vIHNtYXJ0X2NvbnRyYWN0cy9oZWxsb193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mV0c3ViCg==", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMuaGVsbG9fd29ybGQuY29udHJhY3QuSGVsbG9Xb3JsZC5jbGVhcl9zdGF0ZV9wcm9ncmFtOgogICAgaW50IDEKICAgIHJldHVybgo=" }, "state": { "global": { @@ -71,6 +72,7 @@ export const APP_SPEC: AppSpec = { "name": "name" } ], + "readonly": false, "returns": { "type": "string" } diff --git a/examples/production_tealscript_react/projects/production_tealscript_react-contracts/contracts/clients/CalculatorClient.ts b/examples/production_tealscript_react/projects/production_tealscript_react-contracts/contracts/clients/CalculatorClient.ts index 0144c84..cc57180 100644 --- a/examples/production_tealscript_react/projects/production_tealscript_react-contracts/contracts/clients/CalculatorClient.ts +++ b/examples/production_tealscript_react/projects/production_tealscript_react-contracts/contracts/clients/CalculatorClient.ts @@ -73,7 +73,7 @@ export const APP_SPEC: AppSpec = { } }, "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgovLyBUaGlzIFRFQUwgd2FzIGdlbmVyYXRlZCBieSBURUFMU2NyaXB0IHYwLjk3LjAKLy8gaHR0cHM6Ly9naXRodWIuY29tL2FsZ29yYW5kZm91bmRhdGlvbi9URUFMU2NyaXB0CgovLyBUaGlzIGNvbnRyYWN0IGlzIGNvbXBsaWFudCB3aXRoIGFuZC9vciBpbXBsZW1lbnRzIHRoZSBmb2xsb3dpbmcgQVJDczogWyBBUkM0IF0KCi8vIFRoZSBmb2xsb3dpbmcgdGVuIGxpbmVzIG9mIFRFQUwgaGFuZGxlIGluaXRpYWwgcHJvZ3JhbSBmbG93Ci8vIFRoaXMgcGF0dGVybiBpcyB1c2VkIHRvIG1ha2UgaXQgZWFzeSBmb3IgYW55b25lIHRvIHBhcnNlIHRoZSBzdGFydCBvZiB0aGUgcHJvZ3JhbSBhbmQgZGV0ZXJtaW5lIGlmIGEgc3BlY2lmaWMgYWN0aW9uIGlzIGFsbG93ZWQKLy8gSGVyZSwgYWN0aW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GVBcHBsaWNhdGlvbjoKCXB1c2hpbnQgMQoJcmV0dXJuCgoqY3JlYXRlX05vT3A6CglwdXNoYnl0ZXMgMHhiODQ0N2IzNiAvLyBtZXRob2QgImNyZWF0ZUFwcGxpY2F0aW9uKCl2b2lkIgoJdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAoJbWF0Y2ggKmFiaV9yb3V0ZV9jcmVhdGVBcHBsaWNhdGlvbgoKCS8vIHRoaXMgY29udHJhY3QgZG9lcyBub3QgaW1wbGVtZW50IHRoZSBnaXZlbiBBQkkgbWV0aG9kIGZvciBjcmVhdGUgTm9PcAoJZXJyCgoqY2FsbF9Ob09wOgoJcHVzaGJ5dGVzIDB4NzZhN2VmMzMgLy8gbWV0aG9kICJkb01hdGgodWludDY0LHVpbnQ2NCxzdHJpbmcpdWludDY0IgoJcHVzaGJ5dGVzIDB4MDJiZWNlMTEgLy8gbWV0aG9kICJoZWxsbyhzdHJpbmcpc3RyaW5nIgoJdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAoJbWF0Y2ggKmFiaV9yb3V0ZV9kb01hdGggKmFiaV9yb3V0ZV9oZWxsbwoKCS8vIHRoaXMgY29udHJhY3QgZG9lcyBub3QgaW1wbGVtZW50IHRoZSBnaXZlbiBBQkkgbWV0aG9kIGZvciBjYWxsIE5vT3AKCWVycg==", "clear": "I3ByYWdtYSB2ZXJzaW9uIDEw" }, "contract": { diff --git a/examples/production_tealscript_react/projects/production_tealscript_react-frontend/.algokit/.copier-answers.yml b/examples/production_tealscript_react/projects/production_tealscript_react-frontend/.algokit/.copier-answers.yml index 9bd506b..a8a071e 100644 --- a/examples/production_tealscript_react/projects/production_tealscript_react-frontend/.algokit/.copier-answers.yml +++ b/examples/production_tealscript_react/projects/production_tealscript_react-frontend/.algokit/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 1.0.7 +_commit: 1.0.8 _src_path: gh:algorandfoundation/algokit-react-frontend-template author_email: None author_name: None diff --git a/examples/production_tealscript_react/projects/production_tealscript_react-frontend/src/components/Account.tsx b/examples/production_tealscript_react/projects/production_tealscript_react-frontend/src/components/Account.tsx index 6a6345e..8324312 100644 --- a/examples/production_tealscript_react/projects/production_tealscript_react-frontend/src/components/Account.tsx +++ b/examples/production_tealscript_react/projects/production_tealscript_react-frontend/src/components/Account.tsx @@ -7,20 +7,16 @@ const Account = () => { const { activeAddress } = useWallet() const algoConfig = getAlgodConfigFromViteEnvironment() - const dappFlowNetworkName = useMemo(() => { - return algoConfig.network === '' ? 'sandbox' : algoConfig.network.toLocaleLowerCase() + const networkName = useMemo(() => { + return algoConfig.network === '' ? 'localnet' : algoConfig.network.toLocaleLowerCase() }, [algoConfig.network]) return (
- + Address: {ellipseAddress(activeAddress)} -
Network: {algoConfig.network === '' ? 'localnet' : algoConfig.network}
+
Network: {networkName}
) } diff --git a/examples/production_tealscript_react/projects/production_tealscript_react-frontend/src/contracts/Calculator.ts b/examples/production_tealscript_react/projects/production_tealscript_react-frontend/src/contracts/Calculator.ts index 9d250ca..11f0fc2 100644 --- a/examples/production_tealscript_react/projects/production_tealscript_react-frontend/src/contracts/Calculator.ts +++ b/examples/production_tealscript_react/projects/production_tealscript_react-frontend/src/contracts/Calculator.ts @@ -1,4 +1,5 @@ /* eslint-disable */ +// @ts-nocheck /** * This file was automatically generated by @algorandfoundation/algokit-client-generator. * DO NOT MODIFY IT BY HAND. @@ -74,7 +75,7 @@ export const APP_SPEC: AppSpec = { } }, "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgovLyBUaGlzIFRFQUwgd2FzIGdlbmVyYXRlZCBieSBURUFMU2NyaXB0IHYwLjk3LjAKLy8gaHR0cHM6Ly9naXRodWIuY29tL2FsZ29yYW5kZm91bmRhdGlvbi9URUFMU2NyaXB0CgovLyBUaGlzIGNvbnRyYWN0IGlzIGNvbXBsaWFudCB3aXRoIGFuZC9vciBpbXBsZW1lbnRzIHRoZSBmb2xsb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"contract": { diff --git a/examples/starter_beaker_react/.algokit.toml b/examples/starter_beaker_react/.algokit.toml deleted file mode 100644 index 10cad0d..0000000 --- a/examples/starter_beaker_react/.algokit.toml +++ /dev/null @@ -1,9 +0,0 @@ -[algokit] -min_version = "v2.0.0" - -[project] -type = 'workspace' -projects_root_path = 'projects' - -[project.run] -build = ['starter_beaker_react-contracts', 'starter_beaker_react-frontend'] diff --git a/examples/starter_beaker_react/.algokit/.copier-answers.yml b/examples/starter_beaker_react/.algokit/.copier-answers.yml deleted file mode 100644 index 2f61be3..0000000 --- a/examples/starter_beaker_react/.algokit/.copier-answers.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: -_src_path: -author_email: None -author_name: None -contract_name: hello_world -deployment_language: typescript -preset_name: starter -project_name: starter_beaker_react - diff --git a/examples/starter_beaker_react/.algokit/generators/create-devcontainer/copier.yaml b/examples/starter_beaker_react/.algokit/generators/create-devcontainer/copier.yaml deleted file mode 100644 index e98f334..0000000 --- a/examples/starter_beaker_react/.algokit/generators/create-devcontainer/copier.yaml +++ /dev/null @@ -1,4 +0,0 @@ -_tasks: - - "echo '==== Successfully generated new .devcontainer.json file 🚀 ===='" - -_templates_suffix: ".j2" diff --git a/examples/starter_beaker_react/.algokit/generators/create-devcontainer/devcontainer.json b/examples/starter_beaker_react/.algokit/generators/create-devcontainer/devcontainer.json deleted file mode 100644 index 6452c65..0000000 --- a/examples/starter_beaker_react/.algokit/generators/create-devcontainer/devcontainer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "forwardPorts": [4001, 4002, 8980, 5173], - "portsAttributes": { - "4001": { - "label": "algod" - }, - "4002": { - "label": "kmd" - }, - "8980": { - "label": "indexer" - }, - "5173": { - "label": "vite" - } - }, - "postCreateCommand": "mkdir -p ~/.config/algokit && pipx install algokit && sudo chown -R codespace:codespace ~/.config/algokit", - "postStartCommand": "for i in {1..5}; do algokit localnet status > /dev/null 2>&1 && break || sleep 30; algokit localnet reset; done" -} diff --git a/examples/starter_beaker_react/.editorconfig b/examples/starter_beaker_react/.editorconfig deleted file mode 100644 index 5e550a1..0000000 --- a/examples/starter_beaker_react/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -[*] -charset = utf-8 -insert_final_newline = true -end_of_line = lf -indent_style = space -indent_size = 2 -tab_width = 2 -max_line_length = 140 -trim_trailing_whitespace = true -single_quote = true diff --git a/examples/starter_beaker_react/.gitattributes b/examples/starter_beaker_react/.gitattributes deleted file mode 100644 index 6313b56..0000000 --- a/examples/starter_beaker_react/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto eol=lf diff --git a/examples/starter_beaker_react/.gitignore b/examples/starter_beaker_react/.gitignore deleted file mode 100644 index 4105eb2..0000000 --- a/examples/starter_beaker_react/.gitignore +++ /dev/null @@ -1,170 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide -.pdm.toml - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Ruff (linter) -.ruff_cache/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -.idea/ -!.idea/runConfigurations - -# macOS -.DS_Store - -# Received approval test files -*.received.* - -# NPM -node_modules - diff --git a/examples/starter_beaker_react/.vscode/launch.json b/examples/starter_beaker_react/.vscode/launch.json deleted file mode 100644 index 1b8aa88..0000000 --- a/examples/starter_beaker_react/.vscode/launch.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [] -} diff --git a/examples/starter_beaker_react/.vscode/settings.json b/examples/starter_beaker_react/.vscode/settings.json deleted file mode 100644 index 033fd10..0000000 --- a/examples/starter_beaker_react/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - // Disabled due to matangover.mypy extension not supporting monorepos - // To be addressed as part of https://github.com/matangover/mypy-vscode/issues/82 - "mypy.enabled": false -} diff --git a/examples/starter_beaker_react/README.md b/examples/starter_beaker_react/README.md deleted file mode 100644 index 91c8767..0000000 --- a/examples/starter_beaker_react/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# starter_beaker_react - -This starter full stack project has been generated using AlgoKit. See below for default getting started instructions. - -## Setup - -### Initial setup -1. Clone this repository to your local machine. -2. Ensure [Docker](https://www.docker.com/) is installed and operational. Then, install `AlgoKit` following this [guide](https://github.com/algorandfoundation/algokit-cli#install). -3. Run `algokit project bootstrap all` in the project directory. This command sets up your environment by installing necessary dependencies, setting up a Python virtual environment, and preparing your `.env` file. -4. In the case of a smart contract project, execute `algokit generate env-file -a target_network localnet` from the `starter_beaker_react-contracts` directory to create a `.env.localnet` file with default configuration for `localnet`. -5. To build your project, execute `algokit project run build`. This compiles your project and prepares it for running. -6. For project-specific instructions, refer to the READMEs of the child projects: - - Smart Contracts: [starter_beaker_react-contracts](projects/starter_beaker_react-contracts/README.md) - - Frontend Application: [starter_beaker_react-frontend](projects/starter_beaker_react-frontend/README.md) - -> This project is structured as a monorepo, refer to the [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md) to learn more about custom command orchestration via `algokit project run`. - -### Subsequently - -1. If you update to the latest source code and there are new dependencies, you will need to run `algokit project bootstrap all` again. -2. Follow step 3 above. - -## Tools - -This project makes use of Python and React to build Algorand smart contracts and to provide a base project configuration to develop frontends for your Algorand dApps and interactions with smart contracts. The following tools are in use: - -- Algorand, AlgoKit, and AlgoKit Utils -- Python dependencies including Poetry, Black, Ruff or Flake8, mypy, pytest, and pip-audit -- React and related dependencies including AlgoKit Utils, Tailwind CSS, daisyUI, use-wallet, npm, jest, playwright, Prettier, ESLint, and Github Actions workflows for build validation - -### VS Code - -It has also been configured to have a productive dev experience out of the box in [VS Code](https://code.visualstudio.com/), see the [backend .vscode](./backend/.vscode) and [frontend .vscode](./frontend/.vscode) folders for more details. - -## Integrating with smart contracts and application clients - -Refer to the [starter_beaker_react-contracts](projects/starter_beaker_react-contracts/README.md) folder for overview of working with smart contracts, [projects/starter_beaker_react-frontend](projects/starter_beaker_react-frontend/README.md) for overview of the React project and the [projects/starter_beaker_react-frontend/contracts](projects/starter_beaker_react-frontend/src/contracts/README.md) folder for README on adding new smart contracts from backend as application clients on your frontend. The templates provided in these folders will help you get started. -When you compile and generate smart contract artifacts, your frontend component will automatically generate typescript application clients from smart contract artifacts and move them to `frontend/src/contracts` folder, see [`generate:app-clients` in package.json](projects/starter_beaker_react-frontend/package.json). Afterwards, you are free to import and use them in your frontend application. - -The frontend starter also provides an example of interactions with your HelloWorldClient in [`AppCalls.tsx`](projects/starter_beaker_react-frontend/src/components/AppCalls.tsx) component by default. - -## Next Steps - -You can take this project and customize it to build your own decentralized applications on Algorand. Make sure to understand how to use AlgoKit and how to write smart contracts for Algorand before you start. diff --git a/examples/starter_beaker_react/projects/.gitkeep b/examples/starter_beaker_react/projects/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit.toml b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit.toml deleted file mode 100644 index 60d802b..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit.toml +++ /dev/null @@ -1,42 +0,0 @@ -[algokit] -min_version = "v2.0.0" - -[generate.smart-contract] -description = "Adds new smart contract to existing project" -path = ".algokit/generators/create_contract" - -[generate.env-file] -description = "Generate a new generic or Algorand network specific .env file" -path = ".algokit/generators/create_env_file" - -[project] -type = 'contract' -name = 'starter_beaker_react-contracts' -artifacts = 'smart_contracts/artifacts' - -[project.deploy] -command = "npm run deploy:ci" -environment_secrets = [ - "DEPLOYER_MNEMONIC", -] - -[project.deploy.localnet] -environment_secrets = [] - -[project.run] -# Commands intented for use locally and in CI -build = { commands = [ - 'poetry run python -m smart_contracts build', -], description = 'Build all smart contracts in the project' } -lint = { commands = [ -], description = 'Perform linting' } -audit-teal = { commands = [ - # 🚨 IMPORTANT 🚨: For strict TEAL validation, remove --exclude statements. The default starter contract is not for production. Ensure thorough testing and adherence to best practices in smart contract development. This is not a replacement for a professional audit. - 'algokit task analyze smart_contracts/artifacts --recursive --force --exclude rekey-to --exclude is-updatable --exclude missing-fee-check --exclude is-deletable --exclude can-close-asset --exclude can-close-account --exclude unprotected-deletable --exclude unprotected-updatable', -], description = 'Audit TEAL files' } - -# Commands indented for CI only, prefixed with `ci-` by convention -ci-teal-diff = { commands = [ - 'git add -N ./smart_contracts/artifacts', - 'git diff --exit-code --minimal ./smart_contracts/artifacts', -], description = 'Check TEAL files for differences' } diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/.copier-answers.yml b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/.copier-answers.yml deleted file mode 100644 index 4e08d2b..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/.copier-answers.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 2.1.4 -_src_path: gh:algorandfoundation/algokit-beaker-default-template -author_email: None -author_name: None -contract_name: hello_world -deployment_language: typescript -preset_name: starter -project_name: starter_beaker_react-contracts - diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/copier.yaml b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/copier.yaml deleted file mode 100644 index 73805de..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/copier.yaml +++ /dev/null @@ -1,10 +0,0 @@ -_tasks: - - "echo '==== Successfully initialized new smart contract 🚀 ===='" - -contract_name: - type: str - help: Name of your new contract. - placeholder: "my-new-contract" - default: "my-new-contract" - -_templates_suffix: ".j2" diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 deleted file mode 100644 index 8240dd0..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2 +++ /dev/null @@ -1,31 +0,0 @@ -import beaker -import pyteal as pt -{%- if preset_name == 'starter' %} - -app = beaker.Application("{{ contract_name }}") -{%- elif preset_name == 'production' %} -from algokit_utils import DELETABLE_TEMPLATE_NAME, UPDATABLE_TEMPLATE_NAME - -app = beaker.Application("{{ contract_name }}") - - -@app.update(authorize=beaker.Authorize.only_creator(), bare=True) -def update() -> pt.Expr: - return pt.Assert( - pt.Tmpl.Int(UPDATABLE_TEMPLATE_NAME), - comment="Check app is updatable", - ) - - -@app.delete(authorize=beaker.Authorize.only_creator(), bare=True) -def delete() -> pt.Expr: - return pt.Assert( - pt.Tmpl.Int(DELETABLE_TEMPLATE_NAME), - comment="Check app is deletable", - ) -{%- endif %} - - -@app.external -def hello(name: pt.abi.String, *, output: pt.abi.String) -> pt.Expr: - return output.set(pt.Concat(pt.Bytes("Hello, "), name.get())) diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 deleted file mode 100644 index 325fb24..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 +++ /dev/null @@ -1,59 +0,0 @@ -import * as algokit from '@algorandfoundation/algokit-utils' -import { {{ contract_name.split('_')|map('capitalize')|join }}Client } from '../artifacts/{{ contract_name }}/client' - -// Below is a showcase of various deployment options you can use in TypeScript Client -export async function deploy() { - console.log('=== Deploying {{ contract_name.split('_')|map('capitalize')|join }} ===') - - const algod = algokit.getAlgoClient() - const indexer = algokit.getAlgoIndexerClient() - const deployer = await algokit.mnemonicAccountFromEnvironment({ name: 'DEPLOYER', fundWith: algokit.algos(3) }, algod) - await algokit.ensureFunded( - { - accountToFund: deployer, - minSpendingBalance: algokit.algos(2), - minFundingIncrement: algokit.algos(2), - }, - algod, - ) - const appClient = new {{ contract_name.split('_')|map('capitalize')|join }}Client( - { - resolveBy: 'creatorAndName', - findExistingUsing: indexer, - sender: deployer, - creatorAddress: deployer.addr, - }, - algod, - ) - - {%- if preset_name == 'starter' %} - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', - }) - {% elif preset_name == 'production' %} - const isMainNet = await algokit.isMainNet(algod) - const app = await appClient.deploy({ - allowDelete: !isMainNet, - allowUpdate: !isMainNet, - onSchemaBreak: isMainNet ? 'append' : 'replace', - onUpdate: isMainNet ? 'append' : 'update', - }) - {% endif %} - - // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { - algokit.transferAlgos( - { - amount: algokit.algos(1), - from: deployer, - to: app.appAddress, - }, - algod, - ) - } - - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/copier.yaml b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/copier.yaml deleted file mode 100644 index afa2cac..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/copier.yaml +++ /dev/null @@ -1,49 +0,0 @@ -_tasks: - - "echo '==== Successfully generated new .env file 🚀 ===='" - -target_network: - type: str - help: Name of your target network. - choices: - - mainnet - - testnet - - localnet - - custom - default: "localnet" - when: "{{ not use_generic_env }}" - -custom_network_name: - type: str - help: Name of your custom Algorand network. - placeholder: "custom" - when: "{{ not use_generic_env and target_network == 'custom' }}" - -is_localnet: - type: bool - help: Whether to deploy on localnet. - placeholder: "true" - default: "{{ target_network == 'localnet' and not use_generic_env }}" - when: 'false' - -is_testnet: - type: bool - help: Whether to deploy on testnet. - placeholder: "true" - default: "{{ target_network == 'testnet' and not use_generic_env }}" - when: 'false' - -is_mainnet: - type: bool - help: Whether to deploy on mainnet. - placeholder: "true" - default: "{{ target_network == 'mainnet' and not use_generic_env }}" - when: 'false' - -is_customnet: - type: bool - help: Whether to deploy on custom network. - placeholder: "true" - default: "{{ target_network == 'custom' and not use_generic_env }}" - when: 'false' - -_templates_suffix: ".j2" diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_customnet %}.env.{{custom_network_name}}{% endif %} b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_customnet %}.env.{{custom_network_name}}{% endif %} deleted file mode 100644 index cfc9f21..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_customnet %}.env.{{custom_network_name}}{% endif %} +++ /dev/null @@ -1,7 +0,0 @@ -# this file contains algorand network settings for interacting with testnet via algonode -ALGOD_TOKEN={YOUR_ALGOD_TOKEN} -ALGOD_SERVER={YOUR_ALGOD_SERVER_URL} -ALGOD_PORT={YOUR_ALGOD_PORT} -INDEXER_TOKEN={YOUR_INDEXER_TOKEN} -INDEXER_SERVER={YOUR_INDEXER_SERVER_URL} -INDEXER_PORT={YOUR_INDEXER_PORT} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_localnet %}.env.localnet{% endif %} b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_localnet %}.env.localnet{% endif %} deleted file mode 100644 index fcbf442..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_localnet %}.env.localnet{% endif %} +++ /dev/null @@ -1,7 +0,0 @@ -# this file should contain environment variables specific to algokit localnet -ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -ALGOD_SERVER=http://localhost -ALGOD_PORT=4001 -INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -INDEXER_SERVER=http://localhost -INDEXER_PORT=8980 diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_mainnet %}.env.mainnet{% endif %} b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_mainnet %}.env.mainnet{% endif %} deleted file mode 100644 index bb9a787..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_mainnet %}.env.mainnet{% endif %} +++ /dev/null @@ -1,3 +0,0 @@ -# this file contains algorand network settings for interacting with testnet via algonode -ALGOD_SERVER=https://mainnet-api.algonode.cloud -INDEXER_SERVER=https://mainnet-idx.algonode.cloud diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_testnet %}.env.testnet{% endif %} b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_testnet %}.env.testnet{% endif %} deleted file mode 100644 index eeea43d..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.algokit/generators/create_env_file/{% if is_testnet %}.env.testnet{% endif %} +++ /dev/null @@ -1,3 +0,0 @@ -# this file contains algorand network settings for interacting with testnet via algonode -ALGOD_SERVER=https://testnet-api.algonode.cloud -INDEXER_SERVER=https://testnet-idx.algonode.cloud diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.editorconfig b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.editorconfig deleted file mode 100644 index e2fda34..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -root=true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true - -[*.py] -indent_size = 4 diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.gitignore b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.gitignore deleted file mode 100644 index e5f0b9e..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.gitignore +++ /dev/null @@ -1,180 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ -coverage/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide -.pdm.toml - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -.env.* -!.env.*.template -!.env.template -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Ruff (linter) -.ruff_cache/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -.idea -!.idea/ -.idea/* -!.idea/runConfigurations/ - -# macOS -.DS_Store - -# Received approval test files -*.received.* - -# NPM -node_modules - -# AlgoKit -debug_traces/ - -.algokit/static-analysis/tealer/ diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.npmrc b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.npmrc deleted file mode 100644 index c42da84..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.npmrc +++ /dev/null @@ -1 +0,0 @@ -engine-strict = true diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.prettierignore b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.prettierignore deleted file mode 100644 index dbda6ae..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.prettierignore +++ /dev/null @@ -1,12 +0,0 @@ -# don't ever format node_modules -node_modules -# don't lint format output (make sure it's set to your correct build folder name) -dist -build -# don't format nyc coverage output -coverage -# don't format generated types -**/generated/types.d.ts -**/generated/types.ts -# don't format ide files -.idea diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.prettierrc.js b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.prettierrc.js deleted file mode 100644 index c484d0e..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.prettierrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - singleQuote: true, - jsxSingleQuote: false, - semi: false, - tabWidth: 2, - trailingComma: 'all', - printWidth: 120, - endOfLine: 'lf', - arrowParens: 'always', -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.tours/getting-started-with-your-algokit-project.tour b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.tours/getting-started-with-your-algokit-project.tour deleted file mode 100644 index 056c1bb..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.tours/getting-started-with-your-algokit-project.tour +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$schema": "https://aka.ms/codetour-schema", - "title": "Getting Started with Your AlgoKit Project", - "steps": [ - { - "file": "README.md", - "description": "Welcome to your brand new AlgoKit template-based project. In this tour, we will guide you through the main features and capabilities included in the template.", - "line": 3 - }, - { - "file": "README.md", - "description": "Start by ensuring you have followed the setup of pre-requisites.", - "line": 9 - }, - { - "file": "smart_contracts/__main__.py", - "description": "This is the main entry point for building your smart contracts. The default template includes a starter 'Hello World' contract that is deployed via the `algokit-utils` package (either `ts` or `py`, depending on your choice). To create a new smart contract, you can use the [`algokit generate`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md) command and invoke a pre-bundled generator template by running `algokit generate smart-contract`. This action will create a new folder in the `smart_contracts` directory, named after your project. Each folder contains a `contract.py` file, which is the entry point for your contract implementation, and `deploy_config.py` | `deployConfig.ts` files (depending on the language chosen for the template), that perform the deployment of the contract.", - "line": 26 - }, - { - "file": "smart_contracts/hello_world/deploy-config.ts", - "description": "The default deployment scripts invoke a sample method on the starter contract that demonstrates how to interact with your deployed Algorand on-chain applications using the [`AlgoKit Typed Clients`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients) feature.", - "line": 32 - }, - { - "file": "tests/hello-world.spec.ts", - "description": "If you opted to include unit tests, the default tests provided demonstrate an example of mocking, setting up fixtures, and testing smart contract calls on an AlgoKit typed client.", - "line": 39 - }, - { - "file": ".env.localnet.template", - "description": "Environment files are a crucial mechanism that allows you to set up the [`algokit deploy`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/deploy.md) feature to simplify deploying your contracts in CI/CD environments (please note we still recommend careful evaluation when it comes to deployment to MainNet). Clone the file and remove the `.template` suffix to apply the changes to deployment scripts and launch configurations. The network prefix `localnet|testnet|mainnet` is primarily optimized for `algokit deploy`. The order of loading the variables is `.env.{network}` < `.env`.", - "line": 2 - }, - { - "file": ".algokit.toml", - "description": "This is the configuration file used by AlgoKit to determine version requirements, `algokit deploy` settings, and references to custom generators.", - "line": 5 - }, - { - "file": ".vscode/launch.json", - "description": "Refer to the pre-bundled Visual Studio launch configurations, offering various options on how to execute the build and deployment of your smart contracts.", - "line": 5 - }, - { - "file": ".vscode/extensions.json", - "description": "We highly recommend installing the recommended extensions to get the most out of this template starter project in your VSCode IDE.", - "line": 3 - }, - { - "file": "smart_contracts/index.ts", - "description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin available on the [VSCode Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.", - "line": 13 - }, - { - "file": "smart_contracts/_helpers/__init__.py", - "description": "This folder contains helper scripts for contract management. These automate tasks like compiling, generating clients, and deploying. Usually, you won't need to edit these files, but advanced users can expand them for custom needs.", - "line": 1 - } - ] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/extensions.json b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/extensions.json deleted file mode 100644 index e5ca4ca..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/extensions.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "recommendations": [ - "ms-python.python", - "esbenp.prettier-vscode", - "tamasfe.even-better-toml", - "editorconfig.editorconfig", - "vsls-contrib.codetour", - "algorandfoundation.algokit-avm-vscode-debugger" - ] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/launch.json b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/launch.json deleted file mode 100644 index dcdcb87..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/launch.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Build & Deploy contracts", - "type": "node", - "request": "launch", - "runtimeExecutable": "npm", - "runtimeArgs": ["run", "deploy"], - "cwd": "${workspaceFolder}/smart_contracts", - "console": "integratedTerminal", - "skipFiles": ["/**", "node_modules/**"], - "preLaunchTask": "Build contracts (+ LocalNet)", - "env": { - "ALGOD_TOKEN": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "ALGOD_SERVER": "http://localhost", - "ALGOD_PORT": "4001", - "INDEXER_TOKEN": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "INDEXER_SERVER": "http://localhost", - "INDEXER_PORT": "8980" - } - }, - { - "name": "Deploy contracts", - "type": "node", - "request": "launch", - "runtimeExecutable": "npm", - "runtimeArgs": ["run", "deploy"], - "cwd": "${workspaceFolder}/smart_contracts", - "console": "integratedTerminal", - "skipFiles": ["/**", "node_modules/**"], - "env": { - "ALGOD_TOKEN": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "ALGOD_SERVER": "http://localhost", - "ALGOD_PORT": "4001", - "INDEXER_TOKEN": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "INDEXER_SERVER": "http://localhost", - "INDEXER_PORT": "8980" - } - }, - { - "name": "Build contracts", - "type": "python", - "request": "launch", - "module": "smart_contracts", - "args": ["build"], - "cwd": "${workspaceFolder}" - }, - { - "type": "avm", - "request": "launch", - "name": "Debug TEAL via AlgoKit AVM Debugger", - "simulateTraceFile": "${workspaceFolder}/${command:PickSimulateTraceFile}", - "stopOnEntry": true - } - ] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/settings.json b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/settings.json deleted file mode 100644 index dfae20d..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/settings.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - // General - see also /.editorconfig - "editor.formatOnSave": true, - "files.exclude": { - "**/.git": true, - "**/.DS_Store": true, - "**/Thumbs.db": true, - ".mypy_cache": true, - ".pytest_cache": true, - ".ruff_cache": true, - "**/__pycache__": true, - ".idea": true - }, - - // TypeScript - "editor.defaultFormatter": "esbenp.prettier-vscode", - - // Python - "python.analysis.extraPaths": ["${workspaceFolder}/smart_contracts"], - "python.defaultInterpreterPath": "${workspaceFolder}/.venv", - "[python]": { - "editor.codeActionsOnSave": { - "source.fixAll": true, - // Prevent default import sorting from running; Ruff will sort imports for us anyway - "source.organizeImports": false - }, - "editor.defaultFormatter": null, - }, - - // On Windows, if execution policy is set to Signed (default) then it won't be able to activate the venv - // so instead let's set it to RemoteSigned for VS Code terminal - "terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "RemoteSigned"], -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/tasks.json b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/tasks.json deleted file mode 100644 index eb1e767..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/.vscode/tasks.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "Build contracts", - "command": "${workspaceFolder}/.venv/bin/python", - "windows": { - "command": "${workspaceFolder}/.venv/Scripts/python.exe" - }, - "args": ["-m", "smart_contracts", "build"], - "options": { - "cwd": "${workspaceFolder}" - }, - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [] - }, - { - "label": "Build contracts (+ LocalNet)", - "command": "${workspaceFolder}/.venv/bin/python", - "windows": { - "command": "${workspaceFolder}/.venv/Scripts/python.exe" - }, - "args": ["-m", "smart_contracts", "build"], - "options": { - "cwd": "${workspaceFolder}" - }, - "dependsOn": "Start AlgoKit LocalNet", - "problemMatcher": [] - }, - { - "label": "Start AlgoKit LocalNet", - "command": "algokit", - "args": ["localnet", "start"], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - }, - { - "label": "Stop AlgoKit LocalNet", - "command": "algokit", - "args": ["localnet", "stop"], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - }, - { - "label": "Reset AlgoKit LocalNet", - "command": "algokit", - "args": ["localnet", "reset"], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - }, - { - "label": "Analyze TEAL contracts with AlgoKit Tealer integration", - "command": "algokit", - "args": [ - "task", - "analyze", - "${workspaceFolder}/.algokit", - "--recursive", - "--force" - ], - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - } - ] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/README.md b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/README.md deleted file mode 100644 index eeee691..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# starter_beaker_react-contracts - -This project has been generated using AlgoKit. See below for default getting started instructions. - -# Setup - -### Pre-requisites - -- [Python 3.10+](https://www.python.org/downloads/) (we recommended 3.12+) -- [Docker](https://www.docker.com/) (for LocalNet only) - -> For interactive tour over the codebase, download [vsls-contrib.codetour](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) extension for VS Code, then open the [`.codetour.json`](./.tours/getting-started-with-your-algokit-project.tour) file in code tour extension. - -### Initial Setup - -#### 1. Clone the Repository -Start by cloning this repository to your local machine. - -#### 2. Install Pre-requisites -Ensure the following pre-requisites are installed and properly configured: - -- **Docker**: Required for running a local Algorand network. [Install Docker](https://www.docker.com/). -- **AlgoKit CLI**: Essential for project setup and operations. Install the latest version from [AlgoKit CLI Installation Guide](https://github.com/algorandfoundation/algokit-cli#install). Verify installation with `algokit --version`, expecting `2.0.0` or later. - -#### 3. Bootstrap Your Local Environment -Run the following commands within the project folder: - -- **Install Poetry**: Required for Python dependency management. [Installation Guide](https://python-poetry.org/docs/#installation). Verify with `poetry -V` to see version `1.2`+. -- **Setup Project**: Execute `algokit project bootstrap all` to install dependencies and setup a Python virtual environment in `.venv`. -- **Configure environment**: Execute `algokit generate env-file -a target_network localnet` to create a `.env.localnet` file with default configuration for `localnet`. -- **Start LocalNet**: Use `algokit localnet start` to initiate a local Algorand network. - -### Development Workflow - -#### Terminal -Directly manage and interact with your project using AlgoKit commands: - -1. **Build Contracts**: `algokit project run build` compiles all smart contracts. -2. **Deploy**: Use `algokit project deploy localnet` to deploy contracts to the local network. - -#### VS Code -For a seamless experience with breakpoint debugging and other features: - -1. **Open Project**: In VS Code, open the repository root. -2. **Install Extensions**: Follow prompts to install recommended extensions. -3. **Debugging**: - - Use `F5` to start debugging. - - **Windows Users**: Select the Python interpreter at `./.venv/Scripts/python.exe` via `Ctrl/Cmd + Shift + P` > `Python: Select Interpreter` before the first run. - -#### JetBrains IDEs -While primarily optimized for VS Code, JetBrains IDEs are supported: - -1. **Open Project**: In your JetBrains IDE, open the repository root. -2. **Automatic Setup**: The IDE should configure the Python interpreter and virtual environment. -3. **Debugging**: Use `Shift+F10` or `Ctrl+R` to start debugging. Note: Windows users may encounter issues with pre-launch tasks due to a known bug. See [JetBrains forums](https://youtrack.jetbrains.com/issue/IDEA-277486/Shell-script-configuration-cannot-run-as-before-launch-task) for workarounds. - -## AlgoKit Workspaces and Project Management -This project supports both standalone and monorepo setups through AlgoKit workspaces. Leverage [`algokit project run`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md) commands for efficient monorepo project orchestration and management across multiple projects within a workspace. - -## AlgoKit Generators - -This template provides a set of [algokit generators](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md) that allow you to further modify the project instantiated from the template to fit your needs, as well as giving you a base to build your own extensions to invoke via the `algokit generate` command. - -### Generate Smart Contract - -By default the template creates a single `HelloWorld` contract under hello_world folder in the `smart_contracts` directory. To add a new contract: - -1. From the root of the project (`../`) execute `algokit generate smart-contract`. This will create a new starter smart contract and deployment configuration file under `{your_contract_name}` subfolder in the `smart_contracts` directory. -2. Each contract potentially has different creation parameters and deployment steps. Hence, you need to define your deployment logic in `deploy-config.ts`file. -3. `config.py` file will automatically build all contracts in the `smart_contracts` directory. If you want to build specific contracts manually, modify the default code provided by the template in `config.py` file. -4. Since you are generating a TypeScript client, you also need to reference your contract deployment logic in `index.ts` file. However, similar to config.py, by default, `index.ts` will auto import all TypeScript deployment files under `smart_contracts` directory. If you want to manually import specific contracts, modify the default code provided by the template in `index.ts` file. - -> Please note, above is just a suggested convention tailored for the base configuration and structure of this template. The default code supplied by the template in `config.py` and `index.ts` (if using ts clients) files are tailored for the suggested convention. You are free to modify the structure and naming conventions as you see fit. - -### Generate '.env' files - -By default the template instance does not contain any env files. Using [`algokit project deploy`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/deploy.md) against `localnet` | `testnet` | `mainnet` will use default values for `algod` and `indexer` unless overwritten via `.env` or `.env.{target_network}`. - -To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file` - -# Tools - -This project makes use of Python to build Algorand smart contracts. The following tools are in use: - -- [Algorand](https://www.algorand.com/) - Layer 1 Blockchain; [Developer portal](https://developer.algorand.org/), [Why Algorand?](https://developer.algorand.org/docs/get-started/basics/why_algorand/) -- [AlgoKit](https://github.com/algorandfoundation/algokit-cli) - One-stop shop tool for developers building on the Algorand network; [docs](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/algokit.md), [intro tutorial](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/tutorials/intro.md) -- [Beaker](https://github.com/algorand-devrel/beaker) - Smart contract development framework for PyTeal; [docs](https://beaker.algo.xyz), [examples](https://github.com/algorand-devrel/beaker/tree/master/examples) -- [PyTEAL](https://github.com/algorand/pyteal) - Python language binding for Algorand smart contracts; [docs](https://pyteal.readthedocs.io/en/stable/) -- [AlgoKit Utils](https://github.com/algorandfoundation/algokit-utils-ts) - A set of core Algorand utilities that make it easier to build solutions on Algorand. -- [Poetry](https://python-poetry.org/): Python packaging and dependency management. -- [npm](https://www.npmjs.com/): Node.js package manager. -- [TypeScript](https://www.typescriptlang.org/): Strongly typed programming language that builds on JavaScript. -- [ts-node-dev](https://github.com/wclr/ts-node-dev): TypeScript development execution environment. - -It has also been configured to have a productive dev experience out of the box in [VS Code](https://code.visualstudio.com/), see the [.vscode](./.vscode) folder. -- [AlgoKit Tealer Integration](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/tasks/analyze.md): AlgoKit Tealer Integration is a feature in the CLI that allows you to run [Tealer](https://github.com/crytic/tealer) static analyzer on your TEAL -source code. The invocation of this command is included in: -- The github actions workflow file. -- A VSCode task ('Shift+CMD|CTRL+P' and search for 'Tasks: Run Task' and select 'Analyze TEAL contracts with AlgoKit Tealer integration'). -- A `pre-commit` hook (if you have enabled `pre-commit` in your project). diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/package.json b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/package.json deleted file mode 100644 index e329b0d..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "smart_contracts", - "version": "1.0.0", - "description": "Smart contract deployer", - "main": "index.ts", - "scripts": { - "deploy": "ts-node-dev --transpile-only --watch .env -r dotenv/config smart_contracts/index.ts", - "deploy:ci": "ts-node --transpile-only -r dotenv/config smart_contracts/index.ts", - "format": "prettier --write ." - }, - "engines": { - "node": ">=18.0", - "npm": ">=9.0" - }, - "dependencies": { - "@algorandfoundation/algokit-utils": "^6.0.2", - "algosdk": "^2.7.0" - }, - "devDependencies": { - "@algorandfoundation/algokit-client-generator": "^3.0.3", - "dotenv": "^16.0.3", - "prettier": "^2.8.4", - "ts-node-dev": "^2.0.0", - "typescript": "^4.9.5" - } -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/poetry.toml b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/poetry.toml deleted file mode 100644 index ab1033b..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/poetry.toml +++ /dev/null @@ -1,2 +0,0 @@ -[virtualenvs] -in-project = true diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/pyproject.toml b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/pyproject.toml deleted file mode 100644 index 632b374..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/pyproject.toml +++ /dev/null @@ -1,20 +0,0 @@ -[tool.poetry] -name = "starter_beaker_react-contracts" -version = "0.1.0" -description = "Algorand smart contracts" -authors = ["None "] -readme = "README.md" - -[tool.poetry.dependencies] -python = "^3.10" -beaker-pyteal = "^1.1.1" -algokit-utils = "^2.2.0" -python-dotenv = "^1.0.0" - -[tool.poetry.group.dev.dependencies] -setuptools = "^69.0.2" # Adding explicitly to work around pyteal https://github.com/algorand/pyteal/issues/712 - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/README.md b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/README.md deleted file mode 100644 index e97ba8b..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/README.md +++ /dev/null @@ -1,10 +0,0 @@ -## How to add new smart contracts? - -By the default the template creates a single `HelloWorld` contract under hello_world folder in the `smart_contracts` directory. To add a new contract: - -1. From the root of the project (`../`) execute `algokit generate smart-contract`. This will create a new starter smart contract and deployment configuration file under `{your_contract_name}` subfolder under `smart_contracts` directory. -2. Each contract potentially has different creation parameters and deployment steps. Hence, you need to define your deployment logic in `deploy-config.ts`file. -3. `config.py` file will automatically build all contracts under `smart_contracts` directory. If you want to build specific contracts manually, modify the default code provided by the template in `config.py` file. -4. Since you are generating a TypeScript client, you also need to reference your contract deployment logic in `index.ts` file. However, similar to config.py, by default, `index.ts` will auto import all TypeScript deployment files under `smart_contracts` directory. If you want to manually import specific contracts, modify the default code provided by the template in `index.ts` file. - -> Please note, above is just a suggested convention tailored for the base configuration and structure of this template. Default code supplied by the template in `config.py` and `index.ts` (if using ts clients) files are tailored for the suggested convention. You are free to modify the structure and naming conventions as you see fit. diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/__init__.py b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/__main__.py b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/__main__.py deleted file mode 100644 index 9eb1464..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/__main__.py +++ /dev/null @@ -1,34 +0,0 @@ -import logging -import sys -from pathlib import Path - -from dotenv import load_dotenv - -from smart_contracts._helpers.build import build -from smart_contracts._helpers.config import contracts - -logging.basicConfig( - level=logging.DEBUG, format="%(asctime)s %(levelname)-10s: %(message)s" -) -logger = logging.getLogger(__name__) -logger.info("Loading .env") -# For manual script execution (bypassing `algokit project deploy`) with a custom .env, -# modify `load_dotenv()` accordingly. For example, `load_dotenv('.env.localnet')`. -load_dotenv() -root_path = Path(__file__).parent - - -def main(action: str) -> None: - artifact_path = root_path / "artifacts" - match action: - case "build": - for contract in contracts: - logger.info(f"Building app {contract.app.name}") - build(artifact_path / contract.app.name, contract.app) - - -if __name__ == "__main__": - if len(sys.argv) > 1: - main(sys.argv[1]) - else: - main("build") diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/__init__.py b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/build.py b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/build.py deleted file mode 100644 index ee6ddaa..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/build.py +++ /dev/null @@ -1,43 +0,0 @@ -import logging -import subprocess -from pathlib import Path -from shutil import rmtree - -import beaker - -logger = logging.getLogger(__name__) -deployment_extension = "ts" - - -def build(output_dir: Path, app: beaker.Application) -> Path: - output_dir = output_dir.resolve() - if output_dir.exists(): - rmtree(output_dir) - output_dir.mkdir(exist_ok=True, parents=True) - logger.info(f"Exporting {app.name} to {output_dir}") - specification = app.build() - specification.export(output_dir) - - result = subprocess.run( - [ - "algokit", - "generate", - "client", - output_dir / "application.json", - "--output", - output_dir / f"client.{deployment_extension}", - ], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - text=True, - ) - if result.returncode: - if "No such command" in result.stdout: - raise Exception( - "Could not generate typed client, requires AlgoKit 2.0.0 or " - "later. Please update AlgoKit" - ) - else: - raise Exception(f"Could not generate typed client:\n{result.stdout}") - - return output_dir / "application.json" diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/config.py b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/config.py deleted file mode 100644 index 89d948d..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/_helpers/config.py +++ /dev/null @@ -1,65 +0,0 @@ -import dataclasses -import importlib -from collections.abc import Callable -from pathlib import Path - -from algokit_utils import Account, ApplicationSpecification -from algosdk.v2client.algod import AlgodClient -from algosdk.v2client.indexer import IndexerClient -from beaker import Application - - -@dataclasses.dataclass -class SmartContract: - app: Application - deploy: ( - Callable[[AlgodClient, IndexerClient, ApplicationSpecification, Account], None] - | None - ) = None - - -def import_contract(folder: Path) -> Application: - """Imports the contract from a folder if it exists.""" - try: - contract_module = importlib.import_module( - f"{folder.parent.name}.{folder.name}.contract" - ) - return contract_module.app - except ImportError as e: - raise Exception(f"Contract not found in {folder}") from e - - -def import_deploy_if_exists( - folder: Path, -) -> ( - Callable[[AlgodClient, IndexerClient, ApplicationSpecification, Account], None] - | None -): - """Imports the deploy function from a folder if it exists.""" - try: - deploy_module = importlib.import_module( - f"{folder.parent.name}.{folder.name}.deploy_config" - ) - return deploy_module.deploy - except ImportError: - return None - - -def has_contract_file(directory: Path) -> bool: - """Checks whether the directory contains contract.py file.""" - return (directory / "contract.py").exists() - - -# define contracts to build and/or deploy -base_dir = Path("smart_contracts") -contracts = [ - SmartContract(app=import_contract(folder), deploy=import_deploy_if_exists(folder)) - for folder in base_dir.iterdir() - if folder.is_dir() and has_contract_file(folder) -] - -## Comment the above and uncomment the below and define contracts manually if you want to build and specify them -## manually otherwise the above code will always include all contracts under contract.py file for any subdirectory -## in the smart_contracts directory. Optionally it will grab the deploy function from deploy_config.py if it exists. - -# contracts = [] diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/hello_world/contract.py b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/hello_world/contract.py deleted file mode 100644 index ec6ec8b..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/hello_world/contract.py +++ /dev/null @@ -1,9 +0,0 @@ -import beaker -import pyteal as pt - -app = beaker.Application("hello_world") - - -@app.external -def hello(name: pt.abi.String, *, output: pt.abi.String) -> pt.Expr: - return output.set(pt.Concat(pt.Bytes("Hello, "), name.get())) diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/hello_world/deploy-config.ts b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/hello_world/deploy-config.ts deleted file mode 100644 index 527fe2c..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/hello_world/deploy-config.ts +++ /dev/null @@ -1,49 +0,0 @@ -import * as algokit from '@algorandfoundation/algokit-utils' -import { HelloWorldClient } from '../artifacts/hello_world/client' - -// Below is a showcase of various deployment options you can use in TypeScript Client -export async function deploy() { - console.log('=== Deploying HelloWorld ===') - - const algod = algokit.getAlgoClient() - const indexer = algokit.getAlgoIndexerClient() - const deployer = await algokit.mnemonicAccountFromEnvironment({ name: 'DEPLOYER', fundWith: algokit.algos(3) }, algod) - await algokit.ensureFunded( - { - accountToFund: deployer, - minSpendingBalance: algokit.algos(2), - minFundingIncrement: algokit.algos(2), - }, - algod, - ) - const appClient = new HelloWorldClient( - { - resolveBy: 'creatorAndName', - findExistingUsing: indexer, - sender: deployer, - creatorAddress: deployer.addr, - }, - algod, - ) - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', - }) - - - // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { - algokit.transferAlgos( - { - amount: algokit.algos(1), - from: deployer, - to: app.appAddress, - }, - algod, - ) - } - - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/index.ts b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/index.ts deleted file mode 100644 index af40ab4..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/smart_contracts/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -import * as fs from 'fs' -import * as path from 'path' -import { consoleLogger } from '@algorandfoundation/algokit-utils/types/logging' -import * as algokit from '@algorandfoundation/algokit-utils' - -// Uncomment the debug and traceAll options to enable auto generation of AVM Debugger compliant sourceMap and simulation trace file. -// Learn more about using AlgoKit AVM Debugger to debug your TEAL source codes and inspect various kinds of Algorand transactions in atomic groups -> https://github.com/algorandfoundation/algokit-avm-vscode-Debugger - -algokit.Config.configure({ - logger: consoleLogger, - // debug: true, - // traceAll: true, -}) - -// base directory -const baseDir = path.resolve(__dirname) - -// function to validate and dynamically import a module -async function importDeployerIfExists(dir: string) { - const deployerPath = path.resolve(dir, 'deploy-config') - if (fs.existsSync(deployerPath + '.ts') || fs.existsSync(deployerPath + '.js')) { - const deployer = await import(deployerPath) - return deployer.deploy - } -} - -// get a list of all deployers from the subdirectories -async function getDeployers() { - const directories = fs.readdirSync(baseDir, { withFileTypes: true }) - .filter(dirent => dirent.isDirectory()) - .map(dirent => path.resolve(baseDir, dirent.name)) - - return Promise.all(directories.map(importDeployerIfExists)) -} - -// execute all the deployers -(async () => { - const contractDeployers = (await getDeployers()).filter(Boolean) - - for (const deployer of contractDeployers) { - try { - await deployer() - } catch (e) { - console.error(e) - } - } -})() diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/tsconfig.json b/examples/starter_beaker_react/projects/starter_beaker_react-contracts/tsconfig.json deleted file mode 100644 index fc75893..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-contracts/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "strict": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "esModuleInterop": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "allowJs": false, - "allowSyntheticDefaultImports": true, - "module": "CommonJS", - "moduleResolution": "Node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true - }, - "include": ["smart_contracts/**/*.ts"], - "exclude": ["node_modules", "dist", "coverage"] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.algokit.toml b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.algokit.toml deleted file mode 100644 index 4d91074..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.algokit.toml +++ /dev/null @@ -1,11 +0,0 @@ -[algokit] -min_version = "v2.0.0" - -[project] -type = "frontend" -name = 'starter_beaker_react-frontend' -artifacts = "src/contracts" - -[project.run] -build = { commands = ['npm run build'], description = 'Build frontend' } -test = { commands = ['npm run test'], description = 'Run frontend tests' } diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.algokit/.copier-answers.yml b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.algokit/.copier-answers.yml deleted file mode 100644 index e6ce5d8..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.algokit/.copier-answers.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 1.0.7 -_src_path: gh:algorandfoundation/algokit-react-frontend-template -author_email: None -author_name: None -preset_name: starter -project_name: starter_beaker_react-frontend - diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.env.template b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.env.template deleted file mode 100644 index e05d499..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.env.template +++ /dev/null @@ -1,67 +0,0 @@ -# ====================== -# LocalNet configuration -# uncomment below to use -# ====================== - -VITE_ENVIRONMENT=local - -# Algod -VITE_ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -VITE_ALGOD_SERVER=http://localhost -VITE_ALGOD_PORT=4001 -VITE_ALGOD_NETWORK="" - -# Indexer -VITE_INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -VITE_INDEXER_SERVER=http://localhost -VITE_INDEXER_PORT=8980 - -# KMD -# Please note: -# 1. This is only needed for LocalNet since -# by default KMD provider is ignored on other networks. -# 2. AlgoKit LocalNet starts with a single wallet called 'unencrypted-default-wallet', -# with heaps of tokens available for testing. -VITE_KMD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -VITE_KMD_SERVER=http://localhost -VITE_KMD_PORT=4002 -VITE_KMD_WALLET="unencrypted-default-wallet" -VITE_KMD_PASSWORD="" - -# # ====================== -# # TestNet configuration: -# # uncomment below to use -# # ====================== - -# VITE_ENVIRONMENT=local - -# # Algod -# VITE_ALGOD_TOKEN="" -# VITE_ALGOD_SERVER="https://testnet-api.algonode.cloud" -# VITE_ALGOD_PORT="" -# VITE_ALGOD_NETWORK="testnet" - -# # Indexer -# VITE_INDEXER_TOKEN="" -# VITE_INDEXER_SERVER="https://testnet-idx.algonode.cloud" -# VITE_INDEXER_PORT="" - - -# # ====================== -# # MainNet configuration: -# # uncomment below to use -# # ====================== - -# VITE_ENVIRONMENT=production - -# # Algod -# VITE_ALGOD_TOKEN="" -# VITE_ALGOD_SERVER="https://mainnet-api.algonode.cloud" -# VITE_ALGOD_PORT="" -# VITE_ALGOD_NETWORK="mainnet" - -# # Indexer -# VITE_INDEXER_TOKEN="" -# VITE_INDEXER_SERVER="https://mainnet-idx.algonode.cloud" -# VITE_INDEXER_PORT="" - diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.gitignore b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.gitignore deleted file mode 100644 index b1ce837..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - - -# dotenv environment variable files -.env -env/ - -# misc -/dist -.DS_Store - - -npm-debug.log* -yarn-debug.log* -yarn-error.log* -/test-results/ -/playwright-report/ -/playwright/.cache/ - -# PyCharm -.idea -!.idea/ -.idea/* -!.idea/runConfigurations/ - -.vercel -.netlify diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.npmrc b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.npmrc deleted file mode 100644 index c42da84..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.npmrc +++ /dev/null @@ -1 +0,0 @@ -engine-strict = true diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/extensions.json b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/extensions.json deleted file mode 100644 index 6d0554a..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/extensions.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "recommendations": [ - "EditorConfig.EditorConfig", - "dotenv.dotenv-vscode", - ] -} - diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/launch.json b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/launch.json deleted file mode 100644 index 7edaf04..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/launch.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "configurations": [ - { - "type": "msedge", - "request": "launch", - "name": "Run (Edge)", - "url": "http://localhost:5173", - "webRoot": "${workspaceFolder}", - "presentation": { - "hidden": false, - "group": "2. Web" - } - }, - { - "type": "chrome", - "request": "launch", - "name": "Run (Chrome)", - "url": "http://localhost:5173", - "webRoot": "${workspaceFolder}", - "presentation": { - "hidden": false, - "group": "2. Web" - } - }, - { - "type": "firefox", - "request": "launch", - "name": "Run (Firefox)", - "url": "http://localhost:5173", - "webRoot": "${workspaceFolder}", - "presentation": { - "hidden": false, - "group": "2. Web" - } - }, - { - "name": "Run dApp", - "type": "node", - "request": "launch", - "runtimeExecutable": "npm", - "runtimeArgs": ["run", "dev"], - "cwd": "${workspaceRoot}", - "console": "integratedTerminal", - "skipFiles": ["/**", "node_modules/**"], - "presentation": { - "hidden": false, - "group": "1. Run Project", - "order": 1 - } - }, - { - "name": "Run dApp (+ LocalNet)", - "type": "node", - "request": "launch", - "runtimeExecutable": "npm", - "runtimeArgs": ["run", "dev"], - "cwd": "${workspaceRoot}", - "console": "integratedTerminal", - "skipFiles": ["/**", "node_modules/**"], - "preLaunchTask": "Start AlgoKit LocalNet", - "presentation": { - "hidden": false, - "group": "1. Run Project", - "order": 1 - } - } - ] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/settings.json b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/settings.json deleted file mode 100644 index f34d28b..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "editor.formatOnSave": true, - - "dotenv.enableAutocloaking": false, - -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/tasks.json b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/tasks.json deleted file mode 100644 index d611c4f..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/.vscode/tasks.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "Start AlgoKit LocalNet", - "command": "algokit", - "args": ["localnet", "start"], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - } - ] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/README.md b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/README.md deleted file mode 100644 index 58f3479..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# starter_beaker_react-frontend - -This starter React project has been generated using AlgoKit. See below for default getting started instructions. - -# Setup - -### Initial Setup - -#### 1. Clone the Repository -Start by cloning this repository to your local machine. - -#### 2. Install Pre-requisites -Ensure the following pre-requisites are installed and properly configured: - -- **npm**: Node package manager. Install from [Node.js Installation Guide](https://nodejs.org/en/download/). Verify with `npm -v` to see version `18.12`+. -- **AlgoKit CLI**: Essential for project setup and operations. Install the latest version from [AlgoKit CLI Installation Guide](https://github.com/algorandfoundation/algokit-cli#install). Verify installation with `algokit --version`, expecting `2.0.0` or later. - -#### 3. Bootstrap Your Local Environment -Run the following commands within the project folder: - -- **Install Project Dependencies**: With `algokit project bootstrap all`, ensure all dependencies are ready. - -### Development Workflow - -#### Terminal -Directly manage and interact with your project using AlgoKit commands: - -1. **Build Contracts**: `algokit project run build` builds react web app and links with smart contracts in workspace, if any. -2. Remaining set of command for linting, testing and deployment can be found in respective [package.json](./package.json) file and [.algokit.toml](./.algokit.toml) files. - -#### VS Code -For a seamless experience with breakpoint debugging and other features: - -1. **Open Project**: In VS Code, open the repository root. -2. **Install Extensions**: Follow prompts to install recommended extensions. -3. **Debugging**: - - Use `F5` to start debugging. - - **Windows Users**: Select the Python interpreter at `./.venv/Scripts/python.exe` via `Ctrl/Cmd + Shift + P` > `Python: Select Interpreter` before the first run. - -#### Other IDEs -While primarily optimized for VS Code, Jetbrains WebStorm has base support for this project: - -1. **Open Project**: In your JetBrains IDE, open the repository root. -2. **Automatic Setup**: The IDE should configure the Python interpreter and virtual environment. -3. **Debugging**: Use `Shift+F10` or `Ctrl+R` to start debugging. Note: Windows users may encounter issues with pre-launch tasks due to a known bug. See [JetBrains forums](https://youtrack.jetbrains.com/issue/IDEA-277486/Shell-script-configuration-cannot-run-as-before-launch-task) for workarounds. - -## AlgoKit Workspaces and Project Management -This project supports both standalone and monorepo setups through AlgoKit workspaces. Leverage [`algokit project run`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md) commands for efficient monorepo project orchestration and management across multiple projects within a workspace. - -> Please note, by default frontend is pre configured to run against Algorand LocalNet. If you want to run against TestNet or MainNet, comment out the current environment variable and uncomment the relevant one in [`.env`](.env) file that is created after running bootstrap command and based on [`.env.template`](.env.template). - -# Algorand Wallet integrations - -The template comes with [`use-wallet`](https://github.com/txnlab/use-wallet) integration, which provides a React hook for connecting to an Algorand wallet providers. The following wallet providers are included by default: -- LocalNet: -- - [KMD/Local Wallet](https://github.com/TxnLab/use-wallet#kmd-algorand-key-management-daemon) - Algorand's Key Management Daemon (KMD) is a service that manages Algorand private keys and signs transactions. Works best with AlgoKit LocalNet and allows you to easily test and interact with your dApps locally. -- TestNet and others: -- - [Pera Wallet](https://perawallet.app). -- - [Defly Wallet](https://defly.app). -- - [Exodus Wallet](https://www.exodus.com). -- - [Daffi Wallet](https://www.daffi.me). - -Refer to official [`use-wallet`](https://github.com/txnlab/use-wallet) documentation for detailed guidelines on how to integrate with other wallet providers (such as WalletConnect v2). Too see implementation details on the use wallet hook and initialization of extra wallet providers refer to [`App.tsx`](./src/App.tsx). - -# Tools - -This project makes use of React and Tailwind to provider a base project configuration to develop frontends for your Algorand dApps and interactions with smart contracts. The following tools are in use: - -- [AlgoKit Utils](https://github.com/algorandfoundation/algokit-utils-ts) - Various TypeScript utilities to simplify interactions with Algorand and AlgoKit. -- [React](https://reactjs.org/) - A JavaScript library for building user interfaces. -- [use-wallet](https://github.com/txnlab/use-wallet) - A React hook for connecting to an Algorand wallet providers. -- [npm](https://www.npmjs.com/): Node.js package manager -It has also been configured to have a productive dev experience out of the box in [VS Code](https://code.visualstudio.com/), see the [.vscode](./.vscode) folder. -# Integrating with smart contracts and application clients - -Refer to the detailed guidance on [integrating with smart contracts and application clients](./src/contracts/README.md). In essence, for any smart contract codebase generated with AlgoKit or other tools that produce compile contracts into ARC34 compliant app specifications, you can use the `algokit generate` command to generate TypeScript or Python typed client. Once generated simply drag and drop the generated client into `./src/contracts` and import it into your React components as you see fit. diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/index.html b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/index.html deleted file mode 100644 index a85566a..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - AlgoKit React Template - - -
- - - - diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/package.json b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/package.json deleted file mode 100644 index 1939996..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "starter_beaker_react-frontend", - "version": "0.1.0", - "author": { - "name": "None", - "email": "None" - }, - "private": true, - "type": "module", - "engines": { - "node": ">=18.0", - "npm": ">=9.0" - }, - "devDependencies": { - "@algorandfoundation/algokit-client-generator": "^3.0.3", - "@types/node": "^18.17.14", - "@types/react": "^18.2.11", - "@types/react-dom": "^18.2.4", - "@vitejs/plugin-react": "^4.2.1", - "autoprefixer": "^10.4.14", - "ts-node": "^10.9.1", - "typescript": "^5.1.6", - "vite": "^5.0.0" - }, - "dependencies": { - "@walletconnect/modal-sign-html": "^2.6.1", - "@algorandfoundation/algokit-utils": "^6.0.2", - "@blockshake/defly-connect": "^1.1.6", - "@daffiwallet/connect": "^1.0.3", - "@perawallet/connect": "^1.3.1", - "@txnlab/use-wallet": "^2.4.0", - "algosdk": "^2.7.0", - "notistack": "^3.0.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "tslib": "^2.6.2" - }, - "scripts": { - "generate:app-clients": "algokit project link --all", - "dev": "npm run generate:app-clients && vite", - "build": "npm run generate:app-clients && tsc && vite build", - "preview": "vite preview" - }, - "eslintConfig": { - "extends": [ - "react-app" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/public/index.html b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/public/index.html deleted file mode 100644 index 0d3a3a5..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/public/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - React App - - - -
- - - diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/public/robots.txt b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/public/robots.txt deleted file mode 100644 index e9e57dc..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/App.tsx b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/App.tsx deleted file mode 100644 index 58feddf..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/App.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { DeflyWalletConnect } from '@blockshake/defly-connect' -import { DaffiWalletConnect } from '@daffiwallet/connect' -import { PeraWalletConnect } from '@perawallet/connect' -import { PROVIDER_ID, ProvidersArray, WalletProvider, useInitializeProviders } from '@txnlab/use-wallet' -import algosdk from 'algosdk' -import { SnackbarProvider } from 'notistack' -import Home from './Home' -import { getAlgodConfigFromViteEnvironment, getKmdConfigFromViteEnvironment } from './utils/network/getAlgoClientConfigs' - -let providersArray: ProvidersArray -if (import.meta.env.VITE_ALGOD_NETWORK === '') { - const kmdConfig = getKmdConfigFromViteEnvironment() - providersArray = [ - { - id: PROVIDER_ID.KMD, - clientOptions: { - wallet: kmdConfig.wallet, - password: kmdConfig.password, - host: kmdConfig.server, - token: String(kmdConfig.token), - port: String(kmdConfig.port), - }, - }, - ] -} else { - providersArray = [ - { id: PROVIDER_ID.DEFLY, clientStatic: DeflyWalletConnect }, - { id: PROVIDER_ID.PERA, clientStatic: PeraWalletConnect }, - { id: PROVIDER_ID.DAFFI, clientStatic: DaffiWalletConnect }, - { id: PROVIDER_ID.EXODUS }, - // If you are interested in WalletConnect v2 provider - // refer to https://github.com/TxnLab/use-wallet for detailed integration instructions - ] -} - -export default function App() { - const algodConfig = getAlgodConfigFromViteEnvironment() - - const walletProviders = useInitializeProviders({ - providers: providersArray, - nodeConfig: { - network: algodConfig.network, - nodeServer: algodConfig.server, - nodePort: String(algodConfig.port), - nodeToken: String(algodConfig.token), - }, - algosdkStatic: algosdk, - }) - - return ( - - - - - - ) -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/Home.tsx b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/Home.tsx deleted file mode 100644 index 192f3b9..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/Home.tsx +++ /dev/null @@ -1,76 +0,0 @@ -// src/components/Home.tsx -import { useWallet } from '@txnlab/use-wallet' -import React, { useState } from 'react' -import ConnectWallet from './components/ConnectWallet' -import Transact from './components/Transact' -import AppCalls from './components/AppCalls' - -interface HomeProps {} - -const Home: React.FC = () => { - const [openWalletModal, setOpenWalletModal] = useState(false) - const [openDemoModal, setOpenDemoModal] = useState(false) - const [appCallsDemoModal, setAppCallsDemoModal] = useState(false) - const { activeAddress } = useWallet() - - const toggleWalletModal = () => { - setOpenWalletModal(!openWalletModal) - } - - const toggleDemoModal = () => { - setOpenDemoModal(!openDemoModal) - } - - const toggleAppCallsModal = () => { - setAppCallsDemoModal(!appCallsDemoModal) - } - - return ( -
-
-
-

- Welcome to
AlgoKit 🙂
-

-

- This starter has been generated using official AlgoKit React template. Refer to the resource below for next steps. -

- -
- - Getting started - - -
- - - {activeAddress && ( - - )} - - {activeAddress && ( - - )} -
- - - - -
-
-
- ) -} - -export default Home diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/assets/logo.svg b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/assets/logo.svg deleted file mode 100644 index 7169476..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/assets/logo.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/Account.tsx b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/Account.tsx deleted file mode 100644 index 6a6345e..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/Account.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { useWallet } from '@txnlab/use-wallet' -import { useMemo } from 'react' -import { ellipseAddress } from '../utils/ellipseAddress' -import { getAlgodConfigFromViteEnvironment } from '../utils/network/getAlgoClientConfigs' - -const Account = () => { - const { activeAddress } = useWallet() - const algoConfig = getAlgodConfigFromViteEnvironment() - - const dappFlowNetworkName = useMemo(() => { - return algoConfig.network === '' ? 'sandbox' : algoConfig.network.toLocaleLowerCase() - }, [algoConfig.network]) - - return ( -
- - Address: {ellipseAddress(activeAddress)} - -
Network: {algoConfig.network === '' ? 'localnet' : algoConfig.network}
-
- ) -} - -export default Account diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/AppCalls.tsx b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/AppCalls.tsx deleted file mode 100644 index 429ef89..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/AppCalls.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import * as algokit from '@algorandfoundation/algokit-utils' -import { TransactionSignerAccount } from '@algorandfoundation/algokit-utils/types/account' -import { useWallet } from '@txnlab/use-wallet' -import { useSnackbar } from 'notistack' -import { useState } from 'react' -import { AppDetails } from '@algorandfoundation/algokit-utils/types/app-client' -import { HelloWorldClient } from '../contracts/hello_world' -import { OnSchemaBreak, OnUpdate } from '@algorandfoundation/algokit-utils/types/app' -import { getAlgodConfigFromViteEnvironment, getIndexerConfigFromViteEnvironment } from '../utils/network/getAlgoClientConfigs' - -interface AppCallsInterface { - openModal: boolean - setModalState: (value: boolean) => void -} - -const AppCalls = ({ openModal, setModalState }: AppCallsInterface) => { - const [loading, setLoading] = useState(false) - const [contractInput, setContractInput] = useState('') - - const algodConfig = getAlgodConfigFromViteEnvironment() - const algodClient = algokit.getAlgoClient({ - server: algodConfig.server, - port: algodConfig.port, - token: algodConfig.token, - }) - const indexerConfig = getIndexerConfigFromViteEnvironment() - const indexer = algokit.getAlgoIndexerClient({ - server: indexerConfig.server, - port: indexerConfig.port, - token: indexerConfig.token, - }) - - const { enqueueSnackbar } = useSnackbar() - const { signer, activeAddress } = useWallet() - - const sendAppCall = async () => { - setLoading(true) - - // Please note, in typical production scenarios, - // you wouldn't want to use deploy directly from your frontend. - // Instead, you would deploy your contract on your backend and reference it by id. - // Given the simplicity of the starter contract, we are deploying it on the frontend - // for demonstration purposes. - const appDetails = { - resolveBy: 'creatorAndName', - sender: { signer, addr: activeAddress } as TransactionSignerAccount, - creatorAddress: activeAddress, - findExistingUsing: indexer, - } as AppDetails - - const appClient = new HelloWorldClient(appDetails, algodClient) - const deployParams = { - onSchemaBreak: OnSchemaBreak.AppendApp, - onUpdate: OnUpdate.AppendApp, - } - await appClient.deploy(deployParams).catch((e: Error) => { - enqueueSnackbar(`Error deploying the contract: ${e.message}`, { variant: 'error' }) - setLoading(false) - return - }) - - const response = await appClient.hello({ name: contractInput }).catch((e: Error) => { - enqueueSnackbar(`Error calling the contract: ${e.message}`, { variant: 'error' }) - setLoading(false) - return - }) - - enqueueSnackbar(`Response from the contract: ${response?.return}`, { variant: 'success' }) - setLoading(false) - } - - return ( - -
-

Say hello to your Algorand smart contract

-
- { - setContractInput(e.target.value) - }} - /> -
- - -
-
-
- ) -} - -export default AppCalls diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/ConnectWallet.tsx b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/ConnectWallet.tsx deleted file mode 100644 index 62ee609..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/ConnectWallet.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { Provider, useWallet } from '@txnlab/use-wallet' -import Account from './Account' - -interface ConnectWalletInterface { - openModal: boolean - closeModal: () => void -} - -const ConnectWallet = ({ openModal, closeModal }: ConnectWalletInterface) => { - const { providers, activeAddress } = useWallet() - - const isKmd = (provider: Provider) => provider.metadata.name.toLowerCase() === 'kmd' - - return ( - -
-

Select wallet provider

- -
- {activeAddress && ( - <> - -
- - )} - - {!activeAddress && - providers?.map((provider) => ( - - ))} -
- -
- - {activeAddress && ( - - )} -
- -
- ) -} -export default ConnectWallet diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/ErrorBoundary.tsx b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/ErrorBoundary.tsx deleted file mode 100644 index 435bf61..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/ErrorBoundary.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React, { ReactNode } from 'react' - -interface ErrorBoundaryProps { - children: ReactNode -} - -interface ErrorBoundaryState { - hasError: boolean - error: Error | null -} - -class ErrorBoundary extends React.Component { - constructor(props: ErrorBoundaryProps) { - super(props) - this.state = { hasError: false, error: null } - } - - static getDerivedStateFromError(error: Error): ErrorBoundaryState { - // Update state so the next render will show the fallback UI. - return { hasError: true, error: error } - } - - render(): ReactNode { - if (this.state.hasError) { - // You can render any custom fallback UI - return ( -
-
-
-

Error occured

-

- {this.state.error?.message.includes('Attempt to get default algod configuration') - ? 'Please make sure to set up your environment variables correctly. Create a .env file based on .env.template and fill in the required values. This controls the network and credentials for connections with Algod and Indexer.' - : this.state.error?.message} -

-
-
-
- ) - } - - return this.props.children - } -} - -export default ErrorBoundary diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/Transact.tsx b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/Transact.tsx deleted file mode 100644 index becfadc..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/components/Transact.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import * as algokit from '@algorandfoundation/algokit-utils' -import { useWallet } from '@txnlab/use-wallet' -import algosdk from 'algosdk' -import { useSnackbar } from 'notistack' -import { useState } from 'react' -import { getAlgodConfigFromViteEnvironment } from '../utils/network/getAlgoClientConfigs' - -interface TransactInterface { - openModal: boolean - setModalState: (value: boolean) => void -} - -const Transact = ({ openModal, setModalState }: TransactInterface) => { - const [loading, setLoading] = useState(false) - const [receiverAddress, setReceiverAddress] = useState('') - - const algodConfig = getAlgodConfigFromViteEnvironment() - const algodClient = algokit.getAlgoClient({ - server: algodConfig.server, - port: algodConfig.port, - token: algodConfig.token, - }) - - const { enqueueSnackbar } = useSnackbar() - - const { signer, activeAddress, signTransactions, sendTransactions } = useWallet() - - const handleSubmitAlgo = async () => { - setLoading(true) - - if (!signer || !activeAddress) { - enqueueSnackbar('Please connect wallet first', { variant: 'warning' }) - return - } - - const suggestedParams = await algodClient.getTransactionParams().do() - - const transaction = algosdk.makePaymentTxnWithSuggestedParamsFromObject({ - from: activeAddress, - to: receiverAddress, - amount: 1e6, - suggestedParams, - }) - - const encodedTransaction = algosdk.encodeUnsignedTransaction(transaction) - - const signedTransactions = await signTransactions([encodedTransaction]) - - const waitRoundsToConfirm = 4 - - try { - enqueueSnackbar('Sending transaction...', { variant: 'info' }) - const { id } = await sendTransactions(signedTransactions, waitRoundsToConfirm) - enqueueSnackbar(`Transaction sent: ${id}`, { variant: 'success' }) - setReceiverAddress('') - } catch (e) { - enqueueSnackbar('Failed to send transaction', { variant: 'error' }) - } - - setLoading(false) - } - - return ( - -
-

Send payment transaction

-
- { - setReceiverAddress(e.target.value) - }} - /> -
- - -
-
-
- ) -} - -export default Transact diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/contracts/README.md b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/contracts/README.md deleted file mode 100644 index 04629b1..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/contracts/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## How to connect my web app with Algorand smart contracts? - -The following folder is reserved for the Algorand Application Clients. The clients are used to interact with instances of Algorand Smart Contracts (ASC1s) deployed on-chain. - -To integrate this react frontend template with your smart contracts codebase, perform the following steps: - -1. Generate the typed client using `algokit generate client -l typescript -o {path/to/this/folder}` or using the dedicated `link` command `algokit project link` (ensure to invoke it from the root of this react project). Using the `link` command is especially useful within workspaces that have multiple contract projects. -2. The generated typescript client should be ready to be imported and used in this react frontend template, making it a full fledged dApp. - -> Please note, by default this template defines `"generate:app-clients": "algokit project link --all"` which is a shortcut to automatically link TEAL code from all `contract` projects in the workspace as typed clients into the `frontend` project that is invoking the `link` command. Refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/link.md) to read more about `link` command. - -## **How to interact with the smart contract?** - -The generated client provides a set of functions that can be used to interact with the ABI (Application Binary Interface) compliant Algorand smart contract. For example, if the smart contract has a function called `hello`, the generated client will have a function called `hello` that can be used to interact with the smart contract. Refer to a [full-stack end-to-end starter template](https://github.com/algorandfoundation/algokit-fullstack-template) for a reference example on invoking and interacting with typescript typed clients generated. diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/contracts/hello_world.ts b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/contracts/hello_world.ts deleted file mode 100644 index 805fab4..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/contracts/hello_world.ts +++ /dev/null @@ -1,449 +0,0 @@ -/* eslint-disable */ -/** - * This file was automatically generated by @algorandfoundation/algokit-client-generator. - * DO NOT MODIFY IT BY HAND. - * requires: @algorandfoundation/algokit-utils: ^2 - */ -import * as algokit from '@algorandfoundation/algokit-utils' -import type { - ABIAppCallArg, - AppCallTransactionResult, - AppCallTransactionResultOfType, - AppCompilationResult, - AppReference, - AppState, - AppStorageSchema, - CoreAppCallArgs, - RawAppCallArgs, - TealTemplateParams, -} from '@algorandfoundation/algokit-utils/types/app' -import type { - AppClientCallCoreParams, - AppClientCompilationParams, - AppClientDeployCoreParams, - AppDetails, - ApplicationClient, -} from '@algorandfoundation/algokit-utils/types/app-client' -import type { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec' -import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, SendTransactionParams } from '@algorandfoundation/algokit-utils/types/transaction' -import type { ABIResult, TransactionWithSigner } from 'algosdk' -import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk' -export const APP_SPEC: AppSpec = { - "hints": { - "hello(string)string": { - "call_config": { - "no_op": "CALL" - } - } - }, - "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDgKaW50Y2Jsb2NrIDAgMQpieXRlY2Jsb2NrIDB4CnR4biBOdW1BcHBBcmdzCmludGNfMCAvLyAwCj09CmJueiBtYWluX2w0CnR4bmEgQXBwbGljYXRpb25BcmdzIDAKcHVzaGJ5dGVzIDB4MDJiZWNlMTEgLy8gImhlbGxvKHN0cmluZylzdHJpbmciCj09CmJueiBtYWluX2wzCmVycgptYWluX2wzOgp0eG4gT25Db21wbGV0aW9uCmludGNfMCAvLyBOb09wCj09CnR4biBBcHBsaWNhdGlvbklECmludGNfMCAvLyAwCiE9CiYmCmFzc2VydApjYWxsc3ViIGhlbGxvY2FzdGVyXzEKaW50Y18xIC8vIDEKcmV0dXJuCm1haW5fbDQ6CnR4biBPbkNvbXBsZXRpb24KaW50Y18wIC8vIE5vT3AKPT0KYm56IG1haW5fbDYKZXJyCm1haW5fbDY6CnR4biBBcHBsaWNhdGlvbklECmludGNfMCAvLyAwCj09CmFzc2VydAppbnRjXzEgLy8gMQpyZXR1cm4KCi8vIGhlbGxvCmhlbGxvXzA6CnByb3RvIDEgMQpieXRlY18wIC8vICIiCnB1c2hieXRlcyAweDQ4NjU2YzZjNmYyYzIwIC8vICJIZWxsbywgIgpmcmFtZV9kaWcgLTEKZXh0cmFjdCAyIDAKY29uY2F0CmZyYW1lX2J1cnkgMApmcmFtZV9kaWcgMApsZW4KaXRvYgpleHRyYWN0IDYgMApmcmFtZV9kaWcgMApjb25jYXQKZnJhbWVfYnVyeSAwCnJldHN1YgoKLy8gaGVsbG9fY2FzdGVyCmhlbGxvY2FzdGVyXzE6CnByb3RvIDAgMApieXRlY18wIC8vICIiCmR1cAp0eG5hIEFwcGxpY2F0aW9uQXJncyAxCmZyYW1lX2J1cnkgMQpmcmFtZV9kaWcgMQpjYWxsc3ViIGhlbGxvXzAKZnJhbWVfYnVyeSAwCnB1c2hieXRlcyAweDE1MWY3Yzc1IC8vIDB4MTUxZjdjNzUKZnJhbWVfZGlnIDAKY29uY2F0CmxvZwpyZXRzdWI=", - "clear": "I3ByYWdtYSB2ZXJzaW9uIDgKcHVzaGludCAwIC8vIDAKcmV0dXJu" - }, - "state": { - "global": { - "num_byte_slices": 0, - "num_uints": 0 - }, - "local": { - "num_byte_slices": 0, - "num_uints": 0 - } - }, - "schema": { - "global": { - "declared": {}, - "reserved": {} - }, - "local": { - "declared": {}, - "reserved": {} - } - }, - "contract": { - "name": "hello_world", - "methods": [ - { - "name": "hello", - "args": [ - { - "type": "string", - "name": "name" - } - ], - "returns": { - "type": "string" - } - } - ], - "networks": {} - }, - "bare_call_config": { - "no_op": "CREATE" - } -} - -/** - * Defines an onCompletionAction of 'no_op' - */ -export type OnCompleteNoOp = { onCompleteAction?: 'no_op' | OnApplicationComplete.NoOpOC } -/** - * Defines an onCompletionAction of 'opt_in' - */ -export type OnCompleteOptIn = { onCompleteAction: 'opt_in' | OnApplicationComplete.OptInOC } -/** - * Defines an onCompletionAction of 'close_out' - */ -export type OnCompleteCloseOut = { onCompleteAction: 'close_out' | OnApplicationComplete.CloseOutOC } -/** - * Defines an onCompletionAction of 'delete_application' - */ -export type OnCompleteDelApp = { onCompleteAction: 'delete_application' | OnApplicationComplete.DeleteApplicationOC } -/** - * Defines an onCompletionAction of 'update_application' - */ -export type OnCompleteUpdApp = { onCompleteAction: 'update_application' | OnApplicationComplete.UpdateApplicationOC } -/** - * A state record containing a single unsigned integer - */ -export type IntegerState = { - /** - * Gets the state value as a BigInt. - */ - asBigInt(): bigint - /** - * Gets the state value as a number. - */ - asNumber(): number -} -/** - * A state record containing binary data - */ -export type BinaryState = { - /** - * Gets the state value as a Uint8Array - */ - asByteArray(): Uint8Array - /** - * Gets the state value as a string - */ - asString(): string -} - -export type AppCreateCallTransactionResult = AppCallTransactionResult & Partial & AppReference -export type AppUpdateCallTransactionResult = AppCallTransactionResult & Partial - -export type AppClientComposeCallCoreParams = Omit & { - sendParams?: Omit -} -export type AppClientComposeExecuteParams = Pick - -export type IncludeSchema = { - /** - * Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used. - */ - schema?: Partial -} - -/** - * Defines the types of available calls and state of the HelloWorld smart contract. - */ -export type HelloWorld = { - /** - * Maps method signatures / names to their argument and return types. - */ - methods: - & Record<'hello(string)string' | 'hello', { - argsObj: { - name: string - } - argsTuple: [name: string] - returns: string - }> -} -/** - * Defines the possible abi call signatures - */ -export type HelloWorldSig = keyof HelloWorld['methods'] -/** - * Defines an object containing all relevant parameters for a single call to the contract. Where TSignature is undefined, a bare call is made - */ -export type TypedCallParams = { - method: TSignature - methodArgs: TSignature extends undefined ? undefined : Array -} & AppClientCallCoreParams & CoreAppCallArgs -/** - * Defines the arguments required for a bare call - */ -export type BareCallArgs = Omit -/** - * Maps a method signature from the HelloWorld smart contract to the method's arguments in either tuple of struct form - */ -export type MethodArgs = HelloWorld['methods'][TSignature]['argsObj' | 'argsTuple'] -/** - * Maps a method signature from the HelloWorld smart contract to the method's return type - */ -export type MethodReturn = HelloWorld['methods'][TSignature]['returns'] - -/** - * A factory for available 'create' calls - */ -export type HelloWorldCreateCalls = (typeof HelloWorldCallFactory)['create'] -/** - * Defines supported create methods for this smart contract - */ -export type HelloWorldCreateCallParams = - | (TypedCallParams & (OnCompleteNoOp)) -/** - * Defines arguments required for the deploy method. - */ -export type HelloWorldDeployArgs = { - deployTimeParams?: TealTemplateParams - /** - * A delegate which takes a create call factory and returns the create call params for this smart contract - */ - createCall?: (callFactory: HelloWorldCreateCalls) => HelloWorldCreateCallParams -} - - -/** - * Exposes methods for constructing all available smart contract calls - */ -export abstract class HelloWorldCallFactory { - /** - * Gets available create call factories - */ - static get create() { - return { - /** - * Constructs a create call for the hello_world smart contract using a bare call - * - * @param params Any parameters for the call - * @returns A TypedCallParams object for the call - */ - bare(params: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs & AppClientCompilationParams & (OnCompleteNoOp) = {}) { - return { - method: undefined, - methodArgs: undefined, - ...params, - } - }, - } - } - - /** - * Constructs a no op call for the hello(string)string ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - static hello(args: MethodArgs<'hello(string)string'>, params: AppClientCallCoreParams & CoreAppCallArgs) { - return { - method: 'hello(string)string' as const, - methodArgs: Array.isArray(args) ? args : [args.name], - ...params, - } - } -} - -/** - * A client to make calls to the hello_world smart contract - */ -export class HelloWorldClient { - /** - * The underlying `ApplicationClient` for when you want to have more flexibility - */ - public readonly appClient: ApplicationClient - - private readonly sender: SendTransactionFrom | undefined - - /** - * Creates a new instance of `HelloWorldClient` - * - * @param appDetails appDetails The details to identify the app to deploy - * @param algod An algod client instance - */ - constructor(appDetails: AppDetails, private algod: Algodv2) { - this.sender = appDetails.sender - this.appClient = algokit.getAppClient({ - ...appDetails, - app: APP_SPEC - }, algod) - } - - /** - * Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type - * - * @param result The AppCallTransactionResult to be mapped - * @param returnValueFormatter An optional delegate to format the return value if required - * @returns The smart contract response with an updated return value - */ - protected mapReturnValue(result: AppCallTransactionResult, returnValueFormatter?: (value: any) => TReturn): AppCallTransactionResultOfType & TResult { - if(result.return?.decodeError) { - throw result.return.decodeError - } - const returnValue = result.return?.returnValue !== undefined && returnValueFormatter !== undefined - ? returnValueFormatter(result.return.returnValue) - : result.return?.returnValue as TReturn | undefined - return { ...result, return: returnValue } as AppCallTransactionResultOfType & TResult - } - - /** - * Calls the ABI method with the matching signature using an onCompletion code of NO_OP - * - * @param typedCallParams An object containing the method signature, args, and any other relevant parameters - * @param returnValueFormatter An optional delegate which when provided will be used to map non-undefined return values to the target type - * @returns The result of the smart contract call - */ - public async call(typedCallParams: TypedCallParams, returnValueFormatter?: (value: any) => MethodReturn) { - return this.mapReturnValue>(await this.appClient.call(typedCallParams), returnValueFormatter) - } - - /** - * Idempotently deploys the hello_world smart contract. - * - * @param params The arguments for the contract calls and any additional parameters for the call - * @returns The deployment result - */ - public deploy(params: HelloWorldDeployArgs & AppClientDeployCoreParams & IncludeSchema = {}): ReturnType { - const createArgs = params.createCall?.(HelloWorldCallFactory.create) - return this.appClient.deploy({ - ...params, - createArgs, - createOnCompleteAction: createArgs?.onCompleteAction, - }) - } - - /** - * Gets available create methods - */ - public get create() { - const $this = this - return { - /** - * Creates a new instance of the hello_world smart contract using a bare call. - * - * @param args The arguments for the bare call - * @returns The create result - */ - async bare(args: BareCallArgs & AppClientCallCoreParams & AppClientCompilationParams & IncludeSchema & CoreAppCallArgs & (OnCompleteNoOp) = {}) { - return $this.mapReturnValue(await $this.appClient.create(args)) - }, - } - } - - /** - * Makes a clear_state call to an existing instance of the hello_world smart contract. - * - * @param args The arguments for the bare call - * @returns The clear_state result - */ - public clearState(args: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.appClient.clearState(args) - } - - /** - * Calls the hello(string)string ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The result of the call - */ - public hello(args: MethodArgs<'hello(string)string'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.call(HelloWorldCallFactory.hello(args, params)) - } - - public compose(): HelloWorldComposer { - const client = this - const atc = new AtomicTransactionComposer() - let promiseChain:Promise = Promise.resolve() - const resultMappers: Array any)> = [] - return { - hello(args: MethodArgs<'hello(string)string'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.hello(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.clearState({...args, sendParams: {...args?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom) { - promiseChain = promiseChain.then(async () => atc.addTransaction(await algokit.getTransactionWithSigner(txn, defaultSender ?? client.sender))) - return this - }, - async atc() { - await promiseChain - return atc - }, - async simulate(options?: SimulateOptions) { - await promiseChain - const result = await atc.simulate(client.algod, new modelsv2.SimulateRequest({ txnGroups: [], ...options })) - return { - ...result, - returns: result.methodResults?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - }, - async execute(sendParams?: AppClientComposeExecuteParams) { - await promiseChain - const result = await algokit.sendAtomicTransactionComposer({ atc, sendParams }, client.algod) - return { - ...result, - returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - } - } as unknown as HelloWorldComposer - } -} -export type HelloWorldComposer = { - /** - * Calls the hello(string)string ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - hello(args: MethodArgs<'hello(string)string'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): HelloWorldComposer<[...TReturns, MethodReturn<'hello(string)string'>]> - - /** - * Makes a clear_state call to an existing instance of the hello_world smart contract. - * - * @param args The arguments for the bare call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs): HelloWorldComposer<[...TReturns, undefined]> - - /** - * Adds a transaction to the composer - * - * @param txn One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by one of algokit utils helpers (signer is obtained from the defaultSender parameter) - * @param defaultSender The default sender to be used to obtain a signer where the object provided to the transaction parameter does not include a signer. - */ - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom): HelloWorldComposer - /** - * Returns the underlying AtomicTransactionComposer instance - */ - atc(): Promise - /** - * Simulates the transaction group and returns the result - */ - simulate(options?: SimulateOptions): Promise> - /** - * Executes the transaction group and returns the results - */ - execute(sendParams?: AppClientComposeExecuteParams): Promise> -} -export type SimulateOptions = Omit[0], 'txnGroups'> -export type HelloWorldComposerSimulateResult = { - returns: TReturns - methodResults: ABIResult[] - simulateResponse: modelsv2.SimulateResponse -} -export type HelloWorldComposerResults = { - returns: TReturns - groupId: string - txIds: string[] - transactions: Transaction[] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/interfaces/network.ts b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/interfaces/network.ts deleted file mode 100644 index a458edc..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/interfaces/network.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { AlgoClientConfig } from '@algorandfoundation/algokit-utils/types/network-client' -import type { TokenHeader } from 'algosdk/dist/types/client/urlTokenBaseHTTPClient' - -export interface AlgoViteClientConfig extends AlgoClientConfig { - /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */ - server: string - /** The port to use e.g. 4001, 443, etc. */ - port: string | number - /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */ - token: string | TokenHeader - /** String representing current Algorand Network type (testnet/mainnet and etc) */ - network: string -} - -export interface AlgoViteKMDConfig extends AlgoClientConfig { - /** Base URL of the server e.g. http://localhost, https://testnet-api.algonode.cloud/, etc. */ - server: string - /** The port to use e.g. 4001, 443, etc. */ - port: string | number - /** The token to use for API authentication (or undefined if none needed) - can be a string, or an object with the header key => value */ - token: string | TokenHeader - /** KMD wallet name */ - wallet: string - /** KMD wallet password */ - password: string -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/main.tsx b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/main.tsx deleted file mode 100644 index 431a30c..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/main.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App' -import './styles/App.css' -import ErrorBoundary from './components/ErrorBoundary' - -ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - - - - - , -) diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/styles/App.css b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/styles/App.css deleted file mode 100644 index ee2b188..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/styles/App.css +++ /dev/null @@ -1,126 +0,0 @@ -/* App.css */ - -.hero { - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - background-color: #38b2ac; -} - -.hero-content { - text-align: center; - border-radius: 0.5rem; - padding: 1.5rem; - max-width: 24rem; - background-color: #ffffff; - margin: 0 auto; -} - -.text-4xl { - font-size: 2.25rem; - line-height: 2.5rem; -} - -.font-bold { - font-weight: 700; -} - -.py-6 { - padding-top: 1.5rem; - padding-bottom: 1.5rem; -} - -.grid { - display: grid; -} - -.btn { - margin: 0.5rem; -} - -.btn-primary { - background-color: #1a202c; - color: #fff; -} - -.divider { - border-top: 1px solid #e2e8f0; - margin-top: 1rem; - margin-bottom: 1rem; -} - -.modal { - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - background: rgba(0, 0, 0, 0.6); - display: none; - z-index: 9999; - overflow: auto; -} - -.modal-open { - display: block; -} - -.modal-box { - margin: 2.5em auto; - background: #fff; - border-radius: 0.5em; - width: 40em; - max-width: 90vw; - padding: 1em; -} - -.font-bold { - font-weight: bold; -} - -.text-2xl { - font-size: 1.5rem; -} - -.m-2 { - margin: 0.5rem; -} - -.pt-5 { - padding-top: 1.25rem; -} - -.grid { - display: grid; -} - -.btn { - margin: 0.5rem; - padding: 0.5rem 1rem; - background-color: #00aba2; - color: #fff; -} - -.btn-warning { - background-color: #d69e2e; -} - -.border-1 { - border-width: 1px; -} - -.border-teal-800 { - border-color: #2c7a7b; -} - -.modal-action { - display: grid; - margin-top: 1rem; -} - -.divider { - border-top: 1px solid #e2e8f0; - margin-top: 1rem; - margin-bottom: 1rem; -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/utils/ellipseAddress.ts b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/utils/ellipseAddress.ts deleted file mode 100644 index 542f46f..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/utils/ellipseAddress.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function ellipseAddress(address = ``, width = 6): string { - return address ? `${address.slice(0, width)}...${address.slice(-width)}` : address -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/utils/network/getAlgoClientConfigs.ts b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/utils/network/getAlgoClientConfigs.ts deleted file mode 100644 index b5121f8..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/utils/network/getAlgoClientConfigs.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { AlgoViteClientConfig, AlgoViteKMDConfig } from '../../interfaces/network' - -export function getAlgodConfigFromViteEnvironment(): AlgoViteClientConfig { - if (!import.meta.env.VITE_ALGOD_SERVER) { - throw new Error('Attempt to get default algod configuration without specifying VITE_ALGOD_SERVER in the environment variables') - } - - return { - server: import.meta.env.VITE_ALGOD_SERVER, - port: import.meta.env.VITE_ALGOD_PORT, - token: import.meta.env.VITE_ALGOD_TOKEN, - network: import.meta.env.VITE_ALGOD_NETWORK, - } -} - -export function getIndexerConfigFromViteEnvironment(): AlgoViteClientConfig { - if (!import.meta.env.VITE_INDEXER_SERVER) { - throw new Error('Attempt to get default algod configuration without specifying VITE_INDEXER_SERVER in the environment variables') - } - - return { - server: import.meta.env.VITE_INDEXER_SERVER, - port: import.meta.env.VITE_INDEXER_PORT, - token: import.meta.env.VITE_INDEXER_TOKEN, - network: import.meta.env.VITE_ALGOD_NETWORK, - } -} - -export function getKmdConfigFromViteEnvironment(): AlgoViteKMDConfig { - if (!import.meta.env.VITE_KMD_SERVER) { - throw new Error('Attempt to get default kmd configuration without specifying VITE_KMD_SERVER in the environment variables') - } - - return { - server: import.meta.env.VITE_KMD_SERVER, - port: import.meta.env.VITE_KMD_PORT, - token: import.meta.env.VITE_KMD_TOKEN, - wallet: import.meta.env.VITE_KMD_WALLET, - password: import.meta.env.VITE_KMD_PASSWORD, - } -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/vite-env.d.ts b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/vite-env.d.ts deleted file mode 100644 index 67c2d30..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/src/vite-env.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/// - -interface ImportMetaEnv { - readonly VITE_ENVIRONMENT: string - - readonly VITE_ALGOD_TOKEN: string - readonly VITE_ALGOD_SERVER: string - readonly VITE_ALGOD_PORT: string - readonly VITE_ALGOD_NETWORK: string - - readonly VITE_INDEXER_TOKEN: string - readonly VITE_INDEXER_SERVER: string - readonly VITE_INDEXER_PORT: string - - readonly VITE_KMD_TOKEN: string - readonly VITE_KMD_SERVER: string - readonly VITE_KMD_PORT: string - readonly VITE_KMD_PASSWORD: string - readonly VITE_KMD_WALLET: string -} - -interface ImportMeta { - readonly env: ImportMetaEnv -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/tsconfig.json b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/tsconfig.json deleted file mode 100644 index 443b6bd..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/tsconfig.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - "module": "ES2022" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - "declaration": true /* Generates corresponding '.d.ts' file. */, - "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, - "sourceMap": true /* Generates corresponding '.map' file. */, - "strict": true /* Enable all strict type-checking options. */, - "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, - "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */, - "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */, - "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, - "allowJs": false, - "allowSyntheticDefaultImports": true, - "moduleResolution": "Node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - "outDir": "./dist/" - }, - "include": [ - "src/**/*.ts", - "src/**/*.tsx", - "vite.config.js", - "src/utils/", - "src/utils/", - "src/main.tsx", - ], - "references": [ - { - "path": "./tsconfig.node.json" - } - ] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/tsconfig.node.json b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/tsconfig.node.json deleted file mode 100644 index 9d31e2a..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/tsconfig.node.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "module": "ESNext", - "moduleResolution": "Node", - "allowSyntheticDefaultImports": true - }, - "include": ["vite.config.ts"] -} diff --git a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/vite.config.ts b/examples/starter_beaker_react/projects/starter_beaker_react-frontend/vite.config.ts deleted file mode 100644 index 36f7f4e..0000000 --- a/examples/starter_beaker_react/projects/starter_beaker_react-frontend/vite.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import react from '@vitejs/plugin-react' -import { defineConfig } from 'vite' - -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react()], -}) diff --git a/examples/starter_beaker_react/starter_beaker_react.code-workspace b/examples/starter_beaker_react/starter_beaker_react.code-workspace deleted file mode 100644 index 9d6c208..0000000 --- a/examples/starter_beaker_react/starter_beaker_react.code-workspace +++ /dev/null @@ -1,96 +0,0 @@ -{ - "folders": [ - { - "path": "./", - "name": "ROOT" - }, - { - "path": "./projects/starter_beaker_react-contracts" - }, - { - "path": "./projects/starter_beaker_react-frontend" - }, - { - "path": "." - }, - { - "path": "projects/starter_beaker_react-frontend" - }, - { - "path": "projects/starter_beaker_react-contracts" - }, - { - "path": "." - } - ], - "settings": { - "files.exclude": { - "projects/": true - }, - "jest.disabledWorkspaceFolders": [ - "ROOT", - "projects" - ], - "dotenv.enableAutocloaking": false - }, - "extensions": { - "recommendations": [ - "joshx.workspace-terminals" - ] - }, - "tasks": { - "version": "2.0.0", - "tasks": [ - { - "label": "Build artifacts (+ LocalNet)", - "command": "algokit", - "args": [ - "project", - "run", - "build" - ], - "options": { - "cwd": "${workspaceFolder}" - }, - "dependsOn": "Start AlgoKit LocalNet", - "problemMatcher": [] - }, - { - "label": "Start AlgoKit LocalNet", - "command": "algokit", - "args": [ - "localnet", - "start" - ], - "type": "shell", - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [] - } - ] - }, - "launch": { - "configurations": [], - "compounds": [ - { - "preLaunchTask": "Build artifacts (+ LocalNet)", - "name": "Run Frontend (+ LocalNet and Smart Contract)", - "configurations": [ - { - "name": "Deploy contracts", - "folder": "starter_beaker_react-contracts" - }, - { - "name": "Run dApp", - "folder": "starter_beaker_react-frontend" - } - ], - "presentation": { - "hidden": false, - "group": "0. Run workspace" - } - } - ] - } -} \ No newline at end of file diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/.algokit/.copier-answers.yml b/examples/starter_python_react/projects/starter_python_react-contracts/.algokit/.copier-answers.yml index 3238f03..6612abe 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/.algokit/.copier-answers.yml +++ b/examples/starter_python_react/projects/starter_python_react-contracts/.algokit/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 1.2.4 +_commit: 1.3.3 _src_path: gh:algorandfoundation/algokit-python-template author_email: None author_name: None diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 b/examples/starter_python_react/projects/starter_python_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 index 68f8bc3..ac114cc 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 +++ b/examples/starter_python_react/projects/starter_python_react-contracts/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 @@ -5,43 +5,26 @@ import { {{ contract_name.split('_')|map('capitalize')|join }}Client } from '../ export async function deploy() { console.log('=== Deploying {{ contract_name.split('_')|map('capitalize')|join }} ===') - const algod = algokit.getAlgoClient() - const indexer = algokit.getAlgoIndexerClient() - const deployer = await algokit.mnemonicAccountFromEnvironment({ name: 'DEPLOYER', fundWith: algokit.algos(3) }, algod) - await algokit.ensureFunded( - { - accountToFund: deployer, - minSpendingBalance: algokit.algos(2), - minFundingIncrement: algokit.algos(2), - }, - algod, - ) - const appClient = new {{ contract_name.split('_')|map('capitalize')|join }}Client( - { - resolveBy: 'creatorAndName', - findExistingUsing: indexer, - sender: deployer, - creatorAddress: deployer.addr, - }, - algod, - ) + const algorand = algokit.AlgorandClient.fromEnvironment() + const deployer = await algorand.account.fromEnvironment('DEPLOYER') + + const appClient = algorand.client.getTypedAppClientByCreatorAndName({{ contract_name.split('_')|map('capitalize')|join }}Client, { + sender: deployer, + creatorAddress: deployer.addr, + }) const app = await appClient.deploy({ onSchemaBreak: 'append', onUpdate: 'append', }) - // If app was just created fund the app account if (['create', 'replace'].includes(app.operationPerformed)) { - algokit.transferAlgos( - { - amount: algokit.algos(1), - from: deployer, - to: app.appAddress, - }, - algod, - ) + await algorand.send.payment({ + amount: algokit.algos(1), + sender: deployer.addr, + receiver: app.appAddress, + }) } const method = 'hello' diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/.gitignore b/examples/starter_python_react/projects/starter_python_react-contracts/.gitignore index a858d63..070829c 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/.gitignore +++ b/examples/starter_python_react/projects/starter_python_react-contracts/.gitignore @@ -176,5 +176,5 @@ node_modules # AlgoKit debug_traces/ -.algokit/static-analysis/tealer/ +.algokit/static-analysis/ # Replace with .algokit/static-analysis/tealer/ to enable snapshot checks in CI .algokit/sources diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/.tours/getting-started-with-your-algokit-project.tour b/examples/starter_python_react/projects/starter_python_react-contracts/.tours/getting-started-with-your-algokit-project.tour index 2eb8a76..4a58a5b 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/.tours/getting-started-with-your-algokit-project.tour +++ b/examples/starter_python_react/projects/starter_python_react-contracts/.tours/getting-started-with-your-algokit-project.tour @@ -41,7 +41,7 @@ "file": "smart_contracts/index.ts", "description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin available on the [VSCode Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.", "line": 15 - } + }, { "file": "smart_contracts/_helpers/__init__.py", "description": "This folder contains helper scripts for contract management. These automate tasks like compiling, generating clients, and deploying. Usually, you won't need to edit these files, but advanced users can expand them for custom needs.", diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/README.md b/examples/starter_python_react/projects/starter_python_react-contracts/README.md index 75096be..3b29bca 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/README.md +++ b/examples/starter_python_react/projects/starter_python_react-contracts/README.md @@ -35,8 +35,10 @@ Run the following commands within the project folder: #### Terminal Directly manage and interact with your project using AlgoKit commands: -1. **Build Contracts**: `algokit project run build` compiles all smart contracts. -2. **Deploy**: Use `algokit project deploy localnet` to deploy contracts to the local network. +1. **Build Contracts**: `algokit project run build` compiles all smart contracts. You can also specify a specific contract by passing the name of the contract folder as an extra argument. +For example: `algokit project run build -- hello_world` will only build the `hello_world` contract. +2. **Deploy**: Use `algokit project deploy localnet` to deploy contracts to the local network. You can also specify a specific contract by passing the name of the contract folder as an extra argument. +For example: `algokit project deploy localnet -- hello_world` will only deploy the `hello_world` contract. #### VS Code For a seamless experience with breakpoint debugging and other features: diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/pyproject.toml b/examples/starter_python_react/projects/starter_python_react-contracts/pyproject.toml index cd8b1c8..dd525e1 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/pyproject.toml +++ b/examples/starter_python_react/projects/starter_python_react-contracts/pyproject.toml @@ -9,8 +9,8 @@ readme = "README.md" python = "^3.12" algokit-utils = "^2.3.0" python-dotenv = "^1.0.0" -algorand-python = "^1.0.0" -algorand-python-testing = "^0.2.1" +algorand-python = "^2.0.0" +algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] puyapy = "*" diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/__main__.py b/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/__main__.py index 6cf51e4..62fadcd 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/__main__.py +++ b/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/__main__.py @@ -18,17 +18,25 @@ root_path = Path(__file__).parent -def main(action: str) -> None: +def main(action: str, contract_name: str | None = None) -> None: artifact_path = root_path / "artifacts" + + # Filter contracts if a specific contract name is provided + filtered_contracts = [ + c for c in contracts if contract_name is None or c.name == contract_name + ] + match action: case "build": - for contract in contracts: + for contract in filtered_contracts: logger.info(f"Building app at {contract.path}") build(artifact_path / contract.name, contract.path) if __name__ == "__main__": - if len(sys.argv) > 1: + if len(sys.argv) > 2: + main(sys.argv[1], sys.argv[2]) + elif len(sys.argv) > 1: main(sys.argv[1]) else: main("build") diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/_helpers/build.py b/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/_helpers/build.py index a78f2d9..2694825 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/_helpers/build.py +++ b/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/_helpers/build.py @@ -31,6 +31,7 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", + "--debug-level=0", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, @@ -40,12 +41,13 @@ def build(output_dir: Path, contract_path: Path) -> Path: raise Exception(f"Could not build contract:\n{build_result.stdout}") app_spec_file_names = [file.name for file in output_dir.glob("*.arc32.json")] - + app_spec_file_name = None for app_spec_file_name in app_spec_file_names: if app_spec_file_name is None: - raise Exception( - "Could not generate typed client, .arc32.json file not found" + logger.warning( + "No '*.arc32.json' file found (likely a logic signature being compiled). Skipping client generation." ) + continue print(app_spec_file_name) generate_result = subprocess.run( [ @@ -71,4 +73,4 @@ def build(output_dir: Path, contract_path: Path) -> Path: f"Could not generate typed client:\n{generate_result.stdout}" ) - return output_dir / app_spec_file_name + return output_dir / app_spec_file_name if app_spec_file_name else output_dir diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/hello_world/deploy-config.ts b/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/hello_world/deploy-config.ts index 2a46d19..5df7a31 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/hello_world/deploy-config.ts +++ b/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/hello_world/deploy-config.ts @@ -5,43 +5,26 @@ import { HelloWorldClient } from '../artifacts/hello_world/HelloWorldClient' export async function deploy() { console.log('=== Deploying HelloWorld ===') - const algod = algokit.getAlgoClient() - const indexer = algokit.getAlgoIndexerClient() - const deployer = await algokit.mnemonicAccountFromEnvironment({ name: 'DEPLOYER', fundWith: algokit.algos(3) }, algod) - await algokit.ensureFunded( - { - accountToFund: deployer, - minSpendingBalance: algokit.algos(2), - minFundingIncrement: algokit.algos(2), - }, - algod, - ) - const appClient = new HelloWorldClient( - { - resolveBy: 'creatorAndName', - findExistingUsing: indexer, - sender: deployer, - creatorAddress: deployer.addr, - }, - algod, - ) + const algorand = algokit.AlgorandClient.fromEnvironment() + const deployer = await algorand.account.fromEnvironment('DEPLOYER') + + const appClient = algorand.client.getTypedAppClientByCreatorAndName(HelloWorldClient, { + sender: deployer, + creatorAddress: deployer.addr, + }) const app = await appClient.deploy({ onSchemaBreak: 'append', onUpdate: 'append', }) - // If app was just created fund the app account if (['create', 'replace'].includes(app.operationPerformed)) { - algokit.transferAlgos( - { - amount: algokit.algos(1), - from: deployer, - to: app.appAddress, - }, - algod, - ) + await algorand.send.payment({ + amount: algokit.algos(1), + sender: deployer.addr, + receiver: app.appAddress, + }) } const method = 'hello' diff --git a/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/index.ts b/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/index.ts index af40ab4..6955e33 100644 --- a/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/index.ts +++ b/examples/starter_python_react/projects/starter_python_react-contracts/smart_contracts/index.ts @@ -20,28 +20,41 @@ async function importDeployerIfExists(dir: string) { const deployerPath = path.resolve(dir, 'deploy-config') if (fs.existsSync(deployerPath + '.ts') || fs.existsSync(deployerPath + '.js')) { const deployer = await import(deployerPath) - return deployer.deploy + return { ...deployer, name: path.basename(dir) } } + return null } // get a list of all deployers from the subdirectories async function getDeployers() { - const directories = fs.readdirSync(baseDir, { withFileTypes: true }) - .filter(dirent => dirent.isDirectory()) - .map(dirent => path.resolve(baseDir, dirent.name)) + const directories = fs + .readdirSync(baseDir, { withFileTypes: true }) + .filter((dirent) => dirent.isDirectory()) + .map((dirent) => path.resolve(baseDir, dirent.name)) - return Promise.all(directories.map(importDeployerIfExists)) + const deployers = await Promise.all(directories.map(importDeployerIfExists)) + return deployers.filter((deployer) => deployer !== null) // Filter out null values } // execute all the deployers (async () => { - const contractDeployers = (await getDeployers()).filter(Boolean) + const contractName = process.argv.length > 2 ? process.argv[2] : undefined + const contractDeployers = await getDeployers() + + const filteredDeployers = contractName + ? contractDeployers.filter(deployer => deployer.name === contractName) + : contractDeployers + + if (contractName && filteredDeployers.length === 0) { + console.warn(`No deployer found for contract name: ${contractName}`) + return + } - for (const deployer of contractDeployers) { + for (const deployer of filteredDeployers) { try { - await deployer() + await deployer.deploy() } catch (e) { - console.error(e) + console.error(`Error deploying ${deployer.name}:`, e) } } })() diff --git a/examples/starter_python_react/projects/starter_python_react-frontend/.algokit/.copier-answers.yml b/examples/starter_python_react/projects/starter_python_react-frontend/.algokit/.copier-answers.yml index a4e65ed..14d3650 100644 --- a/examples/starter_python_react/projects/starter_python_react-frontend/.algokit/.copier-answers.yml +++ b/examples/starter_python_react/projects/starter_python_react-frontend/.algokit/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 1.0.7 +_commit: 1.0.8 _src_path: gh:algorandfoundation/algokit-react-frontend-template author_email: None author_name: None diff --git a/examples/starter_python_react/projects/starter_python_react-frontend/src/components/Account.tsx b/examples/starter_python_react/projects/starter_python_react-frontend/src/components/Account.tsx index 6a6345e..8324312 100644 --- a/examples/starter_python_react/projects/starter_python_react-frontend/src/components/Account.tsx +++ b/examples/starter_python_react/projects/starter_python_react-frontend/src/components/Account.tsx @@ -7,20 +7,16 @@ const Account = () => { const { activeAddress } = useWallet() const algoConfig = getAlgodConfigFromViteEnvironment() - const dappFlowNetworkName = useMemo(() => { - return algoConfig.network === '' ? 'sandbox' : algoConfig.network.toLocaleLowerCase() + const networkName = useMemo(() => { + return algoConfig.network === '' ? 'localnet' : algoConfig.network.toLocaleLowerCase() }, [algoConfig.network]) return (
- + Address: {ellipseAddress(activeAddress)} -
Network: {algoConfig.network === '' ? 'localnet' : algoConfig.network}
+
Network: {networkName}
) } diff --git a/examples/starter_python_react/projects/starter_python_react-frontend/src/contracts/HelloWorld.ts b/examples/starter_python_react/projects/starter_python_react-frontend/src/contracts/HelloWorld.ts index c65399a..48df604 100644 --- a/examples/starter_python_react/projects/starter_python_react-frontend/src/contracts/HelloWorld.ts +++ b/examples/starter_python_react/projects/starter_python_react-frontend/src/contracts/HelloWorld.ts @@ -1,4 +1,5 @@ /* eslint-disable */ +// @ts-nocheck /** * This file was automatically generated by @algorandfoundation/algokit-client-generator. * DO NOT MODIFY IT BY HAND. @@ -37,8 +38,8 @@ export const APP_SPEC: AppSpec = { } }, "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMuaGVsbG9fd29ybGQuY29udHJhY3QuSGVsbG9Xb3JsZC5hcHByb3ZhbF9wcm9ncmFtOgogICAgLy8gc21hcnRfY29udHJhY3RzL2hlbGxvX3dvcmxkL2NvbnRy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ICAgIGFzc2VydCAvLyBpcyBjcmVhdGluZwogICAgaW50IDEKICAgIHJldHN1YgoKX19wdXlhX2FyYzRfcm91dGVyX19fYWZ0ZXJfaWZfZWxzZUA5OgogICAgaW50IDAKICAgIHJldHN1YgoKCi8vIHNtYXJ0X2NvbnRyYWN0cy5oZWxsb193b3JsZC5jb250cmFjdC5IZWxsb1dvcmxkLmhlbGxvKG5hbWU6IGJ5dGVzKSAtPiBieXRlczoKaGVsbG86CiAgICBwcm90byAxIDEKICAgIGJ5dGUgIkhlbGxvLCAiCiAgICBmcmFtZV9kaWcgLTEKICAgIGNvbmNhdAogICAgcmV0c3ViCg==", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMuaGVsbG9fd29ybGQuY29udHJhY3QuSGVsbG9Xb3JsZC5jbGVhcl9zdGF0ZV9wcm9ncmFtOgogICAgaW50IDEKICAgIHJldHVybgo=" }, "state": { "global": { @@ -71,6 +72,7 @@ export const APP_SPEC: AppSpec = { "name": "name" } ], + "readonly": false, "returns": { "type": "string" } diff --git a/examples/starter_tealscript_react/projects/starter_tealscript_react-contracts/contracts/clients/CalculatorClient.ts b/examples/starter_tealscript_react/projects/starter_tealscript_react-contracts/contracts/clients/CalculatorClient.ts index 0144c84..cc57180 100644 --- a/examples/starter_tealscript_react/projects/starter_tealscript_react-contracts/contracts/clients/CalculatorClient.ts +++ b/examples/starter_tealscript_react/projects/starter_tealscript_react-contracts/contracts/clients/CalculatorClient.ts @@ -73,7 +73,7 @@ export const APP_SPEC: AppSpec = { } }, "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgovLyBUaGlzIFRFQUwgd2FzIGdlbmVyYXRlZCBieSBURUFMU2NyaXB0IHYwLjk3LjAKLy8gaHR0cHM6Ly9naXRodWIuY29tL2FsZ29yYW5kZm91bmRhdGlvbi9URUFMU2NyaXB0CgovLyBUaGlzIGNvbnRyYWN0IGlzIGNvbXBsaWFudCB3aXRoIGFuZC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": "I3ByYWdtYSB2ZXJzaW9uIDEw" }, "contract": { diff --git a/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/.algokit/.copier-answers.yml b/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/.algokit/.copier-answers.yml index e7d204d..02fee69 100644 --- a/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/.algokit/.copier-answers.yml +++ b/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/.algokit/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 1.0.7 +_commit: 1.0.8 _src_path: gh:algorandfoundation/algokit-react-frontend-template author_email: None author_name: None diff --git a/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/src/components/Account.tsx b/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/src/components/Account.tsx index 6a6345e..8324312 100644 --- a/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/src/components/Account.tsx +++ b/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/src/components/Account.tsx @@ -7,20 +7,16 @@ const Account = () => { const { activeAddress } = useWallet() const algoConfig = getAlgodConfigFromViteEnvironment() - const dappFlowNetworkName = useMemo(() => { - return algoConfig.network === '' ? 'sandbox' : algoConfig.network.toLocaleLowerCase() + const networkName = useMemo(() => { + return algoConfig.network === '' ? 'localnet' : algoConfig.network.toLocaleLowerCase() }, [algoConfig.network]) return (
- + Address: {ellipseAddress(activeAddress)} -
Network: {algoConfig.network === '' ? 'localnet' : algoConfig.network}
+
Network: {networkName}
) } diff --git a/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/src/contracts/Calculator.ts b/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/src/contracts/Calculator.ts index 9d250ca..11f0fc2 100644 --- a/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/src/contracts/Calculator.ts +++ b/examples/starter_tealscript_react/projects/starter_tealscript_react-frontend/src/contracts/Calculator.ts @@ -1,4 +1,5 @@ /* eslint-disable */ +// @ts-nocheck /** * This file was automatically generated by @algorandfoundation/algokit-client-generator. * DO NOT MODIFY IT BY HAND. @@ -74,7 +75,7 @@ export const APP_SPEC: AppSpec = { } }, "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgovLyBUaGlzIFRFQUwgd2FzIGdlbmVyYXRlZCBieSBURUFMU2NyaXB0IHYwLjk3LjAKLy8gaHR0cHM6Ly9naXRodWIuY29tL2FsZ29yYW5kZm91bmRhdGlvbi9URUFMU2NyaXB0CgovLyBUaGlzIGNvbnRyYWN0IGlzIGNvbXBsaWFudCB3aXRoIGFuZC9vciBpbXBsZW1lbnRzIHRoZSBmb2xsb3dpbmcgQVJDczogWyBBUkM0IF0KCi8vIFRoZSBmb2xsb3dpbmcgdGVuIGxpbmVzIG9mIFRFQUwgaGFuZGxlIGluaXRpYWwgcHJvZ3JhbSBmbG93Ci8vIFRoaXMgcGF0dGVybiBpcyB1c2VkIHRvIG1ha2UgaXQgZWFzeSBmb3IgYW55b25lIHRvIHBhcnNlIHRoZSBzdGFydCBvZiB0aGUgcHJvZ3JhbSBhbmQgZGV0ZXJtaW5lIGlmIGEgc3BlY2lmaWMgYWN0aW9uIGlzIGFsbG93ZWQKLy8gSGVyZSwgYWN0aW9uIHJlZmVycyB0byB0aGUgT25Db21wbGV0ZSBpbiBjb21iaW5hdGlvbiB3aXRoIHdoZXRoZXIgdGhlIGFwcCBpcyBiZWluZyBjcmVhdGVkIG9yIGNhbGxlZAovLyBFdmVyeSBwb3NzaWJsZSBhY3Rpb24gZm9yIHRoaXMgY29udHJhY3QgaXMgcmVwcmVzZW50ZWQgaW4gdGhlIHN3aXRjaCBzdGF0ZW1lbnQKLy8gSWYgdGhlIGFjdGlvbiBpcyBub3QgaW1wbGVtZW50ZWQgaW4gdGhlIGNvbnRyYWN0LCBpdHMgcmVzcGVjdGl2ZSBicmFuY2ggd2lsbCBiZSAiKk5PVF9JTVBMRU1FTlRFRCIgd2hpY2gganVzdC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MgLy8gbWV0aG9kICJkb01hdGgodWludDY0LHVpbnQ2NCxzdHJpbmcpdWludDY0IgoJcHVzaGJ5dGVzIDB4MDJiZWNlMTEgLy8gbWV0aG9kICJoZWxsbyhzdHJpbmcpc3RyaW5nIgoJdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAoJbWF0Y2ggKmFiaV9yb3V0ZV9kb01hdGggKmFiaV9yb3V0ZV9oZWxsbwoKCS8vIHRoaXMgY29udHJhY3QgZG9lcyBub3QgaW1wbGVtZW50IHRoZSBnaXZlbiBBQkkgbWV0aG9kIGZvciBjYWxsIE5vT3AKCWVycg==", "clear": "I3ByYWdtYSB2ZXJzaW9uIDEw" }, "contract": { diff --git a/tests/test_templates.py b/tests/test_templates.py index 679034e..d64ad55 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -268,7 +268,7 @@ def get_answered_questions_from_copier_yaml( return answers -@pytest.mark.parametrize("contract_template", ["python", "beaker", "tealscript"]) +@pytest.mark.parametrize("contract_template", ["python", "tealscript"]) def test_production_preset(contract_template: str, working_dir: Path) -> None: response = run_init( working_dir, @@ -284,7 +284,7 @@ def test_production_preset(contract_template: str, working_dir: Path) -> None: assert response.returncode == 0, response.stdout -@pytest.mark.parametrize("contract_template", ["python", "beaker", "tealscript"]) +@pytest.mark.parametrize("contract_template", ["python", "tealscript"]) def test_starter_preset(contract_template: str, working_dir: Path) -> None: response = run_init( working_dir,