This commit is contained in:
lz_db
2025-11-16 12:31:03 +08:00
commit 0fab423a18
1451 changed files with 743213 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
from importlib.metadata import (
version as __version,
)
from .abi import (
Decodable,
TypeStr,
)
from .bls import (
BLSPrivateKey,
BLSPubkey,
BLSSignature,
)
from .discovery import (
NodeID,
)
from .encoding import (
HexStr,
Primitives,
)
from .enums import (
ForkName,
)
from .ethpm import (
URI,
ContractName,
Manifest,
)
from .evm import (
Address,
AnyAddress,
BlockIdentifier,
BlockNumber,
ChecksumAddress,
Hash32,
HexAddress,
)
from .networks import (
ChainId,
)
__all__ = (
"Decodable",
"TypeStr",
"BLSPrivateKey",
"BLSPubkey",
"BLSSignature",
"NodeID",
"HexStr",
"Primitives",
"ForkName",
"ChainId",
"URI",
"ContractName",
"Manifest",
"Address",
"AnyAddress",
"BlockIdentifier",
"BlockNumber",
"ChecksumAddress",
"Hash32",
"HexAddress",
)

View File

@@ -0,0 +1,6 @@
from typing import (
Union,
)
TypeStr = str
Decodable = Union[bytes, bytearray]

View File

@@ -0,0 +1,7 @@
from typing import (
NewType,
)
BLSPubkey = NewType("BLSPubkey", bytes) # bytes48
BLSPrivateKey = NewType("BLSPrivateKey", int)
BLSSignature = NewType("BLSSignature", bytes) # bytes96

View File

@@ -0,0 +1,5 @@
from typing import (
NewType,
)
NodeID = NewType("NodeID", bytes)

View File

@@ -0,0 +1,7 @@
from typing import (
NewType,
Union,
)
HexStr = NewType("HexStr", str)
Primitives = Union[bytes, int, bool]

View File

@@ -0,0 +1,17 @@
class ForkName:
Frontier = "Frontier"
Homestead = "Homestead"
EIP150 = "EIP150"
EIP158 = "EIP158"
Byzantium = "Byzantium"
Constantinople = "Constantinople"
Metropolis = "Metropolis"
ConstantinopleFix = "ConstantinopleFix"
Istanbul = "Istanbul"
Berlin = "Berlin"
London = "London"
ArrowGlacier = "ArrowGlacier"
GrayGlacier = "GrayGlacier"
Paris = "Paris"
Shanghai = "Shanghai"
Cancun = "Cancun"

View File

@@ -0,0 +1,9 @@
from typing import (
Any,
Dict,
NewType,
)
ContractName = NewType("ContractName", str)
Manifest = NewType("Manifest", Dict[str, Any])
URI = NewType("URI", str)

View File

@@ -0,0 +1,20 @@
from typing import (
Literal,
NewType,
TypeVar,
Union,
)
from .encoding import (
HexStr,
)
Hash32 = NewType("Hash32", bytes)
BlockNumber = NewType("BlockNumber", int)
BlockParams = Literal["latest", "earliest", "pending", "safe", "finalized"]
BlockIdentifier = Union[BlockParams, BlockNumber, Hash32, HexStr, int]
Address = NewType("Address", bytes)
HexAddress = NewType("HexAddress", HexStr)
ChecksumAddress = NewType("ChecksumAddress", HexAddress)
AnyAddress = TypeVar("AnyAddress", Address, HexAddress, ChecksumAddress)

File diff suppressed because it is too large Load Diff