import asyncio import os from eth_account import Account from x402 import x402Client from x402.http import x402HTTPClient from x402.http.clients import x402HttpxClient from x402.mechanisms.evm import EthAccountSigner from x402.mechanisms.evm.exact.register import register_exact_evm_client async def main() -> None: client = x402Client() account = Account.from_key(os.environ["EVM_PRIVATE_KEY"]) register_exact_evm_client(client, EthAccountSigner(account)) response_parser = x402HTTPClient(client) async with x402HttpxClient(client) as http: response = await http.post( "https://apiacre.com/v1/research/sec-filing-signals", json={"identifier": "AAPL"}, ) await response.aread() response.raise_for_status() print(response.json()) print( response_parser.get_payment_settle_response( lambda name: response.headers.get(name) ) ) asyncio.run(main())