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

Method encode_abi

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

Encodes the python values in ``args`` as a sequence of binary values of the ABI types in ``types`` via the head-tail mechanism. :param types: An iterable of string representations of the ABI types that will be used for encoding e.g. ``('uint256', 'bytes[]',

(self, types: Iterable[TypeStr], args: Iterable[Any])

Source from the content-addressed store, hash-verified

75 return encoder(arg)
76
77 def encode_abi(self, types: Iterable[TypeStr], args: Iterable[Any]) -> bytes:
78 """
79 Encodes the python values in ``args`` as a sequence of binary values of
80 the ABI types in ``types`` via the head-tail mechanism.
81
82 :param types: An iterable of string representations of the ABI types
83 that will be used for encoding e.g. ``('uint256', 'bytes[]',
84 '(int,int)')``
85 :param args: An iterable of python values to be encoded.
86
87 :returns: The head-tail encoded binary representation of the python
88 values in ``args`` as values of the ABI types in ``types``.
89 """
90 warnings.warn(
91 "abi.encode_abi() and abi.encode_abi_packed() are deprecated and will be "
92 "removed in version 4.0.0 in favor of abi.encode() and "
93 "abi.encode_packed(), respectively",
94 category=DeprecationWarning,
95 )
96 return self.encode(types, args)
97
98 def encode(self, types, args):
99 encoders = [self._registry.get_encoder(type_str) for type_str in types]

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.95

Tested by

no test coverage detected