web3 7.0.0b1__py3-none-any.whl → 7.7.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 +4 -4
- ens/async_ens.py +31 -21
- ens/base_ens.py +3 -1
- ens/contract_data.py +2 -2
- ens/ens.py +14 -11
- ens/exceptions.py +16 -29
- ens/specs/nf.json +1 -1
- ens/specs/normalization_spec.json +1 -1
- ens/utils.py +33 -41
- web3/__init__.py +23 -12
- web3/_utils/abi.py +162 -274
- web3/_utils/async_transactions.py +34 -20
- web3/_utils/batching.py +217 -0
- web3/_utils/blocks.py +6 -2
- web3/_utils/caching/__init__.py +12 -0
- web3/_utils/caching/caching_utils.py +433 -0
- web3/_utils/caching/request_caching_validation.py +287 -0
- web3/_utils/compat/__init__.py +2 -3
- web3/_utils/contract_sources/compile_contracts.py +1 -1
- web3/_utils/contract_sources/contract_data/ambiguous_function_contract.py +42 -0
- 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 +50 -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 +172 -220
- web3/_utils/datatypes.py +5 -1
- web3/_utils/decorators.py +6 -1
- web3/_utils/empty.py +1 -1
- web3/_utils/encoding.py +16 -12
- web3/_utils/error_formatters_utils.py +5 -3
- web3/_utils/events.py +78 -72
- web3/_utils/fee_utils.py +1 -3
- web3/_utils/filters.py +24 -22
- web3/_utils/formatters.py +2 -2
- web3/_utils/http.py +8 -2
- web3/_utils/http_session_manager.py +314 -0
- web3/_utils/math.py +14 -15
- web3/_utils/method_formatters.py +161 -34
- web3/_utils/module.py +2 -1
- web3/_utils/module_testing/__init__.py +3 -2
- web3/_utils/module_testing/eth_module.py +736 -583
- web3/_utils/module_testing/go_ethereum_debug_module.py +128 -0
- web3/_utils/module_testing/module_testing_utils.py +81 -24
- web3/_utils/module_testing/persistent_connection_provider.py +702 -220
- web3/_utils/module_testing/utils.py +114 -33
- web3/_utils/module_testing/web3_module.py +438 -17
- web3/_utils/normalizers.py +13 -11
- web3/_utils/rpc_abi.py +10 -22
- web3/_utils/threads.py +8 -7
- web3/_utils/transactions.py +32 -25
- web3/_utils/type_conversion.py +5 -1
- web3/_utils/validation.py +20 -17
- web3/beacon/__init__.py +5 -0
- web3/beacon/api_endpoints.py +3 -0
- web3/beacon/async_beacon.py +29 -6
- web3/beacon/beacon.py +24 -6
- web3/contract/__init__.py +7 -0
- web3/contract/async_contract.py +285 -82
- web3/contract/base_contract.py +556 -258
- web3/contract/contract.py +295 -84
- web3/contract/utils.py +251 -55
- web3/datastructures.py +56 -41
- web3/eth/__init__.py +7 -0
- web3/eth/async_eth.py +89 -69
- web3/eth/base_eth.py +7 -3
- web3/eth/eth.py +43 -66
- web3/exceptions.py +158 -83
- web3/gas_strategies/time_based.py +8 -6
- web3/geth.py +53 -184
- web3/main.py +77 -43
- web3/manager.py +368 -101
- web3/method.py +43 -15
- web3/middleware/__init__.py +26 -8
- web3/middleware/attrdict.py +12 -22
- web3/middleware/base.py +55 -2
- web3/middleware/filter.py +45 -23
- web3/middleware/formatting.py +6 -3
- web3/middleware/names.py +4 -1
- web3/middleware/signing.py +15 -6
- web3/middleware/stalecheck.py +2 -1
- web3/module.py +62 -26
- web3/providers/__init__.py +21 -0
- web3/providers/async_base.py +93 -38
- web3/providers/base.py +85 -40
- web3/providers/eth_tester/__init__.py +5 -0
- web3/providers/eth_tester/defaults.py +2 -55
- web3/providers/eth_tester/main.py +57 -35
- web3/providers/eth_tester/middleware.py +16 -17
- web3/providers/ipc.py +42 -18
- web3/providers/legacy_websocket.py +27 -2
- web3/providers/persistent/__init__.py +7 -0
- web3/providers/persistent/async_ipc.py +61 -121
- web3/providers/persistent/persistent.py +324 -17
- web3/providers/persistent/persistent_connection.py +54 -5
- web3/providers/persistent/request_processor.py +136 -56
- web3/providers/persistent/subscription_container.py +56 -0
- web3/providers/persistent/subscription_manager.py +233 -0
- web3/providers/persistent/websocket.py +29 -92
- web3/providers/rpc/__init__.py +5 -0
- web3/providers/rpc/async_rpc.py +73 -18
- web3/providers/rpc/rpc.py +73 -30
- web3/providers/rpc/utils.py +1 -13
- web3/scripts/install_pre_releases.py +33 -0
- web3/scripts/parse_pygeth_version.py +16 -0
- web3/testing.py +4 -4
- web3/tracing.py +9 -5
- web3/types.py +141 -74
- web3/utils/__init__.py +64 -5
- web3/utils/abi.py +790 -10
- web3/utils/address.py +8 -0
- web3/utils/async_exception_handling.py +20 -11
- web3/utils/caching.py +34 -4
- web3/utils/exception_handling.py +9 -12
- web3/utils/subscriptions.py +285 -0
- {web3-7.0.0b1.dist-info → web3-7.7.0.dist-info}/LICENSE +1 -1
- web3-7.7.0.dist-info/METADATA +130 -0
- web3-7.7.0.dist-info/RECORD +171 -0
- {web3-7.0.0b1.dist-info → web3-7.7.0.dist-info}/WHEEL +1 -1
- {web3-7.0.0b1.dist-info → web3-7.7.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/caching.py +0 -155
- web3/_utils/contract_sources/contract_data/address_reflector.py +0 -29
- web3/_utils/module_testing/go_ethereum_personal_module.py +0 -300
- web3/_utils/request.py +0 -265
- web3/pm.py +0 -602
- web3/tools/__init__.py +0 -4
- web3/tools/benchmark/__init__.py +0 -0
- web3/tools/benchmark/main.py +0 -185
- web3/tools/benchmark/node.py +0 -126
- web3/tools/benchmark/reporting.py +0 -39
- web3/tools/benchmark/utils.py +0 -69
- 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-7.0.0b1.dist-info/METADATA +0 -114
- web3-7.0.0b1.dist-info/RECORD +0 -280
- web3-7.0.0b1.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,34 +27,39 @@ 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
|
)
|
|
34
|
+
from web3._utils.compat import (
|
|
35
|
+
NotRequired,
|
|
36
|
+
)
|
|
36
37
|
|
|
37
38
|
if TYPE_CHECKING:
|
|
38
|
-
from web3.contract.async_contract import
|
|
39
|
-
|
|
39
|
+
from web3.contract.async_contract import ( # noqa: F401
|
|
40
|
+
AsyncContractEvent,
|
|
41
|
+
AsyncContractFunction,
|
|
42
|
+
)
|
|
43
|
+
from web3.contract.contract import ( # noqa: F401
|
|
44
|
+
ContractEvent,
|
|
45
|
+
ContractFunction,
|
|
46
|
+
)
|
|
40
47
|
from web3.main import ( # noqa: F401
|
|
41
48
|
AsyncWeb3,
|
|
42
49
|
Web3,
|
|
43
50
|
)
|
|
44
51
|
|
|
45
52
|
|
|
46
|
-
|
|
53
|
+
TFunc = TypeVar("TFunc", bound=Callable[..., Any])
|
|
47
54
|
TParams = TypeVar("TParams")
|
|
55
|
+
TReturn = TypeVar("TReturn")
|
|
48
56
|
TValue = TypeVar("TValue")
|
|
49
57
|
|
|
50
58
|
BlockParams = Literal["latest", "earliest", "pending", "safe", "finalized"]
|
|
51
59
|
BlockIdentifier = Union[BlockParams, BlockNumber, Hash32, HexStr, HexBytes, int]
|
|
52
60
|
LatestBlockParam = Literal["latest"]
|
|
53
61
|
|
|
54
|
-
|
|
62
|
+
ABIElementIdentifier = Union[str, Type[FallbackFn], Type[ReceiveFn]]
|
|
55
63
|
|
|
56
64
|
# bytes, hexbytes, or hexstr representing a 32 byte hash
|
|
57
65
|
_Hash32 = Union[Hash32, HexBytes, HexStr]
|
|
@@ -73,46 +81,6 @@ class AccessListEntry(TypedDict):
|
|
|
73
81
|
AccessList = NewType("AccessList", Sequence[AccessListEntry])
|
|
74
82
|
|
|
75
83
|
|
|
76
|
-
# todo: move these to eth_typing once web3 is type hinted
|
|
77
|
-
class ABIEventParams(TypedDict, total=False):
|
|
78
|
-
indexed: bool
|
|
79
|
-
name: str
|
|
80
|
-
type: str
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
class ABIEvent(TypedDict, total=False):
|
|
84
|
-
anonymous: bool
|
|
85
|
-
inputs: Sequence["ABIEventParams"]
|
|
86
|
-
name: str
|
|
87
|
-
type: Literal["event"]
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
class ABIFunctionComponents(TypedDict, total=False):
|
|
91
|
-
components: Sequence["ABIFunctionComponents"]
|
|
92
|
-
name: str
|
|
93
|
-
type: str
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
class ABIFunctionParams(TypedDict, total=False):
|
|
97
|
-
components: Sequence["ABIFunctionComponents"]
|
|
98
|
-
name: str
|
|
99
|
-
type: str
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
class ABIFunction(TypedDict, total=False):
|
|
103
|
-
constant: bool
|
|
104
|
-
inputs: Sequence["ABIFunctionParams"]
|
|
105
|
-
name: str
|
|
106
|
-
outputs: Sequence["ABIFunctionParams"]
|
|
107
|
-
payable: bool
|
|
108
|
-
stateMutability: Literal["pure", "view", "nonpayable", "payable"]
|
|
109
|
-
type: Literal["function", "constructor", "fallback", "receive"]
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ABIElement = Union[ABIFunction, ABIEvent]
|
|
113
|
-
ABI = Sequence[Union[ABIFunction, ABIEvent]]
|
|
114
|
-
|
|
115
|
-
|
|
116
84
|
class EventData(TypedDict):
|
|
117
85
|
address: ChecksumAddress
|
|
118
86
|
args: Dict[str, Any]
|
|
@@ -135,6 +103,7 @@ TxData = TypedDict(
|
|
|
135
103
|
"TxData",
|
|
136
104
|
{
|
|
137
105
|
"accessList": AccessList,
|
|
106
|
+
"blobVersionedHashes": Sequence[HexBytes],
|
|
138
107
|
"blockHash": HexBytes,
|
|
139
108
|
"blockNumber": BlockNumber,
|
|
140
109
|
"chainId": int,
|
|
@@ -142,6 +111,7 @@ TxData = TypedDict(
|
|
|
142
111
|
"from": ChecksumAddress,
|
|
143
112
|
"gas": int,
|
|
144
113
|
"gasPrice": Wei,
|
|
114
|
+
"maxFeePerBlobGas": Wei,
|
|
145
115
|
"maxFeePerGas": Wei,
|
|
146
116
|
"maxPriorityFeePerGas": Wei,
|
|
147
117
|
"hash": HexBytes,
|
|
@@ -163,6 +133,8 @@ TxData = TypedDict(
|
|
|
163
133
|
TxParams = TypedDict(
|
|
164
134
|
"TxParams",
|
|
165
135
|
{
|
|
136
|
+
"accessList": AccessList,
|
|
137
|
+
"blobVersionedHashes": Sequence[Union[str, HexStr, bytes, HexBytes]],
|
|
166
138
|
"chainId": int,
|
|
167
139
|
"data": Union[bytes, HexStr],
|
|
168
140
|
# addr or ens
|
|
@@ -170,6 +142,7 @@ TxParams = TypedDict(
|
|
|
170
142
|
"gas": int,
|
|
171
143
|
# legacy pricing
|
|
172
144
|
"gasPrice": Wei,
|
|
145
|
+
"maxFeePerBlobGas": Union[str, Wei],
|
|
173
146
|
# dynamic fee pricing
|
|
174
147
|
"maxFeePerGas": Union[str, Wei],
|
|
175
148
|
"maxPriorityFeePerGas": Union[str, Wei],
|
|
@@ -183,15 +156,11 @@ TxParams = TypedDict(
|
|
|
183
156
|
)
|
|
184
157
|
|
|
185
158
|
|
|
186
|
-
WithdrawalData
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
"address": ChecksumAddress,
|
|
192
|
-
"amount": Gwei,
|
|
193
|
-
},
|
|
194
|
-
)
|
|
159
|
+
class WithdrawalData(TypedDict):
|
|
160
|
+
index: int
|
|
161
|
+
validator_index: int
|
|
162
|
+
address: ChecksumAddress
|
|
163
|
+
amount: Gwei
|
|
195
164
|
|
|
196
165
|
|
|
197
166
|
class BlockData(TypedDict, total=False):
|
|
@@ -218,6 +187,9 @@ class BlockData(TypedDict, total=False):
|
|
|
218
187
|
uncles: Sequence[HexBytes]
|
|
219
188
|
withdrawals: Sequence[WithdrawalData]
|
|
220
189
|
withdrawalsRoot: HexBytes
|
|
190
|
+
parentBeaconBlockRoot: HexBytes
|
|
191
|
+
blobGasUsed: int
|
|
192
|
+
excessBlobGas: int
|
|
221
193
|
|
|
222
194
|
# ExtraDataToPOAMiddleware replaces extraData w/ proofOfAuthorityData
|
|
223
195
|
proofOfAuthorityData: HexBytes
|
|
@@ -290,8 +262,15 @@ EthSubscriptionParams = Union[
|
|
|
290
262
|
RPCId = Optional[Union[int, str]]
|
|
291
263
|
|
|
292
264
|
|
|
265
|
+
class RPCRequest(TypedDict, total=False):
|
|
266
|
+
id: RPCId
|
|
267
|
+
jsonrpc: Literal["2.0"]
|
|
268
|
+
method: RPCEndpoint
|
|
269
|
+
params: Any
|
|
270
|
+
|
|
271
|
+
|
|
293
272
|
class RPCResponse(TypedDict, total=False):
|
|
294
|
-
error:
|
|
273
|
+
error: RPCError
|
|
295
274
|
id: RPCId
|
|
296
275
|
jsonrpc: Literal["2.0"]
|
|
297
276
|
result: Any
|
|
@@ -301,11 +280,19 @@ class RPCResponse(TypedDict, total=False):
|
|
|
301
280
|
params: EthSubscriptionParams
|
|
302
281
|
|
|
303
282
|
|
|
283
|
+
EthSubscriptionResult = Union[
|
|
284
|
+
BlockData, # newHeads
|
|
285
|
+
TxData, # newPendingTransactions, full_transactions=True
|
|
286
|
+
HexBytes, # newPendingTransactions, full_transactions=False
|
|
287
|
+
LogReceipt, # logs
|
|
288
|
+
SyncProgress, # syncing
|
|
289
|
+
GethSyncingSubscriptionResult, # geth syncing
|
|
290
|
+
]
|
|
291
|
+
|
|
292
|
+
|
|
304
293
|
class FormattedEthSubscriptionResponse(TypedDict):
|
|
305
294
|
subscription: HexStr
|
|
306
|
-
result:
|
|
307
|
-
BlockData, TxData, LogReceipt, SyncProgress, GethSyncingSubscriptionResult
|
|
308
|
-
]
|
|
295
|
+
result: EthSubscriptionResult
|
|
309
296
|
|
|
310
297
|
|
|
311
298
|
class CreateAccessListResponse(TypedDict):
|
|
@@ -314,7 +301,11 @@ class CreateAccessListResponse(TypedDict):
|
|
|
314
301
|
|
|
315
302
|
|
|
316
303
|
MakeRequestFn = Callable[[RPCEndpoint, Any], RPCResponse]
|
|
304
|
+
MakeBatchRequestFn = Callable[[List[Tuple[RPCEndpoint, Any]]], List[RPCResponse]]
|
|
317
305
|
AsyncMakeRequestFn = Callable[[RPCEndpoint, Any], Coroutine[Any, Any, RPCResponse]]
|
|
306
|
+
AsyncMakeBatchRequestFn = Callable[
|
|
307
|
+
[List[Tuple[RPCEndpoint, Any]]], Coroutine[Any, Any, List[RPCResponse]]
|
|
308
|
+
]
|
|
318
309
|
|
|
319
310
|
|
|
320
311
|
class FormattersDict(TypedDict, total=False):
|
|
@@ -338,17 +329,12 @@ class FeeHistory(TypedDict):
|
|
|
338
329
|
reward: List[List[Wei]]
|
|
339
330
|
|
|
340
331
|
|
|
341
|
-
StateOverrideParams =
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
"state": Optional[Dict[HexStr, HexStr]],
|
|
348
|
-
"stateDiff": Optional[Dict[HexStr, HexStr]],
|
|
349
|
-
},
|
|
350
|
-
total=False,
|
|
351
|
-
)
|
|
332
|
+
class StateOverrideParams(TypedDict, total=False):
|
|
333
|
+
balance: Optional[Wei]
|
|
334
|
+
nonce: Optional[int]
|
|
335
|
+
code: Optional[Union[bytes, HexStr]]
|
|
336
|
+
state: Optional[Dict[HexStr, HexStr]]
|
|
337
|
+
stateDiff: Optional[Dict[HexStr, HexStr]]
|
|
352
338
|
|
|
353
339
|
|
|
354
340
|
StateOverride = Dict[ChecksumAddress, StateOverrideParams]
|
|
@@ -381,6 +367,8 @@ TxReceipt = TypedDict(
|
|
|
381
367
|
},
|
|
382
368
|
)
|
|
383
369
|
|
|
370
|
+
BlockReceipts = List[TxReceipt]
|
|
371
|
+
|
|
384
372
|
|
|
385
373
|
class SignedTx(TypedDict, total=False):
|
|
386
374
|
raw: bytes
|
|
@@ -502,6 +490,84 @@ class TxPoolStatus(TypedDict, total=False):
|
|
|
502
490
|
queued: int
|
|
503
491
|
|
|
504
492
|
|
|
493
|
+
#
|
|
494
|
+
# debug types
|
|
495
|
+
#
|
|
496
|
+
class TraceConfig(TypedDict, total=False):
|
|
497
|
+
disableStorage: bool
|
|
498
|
+
disableStack: bool
|
|
499
|
+
enableMemory: bool
|
|
500
|
+
enableReturnData: bool
|
|
501
|
+
tracer: str
|
|
502
|
+
tracerConfig: Dict[str, Any]
|
|
503
|
+
timeout: int
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
class CallTraceLog(TypedDict):
|
|
507
|
+
address: ChecksumAddress
|
|
508
|
+
data: HexBytes
|
|
509
|
+
topics: Sequence[HexBytes]
|
|
510
|
+
position: int
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
# syntax b/c "from" keyword not allowed w/ class construction
|
|
514
|
+
CallTrace = TypedDict(
|
|
515
|
+
"CallTrace",
|
|
516
|
+
{
|
|
517
|
+
"type": str,
|
|
518
|
+
"from": ChecksumAddress,
|
|
519
|
+
"to": ChecksumAddress,
|
|
520
|
+
"value": Wei,
|
|
521
|
+
"gas": int,
|
|
522
|
+
"gasUsed": int,
|
|
523
|
+
"input": HexBytes,
|
|
524
|
+
"output": HexBytes,
|
|
525
|
+
"error": str,
|
|
526
|
+
"revertReason": str,
|
|
527
|
+
"calls": Sequence["CallTrace"],
|
|
528
|
+
"logs": Sequence[CallTraceLog],
|
|
529
|
+
},
|
|
530
|
+
total=False,
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
class TraceData(TypedDict, total=False):
|
|
535
|
+
balance: int
|
|
536
|
+
nonce: int
|
|
537
|
+
code: str
|
|
538
|
+
storage: Dict[str, str]
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
class DiffModeTrace(TypedDict):
|
|
542
|
+
post: Dict[ChecksumAddress, TraceData]
|
|
543
|
+
pre: Dict[ChecksumAddress, TraceData]
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
PrestateTrace = Dict[ChecksumAddress, TraceData]
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
# 4byte tracer returns something like:
|
|
550
|
+
# { '0x27dc297e-128' : 1 }
|
|
551
|
+
# which is: { 4byte signature - calldata size : # of occurrences of key }
|
|
552
|
+
FourByteTrace = Dict[str, int]
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
class StructLog(TypedDict):
|
|
556
|
+
pc: int
|
|
557
|
+
op: str
|
|
558
|
+
gas: int
|
|
559
|
+
gasCost: int
|
|
560
|
+
depth: int
|
|
561
|
+
stack: List[HexStr]
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
class OpcodeTrace(TypedDict, total=False):
|
|
565
|
+
gas: int
|
|
566
|
+
failed: bool
|
|
567
|
+
returnValue: str
|
|
568
|
+
structLogs: List[StructLog]
|
|
569
|
+
|
|
570
|
+
|
|
505
571
|
#
|
|
506
572
|
# web3.geth types
|
|
507
573
|
#
|
|
@@ -516,6 +582,7 @@ class GethWallet(TypedDict):
|
|
|
516
582
|
# Contract types
|
|
517
583
|
|
|
518
584
|
TContractFn = TypeVar("TContractFn", "ContractFunction", "AsyncContractFunction")
|
|
585
|
+
TContractEvent = TypeVar("TContractEvent", "ContractEvent", "AsyncContractEvent")
|
|
519
586
|
|
|
520
587
|
|
|
521
588
|
# Tracing types
|
web3/utils/__init__.py
CHANGED
|
@@ -3,17 +3,76 @@ 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 (
|
|
39
|
+
RequestCacheValidationThreshold,
|
|
15
40
|
SimpleCache,
|
|
16
41
|
)
|
|
17
|
-
from .exception_handling import (
|
|
42
|
+
from .exception_handling import (
|
|
18
43
|
handle_offchain_lookup,
|
|
19
44
|
)
|
|
45
|
+
from .subscriptions import (
|
|
46
|
+
EthSubscription,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
__all__ = [
|
|
50
|
+
"abi_to_signature",
|
|
51
|
+
"collapse_if_tuple",
|
|
52
|
+
"event_abi_to_log_topic",
|
|
53
|
+
"event_signature_to_log_topic",
|
|
54
|
+
"filter_abi_by_name",
|
|
55
|
+
"filter_abi_by_type",
|
|
56
|
+
"function_abi_to_4byte_selector",
|
|
57
|
+
"function_signature_to_4byte_selector",
|
|
58
|
+
"get_abi_input_names",
|
|
59
|
+
"get_abi_input_types",
|
|
60
|
+
"get_abi_output_names",
|
|
61
|
+
"get_abi_output_types",
|
|
62
|
+
"get_aligned_abi_inputs",
|
|
63
|
+
"get_all_event_abis",
|
|
64
|
+
"get_all_function_abis",
|
|
65
|
+
"get_normalized_abi_inputs",
|
|
66
|
+
"check_if_arguments_can_be_encoded",
|
|
67
|
+
"get_abi_element_info",
|
|
68
|
+
"get_abi_element",
|
|
69
|
+
"get_event_abi",
|
|
70
|
+
"get_event_log_topics",
|
|
71
|
+
"log_topic_to_bytes",
|
|
72
|
+
"get_create_address",
|
|
73
|
+
"async_handle_offchain_lookup",
|
|
74
|
+
"RequestCacheValidationThreshold",
|
|
75
|
+
"SimpleCache",
|
|
76
|
+
"EthSubscription",
|
|
77
|
+
"handle_offchain_lookup",
|
|
78
|
+
]
|