MCPcopy Create free account
hub / github.com/ccxt/ccxt / decode_abi

Method decode_abi

python/ccxt/static_dependencies/ethereum/abi/codec.py:182–200  ·  view source on GitHub ↗

Decodes the binary value ``data`` as a sequence of values of the ABI types in ``types`` via the head-tail mechanism into a tuple of equivalent python values. :param types: An iterable of string representations of the ABI types that will be used for decod

(self, types: Iterable[TypeStr], data: Decodable)

Source from the content-addressed store, hash-verified

180 return decoder(stream)
181
182 def decode_abi(self, types: Iterable[TypeStr], data: Decodable) -> Tuple[Any, ...]:
183 """
184 Decodes the binary value ``data`` as a sequence of values of the ABI types
185 in ``types`` via the head-tail mechanism into a tuple of equivalent python
186 values.
187
188 :param types: An iterable of string representations of the ABI types that
189 will be used for decoding e.g. ``('uint256', 'bytes[]', '(int,int)')``
190 :param data: The binary value to be decoded.
191
192 :returns: A tuple of equivalent python values for the ABI values
193 represented in ``data``.
194 """
195 warnings.warn(
196 "abi.decode_abi() is deprecated and will be removed in version 4.0.0 in "
197 "favor of abi.decode()",
198 category=DeprecationWarning,
199 )
200 return self.decode(types, data)
201
202 def decode(self, types, data):
203 if not is_bytes(data):

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.95

Tested by

no test coverage detected