algokit_utils.dispenser_api
Classes
DispenserAssetName | Enum where members are also (and must be) ints |
---|---|
TestNetDispenserApiClient | 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. |
API
class algokit_utils.dispenser_api.DispenserAssetName
DispenserAssetName
Enum where members are also (and must be) ints
Initialization
Initialize self. See help(type(self)) for accurate signature.
__abs__
abs()
abs(self)
__add__
add()
Return self+value.
__and__
and()
Return self&value.
__bool__
bool()
True if self else False
__ceil__
ceil()
Ceiling of an Integral returns itself.
__delattr__
delattr()
Implement delattr(self, name).
__dir__
dir()
Default dir() implementation.
__divmod__
divmod()
Return divmod(self, value).
__eq__
eq()
Return self==value.
__float__
float()
float(self)
__floor__
floor()
Flooring an Integral returns itself.
__floordiv__
floordiv()
Return self//value.
__format__
format()
Convert to a string according to format_spec.
__ge__
ge()
Return self>=value.
__getattribute__
getattribute()
Return getattr(self, name).
__getstate__
getstate()
Helper for pickle.
__gt__
gt()
Return self>value.
__hash__
hash()
Return hash(self).
__index__
index()
Return self converted to an integer, if self is suitable for use as an index into a list.
__int__
int()
int(self)
__invert__
invert()
~self
__le__
le()
Return self<=value.
__lshift__
lshift()
Return self<<value.
__lt__
lt()
Return self<value.
__mod__
mod()
Return self%value.
__mul__
mul()
Return self*value.
__ne__
ne()
Return self!=value.
__neg__
neg()
-self
__new__
new()
Create and return a new object. See help(type) for accurate signature.
__or__
or()
Return self|value.
__pos__
pos()
+self
__pow__
pow()
Return pow(self, value, mod).
__radd__
radd()
Return value+self.
__rand__
rand()
Return value&self.
__rdivmod__
rdivmod()
Return divmod(value, self).
__reduce__
reduce()
Helper for pickle.
__reduce_ex__
reduce_ex()
Helper for pickle.
__repr__
repr()
Return repr(self).
__rfloordiv__
rfloordiv()
Return value//self.
__rlshift__
rlshift()
Return value<<self.
__rmod__
rmod()
Return value%self.
__rmul__
rmul()
Return value*self.
__ror__
ror()
Return value|self.
__round__
round()
Rounding an Integral returns itself.
Rounding with an ndigits argument also returns an integer.
__rpow__
rpow()
Return pow(value, self, mod).
__rrshift__
rrshift()
Return value>>self.
__rshift__
rshift()
Return self>>value.
__rsub__
rsub()
Return value-self.
__rtruediv__
rtruediv()
Return value/self.
__rxor__
rxor()
Return value^self.
__setattr__
setattr()
Implement setattr(self, name, value).
__sizeof__
sizeof()
Returns size in memory, in bytes.
__str__
str()
Return str(self).
__sub__
sub()
Return self-value.
__truediv__
truediv()
Return self/value.
__trunc__
trunc()
Truncating an Integral returns itself.
__xor__
xor()
Return self^value.
as_integer_ratio
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
(10).as_integer_ratio() (10, 1) (-10).as_integer_ratio() (-10, 1) (0).as_integer_ratio() (0, 1)
bit_count
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
bin(13) ‘0b1101’ (13).bit_count() 3
bit_length
bit_length()
Number of bits necessary to represent self in binary.
bin(37) ‘0b100101’ (37).bit_length() 6
conjugate
conjugate()
Returns self, the complex conjugate of any int.
class denominator
denominator
the denominator of a rational number in lowest terms
class imag
imag
the imaginary part of a complex number
is_integer
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
name
name()
The name of the Enum member.
class numerator
numerator
the numerator of a rational number in lowest terms
class real
real
the real part of a complex number
to_bytes
to_bytes()
Return an array of bytes representing an integer.
length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1. byteorder The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’. signed Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
value
value()
The value of the Enum member.
class algokit_utils.dispenser_api.TestNetDispenserApiClient
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.
Initialization
fund
fund(address: str, amount: int, asset_id: int) → algokit_utils.dispenser_api.DispenserFundResponse
Fund an account with Algos from the dispenser API
get_limit
get_limit(address: str) → algokit_utils.dispenser_api.DispenserLimitResponse
Get current limit for an account with Algos from the dispenser API
refund
refund(refund_txn_id: str) → None
Register a refund for a transaction with the dispenser API