Skip to content

x402 payments on base sepolia#158

Merged
adambalogh merged 7 commits intomainfrom
ani/v2-updates
Feb 17, 2026
Merged

x402 payments on base sepolia#158
adambalogh merged 7 commits intomainfrom
ani/v2-updates

Conversation

@adambalogh
Copy link
Collaborator

@adambalogh adambalogh commented Feb 13, 2026

add support for llm inference payments on base sepolia

Copy link
Collaborator Author

@adambalogh adambalogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

🔴 Issues to Fix

1. Version mismatch between pyproject.toml and requirements.txt

  • pyproject.toml has og-test-v2-x402==0.0.5
  • requirements.txt has og-test-v2-x402==0.0.6

Pick one (probably 0.0.6 if that's latest).

2. README references wrong filename

  • Docs say approve_permit2.py but the file is x402_permit2.py

3. Missing trailing newline in requirements.txt


🟡 Suggestions

4. Code duplication in llm.py
make_request() and make_request_v2() share ~80% of their logic. Consider extracting common payload building and response parsing.

5. Hardcoded chain ID
"eip155:84532" appears 4 times — extract to a constant like BASE_SEPOLIA_CHAIN_ID.

6. Private attribute access
client.alpha._wallet_account.address in examples is brittle. Consider exposing a public property.

7. Missing type hint
_parse_sse_response should have -> AsyncGenerator[StreamChunk, None] return type.


✅ What's Good

  • Clean network routing separation
  • Permit2 check fails early with clear error message
  • CLI changes are backwards compatible (defaults to og-evm)
  • Proper async/streaming support for both networks

Overall: functional, but fix the version mismatch and README filename before merging.

@adambalogh adambalogh marked this pull request as ready for review February 17, 2026 09:50
Copy link
Collaborator Author

@adambalogh adambalogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left 1 q

private_key=os.environ.get("OG_PRIVATE_KEY"),
)

check_permit2_approval(client.alpha._wallet_account.address, network)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think this field exists on client.alpha

@adambalogh adambalogh changed the title Ani/v2 updates x402 payments on base sepolia Feb 17, 2026
@adambalogh adambalogh merged commit 22354b4 into main Feb 17, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants