feat(ruby): Add complete Ruby SDK implementation for x402 protocol#1240
Open
mfix-stripe wants to merge 1 commit intocoinbase:mainfrom
Open
feat(ruby): Add complete Ruby SDK implementation for x402 protocol#1240mfix-stripe wants to merge 1 commit intocoinbase:mainfrom
mfix-stripe wants to merge 1 commit intocoinbase:mainfrom
Conversation
Implements a full-featured Ruby SDK with feature parity to the Python SDK, following repository conventions and Ruby idioms. Core Components: - X402::Client - Payment creation with policy system and lifecycle hooks - X402::ResourceServer - Resource protection with verification/settlement - X402::Facilitator - Payment verification and on-chain settlement Blockchain Support: - EVM mechanism (production-ready): - EIP-3009 TransferWithAuthorization for USDC - EIP-712 typed data signing - Networks: Ethereum, Base, Polygon, Avalanche, MegaETH - Private key signer with eth gem - SVM mechanism (simplified): - Solana transaction support - Networks: mainnet, devnet, testnet - Ed25519 signing HTTP Integration: - Faraday-based facilitator client - Rack middleware for universal web framework support - Base64 encoding/decoding utilities - Rails integration ready Type System: - dry-struct + dry-types for runtime validation - Automatic camelCase JSON serialization - Immutable data structures - Protocol-based interfaces using Ruby modules Features: - Policy system (prefer_network, prefer_scheme, max_amount) - Lifecycle hooks (before/after/on_failure) for all operations - Network pattern matching with wildcards (eip155:*) - CAIP-2 network identifier support (V2 protocol) - Graceful degradation for optional dependencies Testing: - Comprehensive unit tests (Client, Server, Facilitator, Schemas) - Integration tests for full payment flow - Mock payment scheme for testing - SimpleCov coverage reporting (80% target) - RSpec configuration with VCR for HTTP fixtures Documentation: - README.md with installation and quick start - CLIENT.md - Complete client implementation guide - SERVER.md - Server setup and middleware integration - FACILITATOR.md - Deployment and operations guide - CONTRIBUTING.md - Development workflow and guidelines - CHANGELOG.md - Version history Examples: - client_basic/ - Basic client with payment creation - server_rack/ - Rack server with payment-protected routes - facilitator/ - Simple facilitator service with Sinatra Build Configuration: - gemspec with core and optional dependencies - Rakefile with test, lint, and doc tasks - Bundler groups for optional features (evm, svm, dev) Dependencies: - Core: dry-struct, dry-types, faraday - Optional EVM: eth (~> 0.5) - Optional SVM: base58, ed25519 - Optional Web: rack, sinatra, rails - Dev: rspec, rubocop, yard, webmock, vcr, simplecov Note: ETH addresses are public USDC contract addresses. Email addresses are public project contact information. GIT_VALID_PII_OVERRIDE Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Committed-By-Agent: claude
🟡 Heimdall Review Status
|
|
@mfix-stripe is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a full-featured Ruby SDK with feature parity to the Python SDK, following repository conventions and Ruby idioms.
Core Components:
Blockchain Support:
HTTP Integration:
Type System:
Features:
Testing:
Documentation:
Examples:
Build Configuration:
Dependencies:
Note: ETH addresses are public USDC contract addresses. Email addresses are public project contact information.
GIT_VALID_PII_OVERRIDE
Committed-By-Agent: claude
Description
Tests
Checklist