Setup
.env:
Code
main.py
Run
Output
What each step does
load_wallet_or_create()— loads your private key from env or~/.xenarch/wallet.json. Creates a new wallet on first run.check_gate(url)— makes an HTTP request to the URL. If the server returns 402, parses the gate details.execute_payment()— approves USDC and callssplit()on the splitter contract. Waits for on-chain confirmation.verify_payment()— submits the tx hash to Xenarch. Returns a time-limited access token.- Content fetch — re-requests the URL with the Bearer token. Server validates locally and returns content.