import asyncioimport osfrom eth_account import Accountfrom x402 import x402Clientfrom x402.http.clients import x402HttpxClientfrom x402.mechanisms.evm import EthAccountSignerfrom x402.mechanisms.evm.exact import ExactEvmScheme
async def fetch_korea_alpha() -> None: signer = EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])) client = x402Client() client.register("eip155:8453", ExactEvmScheme(signer))
async with x402HttpxClient(client, timeout=30.0) as session: r = await session.request( "POST", "https://bifrost-x402-production.up.railway.app/v1/kr-macro-pulse", json={"include_yield_curve": True, "fx_pairs": ["USDKRW", "JPYKRW"]}, ) print((await r.aread()).decode("utf-8"))
asyncio.get_event_loop().run_until_complete(fetch_korea_alpha())