Skip to content

algosdk.abi.method

Classes

ArgumentRepresents an argument for a ABI method
MethodRepresents a ABI method description.
MethodDictdict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
d = {}
for k, v in iterable:
d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
MethodDict_Optionaldict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
d = {}
for k, v in iterable:
d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
ReturnsRepresents a return type for a ABI method

API

class algosdk.abi.method.Argument

Argument(arg_type: str, name: Optional[str] = None, desc: Optional[str] = None)

Represents an argument for a ABI method

Args: arg_type (string): ABI type or transaction string of the method argument name (string, optional): name of this method argument desc (string, optional): description of this method argument

Initialization

__eq__

eq(o: object) → bool

Return self==value.

__str__

str() → str

Return str(self).

class algosdk.abi.method.Method

Method(name: str, args: List[algosdk.abi.method.Argument], returns: algosdk.abi.method.Returns, desc: Optional[str] = None)

Represents a ABI method description.

Args: name (string): name of the method args (list): list of Argument objects with type, name, and optional description returns (Returns): a Returns object with a type and optional description desc (string, optional): optional description of the method

Initialization

__eq__

eq(o: object) → bool

Return self==value.

get_selector

get_selector() → bytes

Returns the ABI method signature, which is the first four bytes of the SHA-512/256 hash of the method signature.

Returns: bytes: first four bytes of the method signature hash

get_txn_calls

get_txn_calls() → int

Returns the number of transactions needed to invoke this ABI method.

class algosdk.abi.method.MethodDict

MethodDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

Initialization

Initialize self. See help(type(self)) for accurate signature.

__contains__

contains()

True if the dictionary has the specified key, else False.

__delattr__

delattr()

Implement delattr(self, name).

__delitem__

delitem()

Delete self[key].

__dir__

dir()

Default dir() implementation.

__eq__

eq()

Return self==value.

__format__

format()

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__

ge()

Return self>=value.

__getattribute__

getattribute()

Return getattr(self, name).

__getitem__

getitem()

Return self[key].

__getstate__

getstate()

Helper for pickle.

__gt__

gt()

Return self>value.

__ior__

ior()

Return self|=value.

__iter__

iter()

Implement iter(self).

__le__

le()

Return self<=value.

__len__

len()

Return len(self).

__lt__

lt()

Return self<value.

__ne__

ne()

Return self!=value.

__new__

new()

Create and return a new object. See help(type) for accurate signature.

__or__

or()

Return self|value.

__reduce__

reduce()

Helper for pickle.

__reduce_ex__

reduce_ex()

Helper for pickle.

__repr__

repr()

Return repr(self).

__reversed__

reversed()

Return a reverse iterator over the dict keys.

__ror__

ror()

Return value|self.

__setattr__

setattr()

Implement setattr(self, name, value).

__setitem__

setitem()

Set self[key] to value.

__sizeof__

sizeof()

D.sizeof() -> size of D in memory, in bytes

__str__

str()

Return str(self).

clear

clear()

D.clear() -> None. Remove all items from D.

copy

copy()

D.copy() -> a shallow copy of D

get

get()

Return the value for key if key is in the dictionary, else default.

items

items()

D.items() -> a set-like object providing a view on D’s items

keys

keys()

D.keys() -> a set-like object providing a view on D’s keys

pop

pop()

D.pop(k[,d]) -> v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault

setdefault()

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update

update()

D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values

values()

D.values() -> an object providing a view on D’s values

class algosdk.abi.method.MethodDict_Optional

MethodDict_Optional

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

Initialization

Initialize self. See help(type(self)) for accurate signature.

__contains__

contains()

True if the dictionary has the specified key, else False.

__delattr__

delattr()

Implement delattr(self, name).

__delitem__

delitem()

Delete self[key].

__dir__

dir()

Default dir() implementation.

__eq__

eq()

Return self==value.

__format__

format()

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__

ge()

Return self>=value.

__getattribute__

getattribute()

Return getattr(self, name).

__getitem__

getitem()

Return self[key].

__getstate__

getstate()

Helper for pickle.

__gt__

gt()

Return self>value.

__ior__

ior()

Return self|=value.

__iter__

iter()

Implement iter(self).

__le__

le()

Return self<=value.

__len__

len()

Return len(self).

__lt__

lt()

Return self<value.

__ne__

ne()

Return self!=value.

__new__

new()

Create and return a new object. See help(type) for accurate signature.

__or__

or()

Return self|value.

__reduce__

reduce()

Helper for pickle.

__reduce_ex__

reduce_ex()

Helper for pickle.

__repr__

repr()

Return repr(self).

__reversed__

reversed()

Return a reverse iterator over the dict keys.

__ror__

ror()

Return value|self.

__setattr__

setattr()

Implement setattr(self, name, value).

__setitem__

setitem()

Set self[key] to value.

__sizeof__

sizeof()

D.sizeof() -> size of D in memory, in bytes

__str__

str()

Return str(self).

clear

clear()

D.clear() -> None. Remove all items from D.

copy

copy()

D.copy() -> a shallow copy of D

get

get()

Return the value for key if key is in the dictionary, else default.

items

items()

D.items() -> a set-like object providing a view on D’s items

keys

keys()

D.keys() -> a set-like object providing a view on D’s keys

pop

pop()

D.pop(k[,d]) -> v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault

setdefault()

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update

update()

D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values

values()

D.values() -> an object providing a view on D’s values

class algosdk.abi.method.Returns

Returns(arg_type: str, desc: Optional[str] = None)

Represents a return type for a ABI method

Args: arg_type (string): ABI type of this return argument desc (string, optional): description of this return argument

Initialization

__eq__

eq(o: object) → bool

Return self==value.

__str__

str() → str

Return str(self).