### Install AlgoKit and create a new project Source: https://context7.com/algorandfoundation/algokit/llms.txt Instructions for installing the AlgoKit CLI and initializing a new project using templates. ```APIDOC ## Install AlgoKit and create a new project ### Description Install the `algokit` CLI globally using `pipx` and use it to scaffold new projects from official templates. This section also covers starting, checking the status of, and stopping a local Algorand network. ### Commands * **Install AlgoKit globally via pipx** ```bash pipx install algokit ``` * **Verify installation** ```bash algokit --version ``` * **Initialize a new project (interactive wizard)** ```bash algokit init ``` * **Initialize a specific template non-interactively** ```bash algokit init --template python --name my-contract --no-git ``` * **Start a local Algorand network (Docker required)** ```bash algokit localnet start ``` * **Check localnet status** ```bash algokit localnet status ``` * **Stop the local network** ```bash algokit localnet stop ``` ``` -------------------------------- ### Install AlgoKit and Initialize Project Source: https://context7.com/algorandfoundation/algokit/llms.txt Install the AlgoKit CLI globally using pipx and initialize a new project from a template. Local network can be started and stopped using the CLI. ```bash pipx install algokit algokit --version algokit init algokit init --template python --name my-contract --no-git algokit localnet start algokit localnet status algokit localnet stop ``` -------------------------------- ### Install and Initialize AlgoKit Project Source: https://github.com/algorandfoundation/algokit/blob/main/README.md Use these commands to install AlgoKit globally and create a new Algorand project. ```bash pipx install algokit algokit init ``` -------------------------------- ### Get Funding Limit Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md Fetches the current daily funding limit for a specified asset. Requires an Authorization header with a valid JWT token. ```APIDOC ## GET /fund/{assetID}/limit ### Description Fetches the funding limit for a specified asset. ### Method GET ### Endpoint /fund/{assetID}/limit ### Parameters #### Path Parameters - **assetID** (string) - Required - ID of the asset for which the funding limit is sought. Use `0` for ALGO. ### Response #### Success Response (200) - **amount** (number) - Current daily amount limit for the requested asset. ### Response Example ```json { "amount": 10000 } ``` ``` -------------------------------- ### Download and Inspect AlgoKit All Repositories Script Source: https://github.com/algorandfoundation/algokit/blob/main/README.md Download the script to inspect it before execution. Make it executable and then run it to clone all AlgoKit repositories. ```bash curl -sSL https://raw.githubusercontent.com/algorandfoundation/algokit/main/scripts/install_all_repos.sh -o install_algokit.sh chmod +x install_algokit.sh ./install_algokit.sh ``` -------------------------------- ### Download and Run AlgoKit All Repositories Script Source: https://github.com/algorandfoundation/algokit/blob/main/README.md This script clones all AlgoKit repositories, offering a choice between HTTPS or SSH and skipping existing repositories. It's useful for contributing to AlgoKit or working with the full source code. ```bash curl -sSL https://raw.githubusercontent.com/algorandfoundation/algokit/main/scripts/install_all_repos.sh | bash ``` -------------------------------- ### Clone All AlgoKit Repositories Source: https://context7.com/algorandfoundation/algokit/llms.txt Clone all AlgoKit sub-repositories into an organized directory structure. The script supports both HTTPS and SSH and is idempotent. ```bash # One-liner: download and execute the install script curl -sSL https://raw.githubusercontent.com/algorandfoundation/algokit/main/scripts/install_all_repos.sh | bash # Or: download first to inspect, then run curl -sSL https://raw.githubusercontent.com/algorandfoundation/algokit/main/scripts/install_all_repos.sh -o install_algokit.sh chmod +x install_algokit.sh ./install_algokit.sh # The script will prompt: # Choose URL format for cloning: # 1) HTTPS (recommended for most users) # 2) SSH (requires SSH key setup) # After completion the directory tree looks like: # . # ├── algokit/ # ├── cli/algokit-cli/ # ├── client-generators/algokit-client-generator-py/ # ├── client-generators/algokit-client-generator-ts/ # ├── core/algokit-core/ # ├── dispenser/algokit-dispenser-api/ # ├── examples/algokit-example-gallery/ # ├── lora/algokit-explore/ # ├── lora/algokit-lora/ # ├── puya/puya/ # ├── puya/puya-ts/ # ├── subscriber/algokit-subscriber-py/ # ├── subscriber/algokit-subscriber-ts/ # ├── templates/algokit-*-template/ (7 templates) # ├── testing/algokit-avm-vscode-debugger/ # ├── testing/algorand-python-testing/ # ├── testing/algorand-typescript-testing/ # ├── utils/algokit-utils-py/ # └── utils/algokit-utils-ts/ ``` -------------------------------- ### Clone All AlgoKit Repositories Source: https://context7.com/algorandfoundation/algokit/llms.txt A script to clone all AlgoKit sub-repositories for a full local development environment. ```APIDOC ## Clone All AlgoKit Repositories ### Description Bootstrap a full local development environment by cloning all AlgoKit source repositories into an organized directory structure. The `install_all_repos.sh` script supports both HTTPS and SSH remotes and is idempotent. ### Usage * **One-liner: download and execute the install script** ```bash curl -sSL https://raw.githubusercontent.com/algorandfoundation/algokit/main/scripts/install_all_repos.sh | bash ``` * **Download first to inspect, then run** ```bash curl -sSL https://raw.githubusercontent.com/algorandfoundation/algokit/main/scripts/install_all_repos.sh -o install_algokit.sh chmod +x install_algokit.sh ./install_algokit.sh ``` * **Script Prompt** The script will prompt you to choose the URL format for cloning: 1. HTTPS (recommended for most users) 2. SSH (requires SSH key setup) * **Resulting Directory Structure** After completion, the directory tree will be organized with each sub-repository in its respective folder, for example: ``` . ├── algokit/ ├── cli/algokit-cli/ ├── client-generators/algokit-client-generator-py/ ├── ... (other repositories) └── utils/algokit-utils-ts/ ``` ``` -------------------------------- ### Retrieve Daily Funding Limit for ALGO Source: https://context7.com/algorandfoundation/algokit/llms.txt Use this endpoint to check the current maximum daily amount that can be dispensed for ALGO. Ensure your DISPENSER_TOKEN is set. ```bash # Check the ALGO daily funding limit curl -X GET "https://api.dispenser.algorandfoundation.tools/fund/0/limit" \ -H "Authorization: Bearer ${DISPENSER_TOKEN}" ``` -------------------------------- ### Fund Wallet with TestNet Assets via Dispenser API Source: https://context7.com/algorandfoundation/algokit/llms.txt Send a specified amount of TestNet assets (ALGO or other assets using their ID) to a target wallet address using the Dispenser API. Handles success and error responses. ```bash # Fund a wallet with 1,000,000 microALGO (= 1 ALGO) curl -X POST "https://api.dispenser.algorandfoundation.tools/fund/0" \ -H "Authorization: Bearer ${DISPENSER_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "receiver": "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567ABCDEFGHIJKLMNOPQRSTUVWXYZ", "amount": 1000000 }' # Success response (HTTP 200): # { # "txID": "ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF12", # "amount": 1000000 # } # Error: daily limit exceeded (HTTP 400): # { # "code": "dispenser_fund_limit_exceeded", # "message": "Daily limit exceeded", # "limit": 10000000, # "resetsAt": "2024-06-01T00:00:00Z" # } # Error: dispenser out of funds (HTTP 400): # { # "code": "dispenser_out_of_funds", # "message": "Dispenser is currently out of funds" # } ``` -------------------------------- ### Retrieve Daily Funding Limit for ASA Source: https://context7.com/algorandfoundation/algokit/llms.txt Use this endpoint to check the daily funding limit for a specific Algorand Standard Asset (ASA). Replace '123456' with the actual asset ID. Ensure your DISPENSER_TOKEN is set. ```bash # Check the limit for a specific Algorand Standard Asset (ASA) curl -X GET "https://api.dispenser.algorandfoundation.tools/fund/123456/limit" \ -H "Authorization: Bearer ${DISPENSER_TOKEN}" ``` -------------------------------- ### Retrieve Daily Funding Limit Source: https://context7.com/algorandfoundation/algokit/llms.txt Returns the current maximum daily amount that can be dispensed for a given asset. Use `assetID=0` for ALGO. ```APIDOC ## GET /fund/{assetID}/limit ### Description Returns the current maximum daily amount that can be dispensed for a given asset. Use `assetID=0` for ALGO. ### Method GET ### Endpoint /fund/{assetID}/limit ### Parameters #### Path Parameters - **assetID** (string) - Required - The ID of the asset for which to retrieve the funding limit. Use `0` for ALGO. ### Request Example ```bash curl -X GET "https://api.dispenser.algorandfoundation.tools/fund/0/limit" \ -H "Authorization: Bearer ${DISPENSER_TOKEN}" ``` ### Response #### Success Response (200) - **amount** (integer) - The maximum daily amount that can be dispensed for the specified asset. #### Response Example ```json { "amount": 10000000 } ``` ``` -------------------------------- ### POST /fund/{assetID} — Fund a wallet with TestNet assets Source: https://context7.com/algorandfoundation/algokit/llms.txt Sends a specified amount of TestNet assets (ALGO or other assets) to a target wallet address. Requires authentication via a JWT token obtained through `algokit dispenser login --ci`. ```APIDOC ## POST /fund/{assetID} — Fund a wallet with TestNet assets ### Description This endpoint allows you to fund a specified wallet address with TestNet assets. You can fund with ALGO by setting `assetID=0` or with other TestNet assets by providing their respective IDs. The endpoint returns the transaction ID and the amount actually funded. ### Base URL `https://api.dispenser.algorandfoundation.tools` ### Authentication Requires a Bearer JWT token. Obtain it using: ```bash algokit dispenser login --ci # Store the output JWT token in an environment variable export DISPENSER_TOKEN="" ``` ### Method `POST` ### Endpoint `/fund/{assetID}` ### Path Parameters * **assetID** (string) - Required - The ID of the asset to fund. Use `0` for ALGO. ### Request Body * **receiver** (string) - Required - The wallet address to receive the assets. * **amount** (integer) - Required - The amount of the asset to fund (in micro units for ALGO). ### Request Example ```bash curl -X POST "https://api.dispenser.algorandfoundation.tools/fund/0" \ -H "Authorization: Bearer ${DISPENSER_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "receiver": "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567ABCDEFGHIJKLMNOPQRSTUVWXYZ", "amount": 1000000 }' ``` ### Response #### Success Response (200) * **txID** (string) - The transaction ID of the funding operation. * **amount** (integer) - The actual amount of asset funded. #### Response Example (Success) ```json { "txID": "ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF12", "amount": 1000000 } ``` #### Error Responses * **HTTP 400 - Daily limit exceeded** ```json { "code": "dispenser_fund_limit_exceeded", "message": "Daily limit exceeded", "limit": 10000000, "resetsAt": "2024-06-01T00:00:00Z" } ``` * **HTTP 400 - Dispenser out of funds** ```json { "code": "dispenser_out_of_funds", "message": "Dispenser is currently out of funds" } ``` ``` -------------------------------- ### Login to TestNet Dispenser Source: https://context7.com/algorandfoundation/algokit/llms.txt Obtain a Bearer JWT token for authenticating with the TestNet Dispenser API. Store the token in an environment variable for subsequent requests. ```bash algokit dispenser login --ci # Outputs a JWT token to stdout; store it as an environment variable export DISPENSER_TOKEN="" ``` -------------------------------- ### Missing Parameters Error Response Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md A specific error response format for when required parameters are missing. Includes a list of the missing parameters. ```json { "code": "missing_params", "message": "string", "parameters": ["string"] } ``` -------------------------------- ### Dispenser API Error: Missing Parameters Source: https://context7.com/algorandfoundation/algokit/llms.txt This error occurs when required input parameters are missing. The response includes a 'parameters' field listing the missing fields. ```json # missing_params — also returns the list of missing fields # { # "code": "missing_params", # "message": "Missing required input parameters", # "parameters": ["receiver", "amount"] # } ``` -------------------------------- ### Dispenser API Error: Fund Limit Exceeded Source: https://context7.com/algorandfoundation/algokit/llms.txt This error indicates that the daily funding limit has been reached. The response includes the 'limit' and 'resetsAt' fields to provide context. ```json # fund_limit_exceeded — also returns limit and reset time # { # "code": "dispenser_fund_limit_exceeded", # "message": "Dispenser fund limit exceeded", # "limit": 10000000, # "resetsAt": "2024-06-02T00:00:00Z" # } ``` -------------------------------- ### Refund a Previously Funded Transaction Source: https://context7.com/algorandfoundation/algokit/llms.txt Use this endpoint to return TestNet tokens to the dispenser by providing the original funding transaction ID. A 200 status code indicates success. Ensure your DISPENSER_TOKEN and Content-Type headers are correctly set. ```bash # Refund a previously funded transaction curl -X POST "https://api.dispenser.algorandfoundation.tools/refund" \ -H "Authorization: Bearer ${DISPENSER_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "refundTransactionID": "ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF12" }' ``` -------------------------------- ### Funding Limit Response Body Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md The response body containing the current daily funding limit for a specified asset. ```json { "amount": "number" } ``` -------------------------------- ### Fund Asset Request Body Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md The request body for funding a wallet with a specified asset. Ensure 'receiver' and 'amount' are correctly provided. ```json { "receiver": "string", "amount": "number" } ``` -------------------------------- ### Fund Asset Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md Funds a user's wallet with a specified asset. Requires an Authorization header with a valid JWT token. ```APIDOC ## POST /fund/{assetID} ### Description Funds a user's wallet with a specified asset. ### Method POST ### Endpoint /fund/{assetID} ### Parameters #### Path Parameters - **assetID** (string) - Required - ID of the asset for which the funding limit is sought. Use `0` for ALGO. #### Request Body - **receiver** (string) - Required - Address of the wallet to be funded. - **amount** (number) - Required - Amount of the asset to be funded. ### Response #### Success Response (200) - **txID** (string) - ID of the fund transaction from the dispenser to the requesting address. - **amount** (number) - Amount of the asset to be funded. ### Request Example ```json { "receiver": "YOUR_WALLET_ADDRESS", "amount": 1000 } ``` ### Response Example ```json { "txID": "ABC123XYZ789", "amount": 1000 } ``` ``` -------------------------------- ### Fund Limit Exceeded Error Response Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md Details the structure of the error response when the dispenser fund limit is exceeded. ```APIDOC ## `fund_limit_exceeded` error response ### Description This error response is returned when the daily fund limit for a requested asset in the dispenser has been exceeded. ### Response Body - **code** (string) - The error code, which will be `dispenser_fund_limit_exceeded`. - **message** (string) - A descriptive message explaining the error. - **limit** (number) - The current daily amount limit for the requested asset. - **resetsAt** (string) - A timestamp indicating when the daily limit will reset. ### Response Example ```json { "code": "dispenser_fund_limit_exceeded", "message": "Daily fund limit exceeded for asset X.", "limit": 1000000, "resetsAt": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Common Error Response Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md The common format for error responses from the Dispenser API. Includes an error code and a descriptive message. ```json { "code": "string", "message": "string" } ``` -------------------------------- ### Refund a Previously Funded Transaction Source: https://context7.com/algorandfoundation/algokit/llms.txt Allows returning TestNet tokens to the dispenser by referencing the original funding transaction ID. A `200` status code indicates a successful refund. ```APIDOC ## POST /refund ### Description Allows returning TestNet tokens to the dispenser by referencing the original funding transaction ID. A `200` status code indicates a successful refund. ### Method POST ### Endpoint /refund ### Parameters #### Request Body - **refundTransactionID** (string) - Required - The ID of the transaction to refund. ### Request Example ```bash curl -X POST "https://api.dispenser.algorandfoundation.tools/refund" \ -H "Authorization: Bearer ${DISPENSER_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "refundTransactionID": "ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF12" }' ``` ### Response #### Success Response (200) An empty body indicates a successful refund. #### Response Example (empty body) ``` -------------------------------- ### Fund Transaction Response Body Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md The response body after successfully funding a wallet. It includes the transaction ID and the funded amount. ```json { "txID": "string", "amount": "number" } ``` -------------------------------- ### Common Dispenser API Error Structure Source: https://context7.com/algorandfoundation/algokit/llms.txt All error responses from the Dispenser API follow this common JSON structure. Some errors may include additional fields for more context. ```json # Common error shape # { # "code": "", # "message": "" # } ``` -------------------------------- ### Refund Transaction Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md Allows refunding a transaction. A status code 200 indicates a successful refund. Requires an Authorization header with a valid JWT token. ```APIDOC ## POST /refund ### Description Allows refunding a transaction. ### Method POST ### Endpoint /refund ### Request Body - **refundTransactionID** (string) - Required - ID of the refund transaction. ### Response #### Success Response (200) Indicates a successful refund. ### Request Example ```json { "refundTransactionID": "TXNID_TO_REFUND" } ``` ``` -------------------------------- ### Fund Limit Exceeded Error Response Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md This JSON structure represents an error response when the daily fund limit for an asset has been exceeded. It includes the error code, a descriptive message, the current limit, and the timestamp when the limit resets. ```json { "code": "dispenser_fund_limit_exceeded", "message": "string", "limit": "number", "resetsAt": "string" } ``` -------------------------------- ### Refund Transaction Request Body Source: https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md The request body for refunding a transaction. Provide the ID of the transaction to be refunded. ```json { "refundTransactionID": "string" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.