web3 6.20.2__py3-none-any.whl → 7.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ens/__init__.py +13 -2
- ens/_normalization.py +2 -17
- ens/async_ens.py +33 -21
- ens/base_ens.py +3 -1
- ens/ens.py +16 -11
- ens/exceptions.py +16 -29
- ens/specs/nf.json +1 -1
- ens/specs/normalization_spec.json +1 -1
- ens/utils.py +52 -63
- web3/__init__.py +20 -24
- web3/_utils/abi.py +115 -271
- web3/_utils/async_transactions.py +7 -4
- web3/_utils/batching.py +217 -0
- web3/_utils/blocks.py +6 -2
- web3/_utils/caching.py +128 -5
- web3/_utils/compat/__init__.py +2 -3
- web3/_utils/contract_sources/compile_contracts.py +1 -1
- web3/_utils/contract_sources/contract_data/arrays_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/bytes_contracts.py +5 -5
- web3/_utils/contract_sources/contract_data/constructor_contracts.py +7 -7
- web3/_utils/contract_sources/contract_data/contract_caller_tester.py +3 -3
- web3/_utils/contract_sources/contract_data/emitter_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/event_contracts.py +5 -5
- web3/_utils/contract_sources/contract_data/extended_resolver.py +3 -3
- web3/_utils/contract_sources/contract_data/fallback_function_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/math_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/offchain_lookup.py +3 -3
- web3/_utils/contract_sources/contract_data/offchain_resolver.py +3 -3
- web3/_utils/contract_sources/contract_data/panic_errors_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/payable_tester.py +3 -3
- web3/_utils/contract_sources/contract_data/receive_function_contracts.py +5 -5
- web3/_utils/contract_sources/contract_data/reflector_contracts.py +3 -3
- web3/_utils/contract_sources/contract_data/revert_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/simple_resolver.py +3 -3
- web3/_utils/contract_sources/contract_data/storage_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/string_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/tuple_contracts.py +5 -5
- web3/_utils/contracts.py +130 -236
- web3/_utils/datatypes.py +5 -1
- web3/_utils/decorators.py +13 -23
- web3/_utils/empty.py +1 -1
- web3/_utils/encoding.py +16 -12
- web3/_utils/ens.py +2 -1
- web3/_utils/error_formatters_utils.py +5 -3
- web3/_utils/events.py +66 -69
- web3/_utils/fee_utils.py +1 -3
- web3/_utils/filters.py +24 -22
- web3/_utils/formatters.py +2 -2
- web3/_utils/http.py +5 -3
- web3/_utils/http_session_manager.py +303 -0
- web3/_utils/math.py +14 -15
- web3/_utils/method_formatters.py +34 -36
- web3/_utils/module.py +2 -1
- web3/_utils/module_testing/__init__.py +0 -3
- web3/_utils/module_testing/eth_module.py +695 -643
- web3/_utils/module_testing/module_testing_utils.py +61 -34
- web3/_utils/module_testing/persistent_connection_provider.py +56 -25
- web3/_utils/module_testing/utils.py +258 -0
- web3/_utils/module_testing/web3_module.py +438 -17
- web3/_utils/normalizers.py +13 -11
- web3/_utils/rpc_abi.py +5 -32
- web3/_utils/threads.py +8 -7
- web3/_utils/transactions.py +14 -12
- web3/_utils/type_conversion.py +5 -1
- web3/_utils/validation.py +17 -17
- web3/auto/gethdev.py +7 -2
- web3/beacon/__init__.py +6 -1
- web3/beacon/async_beacon.py +9 -5
- web3/beacon/{main.py → beacon.py} +7 -5
- web3/contract/__init__.py +7 -0
- web3/contract/async_contract.py +47 -46
- web3/contract/base_contract.py +183 -158
- web3/contract/contract.py +49 -43
- web3/contract/utils.py +203 -59
- web3/datastructures.py +79 -31
- web3/eth/__init__.py +7 -0
- web3/eth/async_eth.py +39 -51
- web3/eth/base_eth.py +17 -10
- web3/eth/eth.py +30 -68
- web3/exceptions.py +108 -82
- web3/gas_strategies/time_based.py +8 -6
- web3/geth.py +1 -254
- web3/main.py +75 -122
- web3/manager.py +316 -146
- web3/method.py +38 -31
- web3/middleware/__init__.py +67 -89
- web3/middleware/attrdict.py +36 -49
- web3/middleware/base.py +174 -0
- web3/middleware/buffered_gas_estimate.py +20 -21
- web3/middleware/filter.py +157 -117
- web3/middleware/formatting.py +124 -108
- web3/middleware/gas_price_strategy.py +20 -32
- web3/middleware/names.py +29 -26
- web3/middleware/proof_of_authority.py +68 -0
- web3/middleware/pythonic.py +2 -2
- web3/middleware/signing.py +74 -89
- web3/middleware/stalecheck.py +52 -79
- web3/middleware/validation.py +5 -13
- web3/module.py +54 -10
- web3/providers/__init__.py +10 -6
- web3/providers/async_base.py +117 -39
- web3/providers/auto.py +3 -3
- web3/providers/base.py +89 -33
- web3/providers/eth_tester/__init__.py +5 -0
- web3/providers/eth_tester/defaults.py +1 -64
- web3/providers/eth_tester/main.py +99 -31
- web3/providers/eth_tester/middleware.py +45 -73
- web3/providers/ipc.py +42 -46
- web3/providers/{websocket/websocket.py → legacy_websocket.py} +32 -7
- web3/providers/persistent/__init__.py +22 -0
- web3/providers/persistent/async_ipc.py +153 -0
- web3/providers/{persistent.py → persistent/persistent.py} +106 -25
- web3/providers/persistent/persistent_connection.py +84 -0
- web3/providers/{websocket → persistent}/request_processor.py +94 -32
- web3/providers/persistent/utils.py +43 -0
- web3/providers/{websocket/websocket_v2.py → persistent/websocket.py} +29 -28
- web3/providers/rpc/__init__.py +11 -0
- web3/providers/rpc/async_rpc.py +171 -0
- web3/providers/rpc/rpc.py +179 -0
- web3/providers/rpc/utils.py +92 -0
- web3/testing.py +4 -4
- web3/tools/benchmark/main.py +22 -22
- web3/tools/benchmark/node.py +2 -8
- web3/tools/benchmark/reporting.py +2 -2
- web3/tools/benchmark/utils.py +1 -1
- web3/tracing.py +9 -5
- web3/types.py +30 -107
- web3/utils/__init__.py +58 -5
- web3/utils/abi.py +575 -10
- web3/utils/async_exception_handling.py +19 -7
- web3/utils/caching.py +32 -13
- web3/utils/exception_handling.py +7 -5
- {web3-6.20.2.dist-info → web3-7.0.0.dist-info}/LICENSE +1 -1
- web3-7.0.0.dist-info/METADATA +112 -0
- web3-7.0.0.dist-info/RECORD +167 -0
- {web3-6.20.2.dist-info → web3-7.0.0.dist-info}/WHEEL +1 -1
- {web3-6.20.2.dist-info → web3-7.0.0.dist-info}/top_level.txt +0 -1
- ethpm/__init__.py +0 -20
- ethpm/_utils/__init__.py +0 -0
- ethpm/_utils/backend.py +0 -93
- ethpm/_utils/cache.py +0 -44
- ethpm/_utils/chains.py +0 -119
- ethpm/_utils/contract.py +0 -35
- ethpm/_utils/deployments.py +0 -145
- ethpm/_utils/ipfs.py +0 -116
- ethpm/_utils/protobuf/__init__.py +0 -0
- ethpm/_utils/protobuf/ipfs_file_pb2.py +0 -33
- ethpm/_utils/registry.py +0 -29
- ethpm/assets/__init__.py +0 -0
- ethpm/assets/ens/v3.json +0 -1
- ethpm/assets/escrow/with_bytecode_v3.json +0 -1
- ethpm/assets/ipfs_file.proto +0 -32
- ethpm/assets/owned/output_v3.json +0 -1
- ethpm/assets/owned/with_contract_type_v3.json +0 -1
- ethpm/assets/registry/contracts/Authority.sol +0 -156
- ethpm/assets/registry/contracts/IndexedOrderedSetLib.sol +0 -106
- ethpm/assets/registry/contracts/PackageDB.sol +0 -225
- ethpm/assets/registry/contracts/PackageRegistry.sol +0 -361
- ethpm/assets/registry/contracts/PackageRegistryInterface.sol +0 -97
- ethpm/assets/registry/contracts/ReleaseDB.sol +0 -309
- ethpm/assets/registry/contracts/ReleaseValidator.sol +0 -152
- ethpm/assets/registry/solc_input.json +0 -1
- ethpm/assets/registry/solc_output.json +0 -1
- ethpm/assets/registry/v3.json +0 -1
- ethpm/assets/safe-math-lib/v3-strict-no-deployments.json +0 -1
- ethpm/assets/simple-registry/contracts/Ownable.sol +0 -63
- ethpm/assets/simple-registry/contracts/PackageRegistry.sol +0 -373
- ethpm/assets/simple-registry/contracts/PackageRegistryInterface.sol +0 -96
- ethpm/assets/simple-registry/solc_input.json +0 -33
- ethpm/assets/simple-registry/solc_output.json +0 -1
- ethpm/assets/simple-registry/v3.json +0 -1
- ethpm/assets/standard-token/output_v3.json +0 -1
- ethpm/assets/standard-token/with_bytecode_v3.json +0 -1
- ethpm/assets/vyper_registry/0.1.0.json +0 -1
- ethpm/assets/vyper_registry/registry.vy +0 -216
- ethpm/assets/vyper_registry/registry_with_delete.vy +0 -244
- ethpm/backends/__init__.py +0 -0
- ethpm/backends/base.py +0 -43
- ethpm/backends/http.py +0 -108
- ethpm/backends/ipfs.py +0 -219
- ethpm/backends/registry.py +0 -154
- ethpm/constants.py +0 -17
- ethpm/contract.py +0 -187
- ethpm/dependencies.py +0 -58
- ethpm/deployments.py +0 -80
- ethpm/ethpm-spec/examples/escrow/1.0.0-pretty.json +0 -146
- ethpm/ethpm-spec/examples/escrow/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/escrow/contracts/Escrow.sol +0 -32
- ethpm/ethpm-spec/examples/escrow/contracts/SafeSendLib.sol +0 -20
- ethpm/ethpm-spec/examples/escrow/v3-pretty.json +0 -171
- ethpm/ethpm-spec/examples/escrow/v3.json +0 -1
- ethpm/ethpm-spec/examples/owned/1.0.0-pretty.json +0 -21
- ethpm/ethpm-spec/examples/owned/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/owned/contracts/Owned.sol +0 -12
- ethpm/ethpm-spec/examples/owned/v3-pretty.json +0 -27
- ethpm/ethpm-spec/examples/owned/v3.json +0 -1
- ethpm/ethpm-spec/examples/piper-coin/1.0.0-pretty.json +0 -31
- ethpm/ethpm-spec/examples/piper-coin/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/piper-coin/v3-pretty.json +0 -21
- ethpm/ethpm-spec/examples/piper-coin/v3.json +0 -1
- ethpm/ethpm-spec/examples/safe-math-lib/1.0.0-pretty.json +0 -85
- ethpm/ethpm-spec/examples/safe-math-lib/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/safe-math-lib/contracts/SafeMathLib.sol +0 -24
- ethpm/ethpm-spec/examples/safe-math-lib/v3-pretty.json +0 -117
- ethpm/ethpm-spec/examples/safe-math-lib/v3.json +0 -1
- ethpm/ethpm-spec/examples/standard-token/1.0.0-pretty.json +0 -55
- ethpm/ethpm-spec/examples/standard-token/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/standard-token/contracts/AbstractToken.sol +0 -20
- ethpm/ethpm-spec/examples/standard-token/contracts/StandardToken.sol +0 -84
- ethpm/ethpm-spec/examples/standard-token/v3-pretty.json +0 -460
- ethpm/ethpm-spec/examples/standard-token/v3.json +0 -1
- ethpm/ethpm-spec/examples/transferable/1.0.0-pretty.json +0 -21
- ethpm/ethpm-spec/examples/transferable/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/transferable/contracts/Transferable.sol +0 -14
- ethpm/ethpm-spec/examples/transferable/v3-pretty.json +0 -27
- ethpm/ethpm-spec/examples/transferable/v3.json +0 -1
- ethpm/ethpm-spec/examples/wallet/1.0.0-pretty.json +0 -120
- ethpm/ethpm-spec/examples/wallet/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/wallet/contracts/Wallet.sol +0 -41
- ethpm/ethpm-spec/examples/wallet/v3-pretty.json +0 -181
- ethpm/ethpm-spec/examples/wallet/v3.json +0 -1
- ethpm/ethpm-spec/examples/wallet-with-send/1.0.0-pretty.json +0 -135
- ethpm/ethpm-spec/examples/wallet-with-send/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/wallet-with-send/contracts/WalletWithSend.sol +0 -18
- ethpm/ethpm-spec/examples/wallet-with-send/v3-pretty.json +0 -207
- ethpm/ethpm-spec/examples/wallet-with-send/v3.json +0 -1
- ethpm/ethpm-spec/spec/package.spec.json +0 -379
- ethpm/ethpm-spec/spec/v3.spec.json +0 -483
- ethpm/exceptions.py +0 -68
- ethpm/package.py +0 -438
- ethpm/tools/__init__.py +0 -4
- ethpm/tools/builder.py +0 -930
- ethpm/tools/checker.py +0 -312
- ethpm/tools/get_manifest.py +0 -19
- ethpm/uri.py +0 -141
- ethpm/validation/__init__.py +0 -0
- ethpm/validation/manifest.py +0 -146
- ethpm/validation/misc.py +0 -39
- ethpm/validation/package.py +0 -80
- ethpm/validation/uri.py +0 -163
- web3/_utils/contract_sources/contract_data/address_reflector.py +0 -29
- web3/_utils/miner.py +0 -88
- web3/_utils/module_testing/go_ethereum_personal_module.py +0 -323
- web3/_utils/request.py +0 -265
- web3/middleware/abi.py +0 -11
- web3/middleware/async_cache.py +0 -99
- web3/middleware/cache.py +0 -374
- web3/middleware/exception_handling.py +0 -49
- web3/middleware/exception_retry_request.py +0 -188
- web3/middleware/fixture.py +0 -190
- web3/middleware/geth_poa.py +0 -81
- web3/middleware/normalize_request_parameters.py +0 -11
- web3/middleware/simulate_unmined_transaction.py +0 -43
- web3/pm.py +0 -602
- web3/providers/async_rpc.py +0 -99
- web3/providers/rpc.py +0 -98
- web3/providers/websocket/__init__.py +0 -11
- web3/providers/websocket/websocket_connection.py +0 -42
- web3/tools/__init__.py +0 -4
- web3/tools/pytest_ethereum/__init__.py +0 -0
- web3/tools/pytest_ethereum/_utils.py +0 -145
- web3/tools/pytest_ethereum/deployer.py +0 -48
- web3/tools/pytest_ethereum/exceptions.py +0 -22
- web3/tools/pytest_ethereum/linker.py +0 -128
- web3/tools/pytest_ethereum/plugins.py +0 -33
- web3-6.20.2.dist-info/METADATA +0 -103
- web3-6.20.2.dist-info/RECORD +0 -283
- web3-6.20.2.dist-info/entry_points.txt +0 -2
- /web3/_utils/{function_identifiers.py → abi_element_identifiers.py} +0 -0
web3/types.py
CHANGED
|
@@ -5,10 +5,13 @@ from typing import (
|
|
|
5
5
|
Coroutine,
|
|
6
6
|
Dict,
|
|
7
7
|
List,
|
|
8
|
+
Literal,
|
|
8
9
|
NewType,
|
|
9
10
|
Optional,
|
|
10
11
|
Sequence,
|
|
12
|
+
Tuple,
|
|
11
13
|
Type,
|
|
14
|
+
TypedDict,
|
|
12
15
|
TypeVar,
|
|
13
16
|
Union,
|
|
14
17
|
)
|
|
@@ -24,17 +27,12 @@ from hexbytes import (
|
|
|
24
27
|
HexBytes,
|
|
25
28
|
)
|
|
26
29
|
|
|
27
|
-
from web3._utils.
|
|
28
|
-
Literal,
|
|
29
|
-
NotRequired,
|
|
30
|
-
TypedDict,
|
|
31
|
-
)
|
|
32
|
-
from web3._utils.function_identifiers import (
|
|
30
|
+
from web3._utils.abi_element_identifiers import (
|
|
33
31
|
FallbackFn,
|
|
34
32
|
ReceiveFn,
|
|
35
33
|
)
|
|
36
|
-
from web3.
|
|
37
|
-
|
|
34
|
+
from web3._utils.compat import (
|
|
35
|
+
NotRequired,
|
|
38
36
|
)
|
|
39
37
|
|
|
40
38
|
if TYPE_CHECKING:
|
|
@@ -46,15 +44,16 @@ if TYPE_CHECKING:
|
|
|
46
44
|
)
|
|
47
45
|
|
|
48
46
|
|
|
49
|
-
|
|
47
|
+
TFunc = TypeVar("TFunc", bound=Callable[..., Any])
|
|
50
48
|
TParams = TypeVar("TParams")
|
|
49
|
+
TReturn = TypeVar("TReturn")
|
|
51
50
|
TValue = TypeVar("TValue")
|
|
52
51
|
|
|
53
52
|
BlockParams = Literal["latest", "earliest", "pending", "safe", "finalized"]
|
|
54
53
|
BlockIdentifier = Union[BlockParams, BlockNumber, Hash32, HexStr, HexBytes, int]
|
|
55
54
|
LatestBlockParam = Literal["latest"]
|
|
56
55
|
|
|
57
|
-
|
|
56
|
+
ABIElementIdentifier = Union[str, Type[FallbackFn], Type[ReceiveFn]]
|
|
58
57
|
|
|
59
58
|
# bytes, hexbytes, or hexstr representing a 32 byte hash
|
|
60
59
|
_Hash32 = Union[Hash32, HexBytes, HexStr]
|
|
@@ -76,72 +75,6 @@ class AccessListEntry(TypedDict):
|
|
|
76
75
|
AccessList = NewType("AccessList", Sequence[AccessListEntry])
|
|
77
76
|
|
|
78
77
|
|
|
79
|
-
# todo: move these to eth_typing once web3 is type hinted
|
|
80
|
-
class ABIEventParams(TypedDict, total=False):
|
|
81
|
-
indexed: bool
|
|
82
|
-
name: str
|
|
83
|
-
type: str
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
class ABIEvent(TypedDict, total=False):
|
|
87
|
-
anonymous: bool
|
|
88
|
-
inputs: Sequence["ABIEventParams"]
|
|
89
|
-
name: str
|
|
90
|
-
type: Literal["event"]
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
class ABIFunctionComponents(TypedDict, total=False):
|
|
94
|
-
components: Sequence["ABIFunctionComponents"]
|
|
95
|
-
name: str
|
|
96
|
-
type: str
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
class ABIFunctionParams(TypedDict, total=False):
|
|
100
|
-
components: Sequence["ABIFunctionComponents"]
|
|
101
|
-
name: str
|
|
102
|
-
type: str
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class ABIFunction(TypedDict, total=False):
|
|
106
|
-
constant: bool
|
|
107
|
-
inputs: Sequence["ABIFunctionParams"]
|
|
108
|
-
name: str
|
|
109
|
-
outputs: Sequence["ABIFunctionParams"]
|
|
110
|
-
payable: bool
|
|
111
|
-
stateMutability: Literal["pure", "view", "nonpayable", "payable"]
|
|
112
|
-
type: Literal["function", "constructor", "fallback", "receive"]
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
class ABIComponent(TypedDict):
|
|
116
|
-
"""
|
|
117
|
-
TypedDict representing an `ABIElement` component.
|
|
118
|
-
"""
|
|
119
|
-
|
|
120
|
-
name: str
|
|
121
|
-
"""Name of the component."""
|
|
122
|
-
type: str
|
|
123
|
-
"""Type of the component."""
|
|
124
|
-
components: NotRequired[Sequence["ABIComponent"]]
|
|
125
|
-
"""List of nested `ABI` components for ABI types."""
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
class ABIError(TypedDict):
|
|
129
|
-
"""
|
|
130
|
-
TypedDict representing the `ABI` for an error.
|
|
131
|
-
"""
|
|
132
|
-
|
|
133
|
-
type: Literal["error"]
|
|
134
|
-
"""Type of the error."""
|
|
135
|
-
name: str
|
|
136
|
-
"""Name of the error."""
|
|
137
|
-
inputs: NotRequired[Sequence["ABIComponent"]]
|
|
138
|
-
"""Error input components."""
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
ABIElement = Union[ABIFunction, ABIEvent, ABIError]
|
|
142
|
-
ABI = Sequence[Union[ABIFunction, ABIEvent]]
|
|
143
|
-
|
|
144
|
-
|
|
145
78
|
class EventData(TypedDict):
|
|
146
79
|
address: ChecksumAddress
|
|
147
80
|
args: Dict[str, Any]
|
|
@@ -217,15 +150,11 @@ TxParams = TypedDict(
|
|
|
217
150
|
)
|
|
218
151
|
|
|
219
152
|
|
|
220
|
-
WithdrawalData
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
"address": ChecksumAddress,
|
|
226
|
-
"amount": Gwei,
|
|
227
|
-
},
|
|
228
|
-
)
|
|
153
|
+
class WithdrawalData(TypedDict):
|
|
154
|
+
index: int
|
|
155
|
+
validator_index: int
|
|
156
|
+
address: ChecksumAddress
|
|
157
|
+
amount: Gwei
|
|
229
158
|
|
|
230
159
|
|
|
231
160
|
class BlockData(TypedDict, total=False):
|
|
@@ -256,7 +185,7 @@ class BlockData(TypedDict, total=False):
|
|
|
256
185
|
blobGasUsed: int
|
|
257
186
|
excessBlobGas: int
|
|
258
187
|
|
|
259
|
-
#
|
|
188
|
+
# ExtraDataToPOAMiddleware replaces extraData w/ proofOfAuthorityData
|
|
260
189
|
proofOfAuthorityData: HexBytes
|
|
261
190
|
|
|
262
191
|
|
|
@@ -328,7 +257,7 @@ RPCId = Optional[Union[int, str]]
|
|
|
328
257
|
|
|
329
258
|
|
|
330
259
|
class RPCResponse(TypedDict, total=False):
|
|
331
|
-
error:
|
|
260
|
+
error: RPCError
|
|
332
261
|
id: RPCId
|
|
333
262
|
jsonrpc: Literal["2.0"]
|
|
334
263
|
result: Any
|
|
@@ -350,15 +279,12 @@ class CreateAccessListResponse(TypedDict):
|
|
|
350
279
|
gasUsed: int
|
|
351
280
|
|
|
352
281
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
[Callable[[RPCEndpoint, Any], RPCResponse], "AsyncWeb3"], Any
|
|
282
|
+
MakeRequestFn = Callable[[RPCEndpoint, Any], RPCResponse]
|
|
283
|
+
MakeBatchRequestFn = Callable[[List[Tuple[RPCEndpoint, Any]]], List[RPCResponse]]
|
|
284
|
+
AsyncMakeRequestFn = Callable[[RPCEndpoint, Any], Coroutine[Any, Any, RPCResponse]]
|
|
285
|
+
AsyncMakeBatchRequestFn = Callable[
|
|
286
|
+
[List[Tuple[RPCEndpoint, Any]]], Coroutine[Any, Any, List[RPCResponse]]
|
|
359
287
|
]
|
|
360
|
-
MiddlewareOnion = NamedElementOnion[str, Middleware]
|
|
361
|
-
AsyncMiddlewareOnion = NamedElementOnion[str, AsyncMiddleware]
|
|
362
288
|
|
|
363
289
|
|
|
364
290
|
class FormattersDict(TypedDict, total=False):
|
|
@@ -382,20 +308,15 @@ class FeeHistory(TypedDict):
|
|
|
382
308
|
reward: List[List[Wei]]
|
|
383
309
|
|
|
384
310
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
"state": Optional[Dict[HexStr, HexStr]],
|
|
392
|
-
"stateDiff": Optional[Dict[HexStr, HexStr]],
|
|
393
|
-
},
|
|
394
|
-
total=False,
|
|
395
|
-
)
|
|
311
|
+
class StateOverrideParams(TypedDict, total=False):
|
|
312
|
+
balance: Optional[Wei]
|
|
313
|
+
nonce: Optional[int]
|
|
314
|
+
code: Optional[Union[bytes, HexStr]]
|
|
315
|
+
state: Optional[Dict[HexStr, HexStr]]
|
|
316
|
+
stateDiff: Optional[Dict[HexStr, HexStr]]
|
|
396
317
|
|
|
397
318
|
|
|
398
|
-
|
|
319
|
+
StateOverride = Dict[ChecksumAddress, StateOverrideParams]
|
|
399
320
|
|
|
400
321
|
|
|
401
322
|
GasPriceStrategy = Union[
|
|
@@ -425,6 +346,8 @@ TxReceipt = TypedDict(
|
|
|
425
346
|
},
|
|
426
347
|
)
|
|
427
348
|
|
|
349
|
+
BlockReceipts = List[TxReceipt]
|
|
350
|
+
|
|
428
351
|
|
|
429
352
|
class SignedTx(TypedDict, total=False):
|
|
430
353
|
raw: bytes
|
web3/utils/__init__.py
CHANGED
|
@@ -3,17 +3,70 @@ NOTE: This is a public utility module. Any changes to these utility methods woul
|
|
|
3
3
|
classify as breaking changes.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
from .abi import (
|
|
6
|
+
from eth_utils.abi import (
|
|
7
|
+
abi_to_signature,
|
|
8
|
+
collapse_if_tuple,
|
|
9
|
+
event_abi_to_log_topic,
|
|
10
|
+
event_signature_to_log_topic,
|
|
11
|
+
filter_abi_by_name,
|
|
12
|
+
filter_abi_by_type,
|
|
13
|
+
function_abi_to_4byte_selector,
|
|
14
|
+
function_signature_to_4byte_selector,
|
|
7
15
|
get_abi_input_names,
|
|
16
|
+
get_abi_input_types,
|
|
8
17
|
get_abi_output_names,
|
|
18
|
+
get_abi_output_types,
|
|
19
|
+
get_aligned_abi_inputs,
|
|
20
|
+
get_all_event_abis,
|
|
21
|
+
get_all_function_abis,
|
|
22
|
+
get_normalized_abi_inputs,
|
|
23
|
+
)
|
|
24
|
+
from .abi import ( # NOQA
|
|
25
|
+
check_if_arguments_can_be_encoded,
|
|
26
|
+
get_abi_element_info,
|
|
27
|
+
get_abi_element,
|
|
28
|
+
get_event_abi,
|
|
29
|
+
get_event_log_topics,
|
|
30
|
+
log_topic_to_bytes,
|
|
9
31
|
)
|
|
10
|
-
from .address import
|
|
11
|
-
|
|
32
|
+
from .address import (
|
|
33
|
+
get_create_address,
|
|
34
|
+
)
|
|
35
|
+
from .async_exception_handling import (
|
|
12
36
|
async_handle_offchain_lookup,
|
|
13
37
|
)
|
|
14
|
-
from .caching import (
|
|
38
|
+
from .caching import (
|
|
15
39
|
SimpleCache,
|
|
16
40
|
)
|
|
17
|
-
from .exception_handling import (
|
|
41
|
+
from .exception_handling import (
|
|
18
42
|
handle_offchain_lookup,
|
|
19
43
|
)
|
|
44
|
+
|
|
45
|
+
__all__ = [
|
|
46
|
+
"abi_to_signature",
|
|
47
|
+
"collapse_if_tuple",
|
|
48
|
+
"event_abi_to_log_topic",
|
|
49
|
+
"event_signature_to_log_topic",
|
|
50
|
+
"filter_abi_by_name",
|
|
51
|
+
"filter_abi_by_type",
|
|
52
|
+
"function_abi_to_4byte_selector",
|
|
53
|
+
"function_signature_to_4byte_selector",
|
|
54
|
+
"get_abi_input_names",
|
|
55
|
+
"get_abi_input_types",
|
|
56
|
+
"get_abi_output_names",
|
|
57
|
+
"get_abi_output_types",
|
|
58
|
+
"get_aligned_abi_inputs",
|
|
59
|
+
"get_all_event_abis",
|
|
60
|
+
"get_all_function_abis",
|
|
61
|
+
"get_normalized_abi_inputs",
|
|
62
|
+
"check_if_arguments_can_be_encoded",
|
|
63
|
+
"get_abi_element_info",
|
|
64
|
+
"get_abi_element",
|
|
65
|
+
"get_event_abi",
|
|
66
|
+
"get_event_log_topics",
|
|
67
|
+
"log_topic_to_bytes",
|
|
68
|
+
"get_create_address",
|
|
69
|
+
"async_handle_offchain_lookup",
|
|
70
|
+
"SimpleCache",
|
|
71
|
+
"handle_offchain_lookup",
|
|
72
|
+
]
|