最后更新于23天前
实例初始化。通过私钥导入账户并与 Chain 实例绑定。
def __init__(self, chain: Chain, private_key: HexBytes) -> None
from poseidon.evm import Chain, Account from hexbytes import HexBytes # 连接到链 chain = Chain("https://eth-sepolia.g.alchemy.com/v2/YOUR-API-KEY") # 导入账户 private_key = HexBytes("0x...") # 你的私钥 account = Account(chain, private_key) print(f"Account Address: {account.address}")
chain
Chain
EVM 链实例
private_key
HexBytes
账户私钥
eth_account
LocalAccount
eth_account 的 LocalAccount 实例
address
ChecksumAddress
账户地址