Skip to content

algokit_utils.clients.dispenser_api_client

algokit_utils.clients.dispenser_api_client

Section titled “algokit_utils.clients.dispenser_api_client”
DISPENSER_ASSETS
DISPENSER_REQUEST_TIMEOUT
DISPENSER_ACCESS_TOKEN_KEY
DispenserApiConfig
DispenserAssetNameEnum where members are also (and must be) ints
DispenserAsset
DispenserFundResponse
DispenserLimitResponse
TestNetDispenserApiClientClient for interacting with the AlgoKit TestNet Dispenser API.

Bases: enum.IntEnum

Enum where members are also (and must be) ints

The ID of the asset

The amount of decimal places the asset was created with

The description of the asset

The transaction ID of the funded transaction

The amount of Algos funded

The amount of Algos that can be funded

DISPENSER_ACCESS_TOKEN_KEY = ‘ALGOKIT_DISPENSER_ACCESS_TOKEN’

Section titled “DISPENSER_ACCESS_TOKEN_KEY = ‘ALGOKIT_DISPENSER_ACCESS_TOKEN’”

class TestNetDispenserApiClient(auth_token: str | None = None, request_timeout: int = DISPENSER_REQUEST_TIMEOUT)

Section titled “class TestNetDispenserApiClient(auth_token: str | None = None, request_timeout: int = DISPENSER_REQUEST_TIMEOUT)”

Client for interacting with the AlgoKit TestNet Dispenser API. To get started create a new access token via algokit dispenser login –ci and pass it to the client constructor as auth_token. Alternatively set the access token as environment variable ALGOKIT_DISPENSER_ACCESS_TOKEN, and it will be auto loaded. If both are set, the constructor argument takes precedence.

Default request timeout is 15 seconds. Modify by passing request_timeout to the constructor.

Fund an account with Algos from the dispenser API

  • Parameters:
    • address – The address to fund
    • amount – The amount of Algos to fund
    • asset_id – The asset ID to fund (deprecated)
  • Returns: The transaction ID of the funded transaction
  • Raises: Exception – If the dispenser API request fails
  • Example:
    dispenser_client = TestNetDispenserApiClient()
    dispenser_client.fund(address="SENDER_ADDRESS", amount=1000000)

Register a refund for a transaction with the dispenser API

Get current limit for an account with Algos from the dispenser API