Skip to content

创建文章

We are looking for publications that demonstrate building dApps or smart contracts!
See the full list of Gitcoin bounties that are eligible for rewards.

Dispenser

The AlgoKit Dispenser feature allows you to interact with the AlgoKit TestNet Dispenser. This feature is essential for funding your wallet with TestNet ALGOs, refunding ALGOs back to the dispenser wallet, and getting information about current fund limits on your account.

Usage

$ algokit dispenser [OPTIONS] COMMAND [ARGS]...

This command provides a set of subcommands to interact with the AlgoKit TestNet Dispenser. Subcommands

  • login: Login to your Dispenser API account.
  • logout: Logout of your Dispenser API account.
  • fund: Fund your wallet address with TestNet ALGOs.
  • refund: Refund ALGOs back to the dispenser wallet address.
  • limit: Get information about current fund limits on your account.

API Documentation

For detailed API documentation, visit the AlgoKit Dispenser API documentation.

CI Access Token

All dispenser commands can work in CI mode by using a CI access token that can be generated by passing --ci flag to login command. Once a token is obtained, setting the value to the following environment variable ALGOKIT_DISPENSER_ACCESS_TOKEN will enable CI mode for all dispenser commands. If both a user mode and CI mode access token is available, the CI mode will take precedence.

Login

$ algokit dispenser login [OPTIONS]

This command logs you into your Dispenser API account if you are not already logged in. Options

  • --ci: Generate an access token for CI. Issued for 30 days.
  • --output, -o: Output mode where you want to store the generated access token. Defaults to stdout. Only applicable when --ci flag is set.
  • --file, -f: Output filename where you want to store the generated access token. Defaults to ci_token.txt. Only applicable when --ci flag is set and --output mode is file.

Please note, algokit relies on keyring for storing your API credentials. This implies that your credentials are stored in your system's keychain. By default it will prompt for entering your system password unless you have set it up to always allow access for algokit-cli to obtain API credentials.

Logout

$ algokit dispenser logout

This command logs you out of your Dispenser API account if you are logged in.

Fund

$ algokit dispenser fund [OPTIONS]

This command funds your wallet address with TestNet ALGOs. Options

  • --receiver, -r: Receiver alias or address to fund with TestNet ALGOs. This option is required.
  • --amount, -a: Amount to fund. Defaults to microAlgos. This option is required.
  • --whole-units: Use whole units (Algos) instead of smallest divisible units (microAlgos). Disabled by default.

Refund

$ algokit dispenser refund [OPTIONS]

This command refunds ALGOs back to the dispenser wallet address. Options

  • --txID, -t: Transaction ID of your refund operation. This option is required. The receiver address of the transaction must be the same as the dispenser wallet address that you can obtain by observing a sender field of fund transaction.

Please note, performing a refund operation will not immedately change your daily fund limit. Your daily fund limit is reset daily at midnigth UTC. If you have reached your daily fund limit, you will not be able to perform a refund operation until your daily fund limit is reset.

Limit

$ algokit dispenser limit [OPTIONS]

This command gets information about current fund limits on your account. The limits reset daily. Options

  • --whole-units: Use whole units (Algos) instead of smallest divisible units (microAlgos). Disabled by default.

Further Reading

For in-depth details, visit the dispenser section in the AlgoKit CLI reference documentation.