Welcome to Anypay's WebSocket Tools! This powerful suite enables real-time payment processing and monitoring through a modern WebSocket interface. Built with Rust for maximum performance and reliability, these tools make cryptocurrency payment integration a breeze! π«
anypay-client
π§: A powerful CLI tool for creating and managing invoices, submitting payments, and monitoring payment status in real-timeanypay-server
π₯οΈ: A high-performance WebSocket server that handles payment processing and real-time notifications
- Real-time Updates π: Get instant notifications about payment status changes
- Multi-Currency Support π°: Handle payments in various cryptocurrencies
- Secure Authentication π: Built-in token-based security
- Flexible Integration π: Easy-to-use CLI and WebSocket interfaces
- Automatic Payment Options β‘: Smart payment option generation based on current prices
# Install both client and server binaries
cargo install anypay
# Or install them separately
cargo install anypay-client
cargo install anypay-server
# Clone the repository
git clone https://github.com/anypay/anypay
cd anypay-websockets-rust
# Build the release binaries
cargo build --release
# The binaries will be available in target/release/
Provide your API token either:
- As a command line argument:
--token YOUR_TOKEN
- Via environment variable:
export ANYPAY_TOKEN=YOUR_TOKEN
anypay-client create-invoice \
--amount 100 \
--currency USD \
--webhook https://example.com/webhook \
--redirect https://example.com/return \
--memo "Payment for services"
anypay-client request-payment \
--currency BTC \
--address bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh \
--amount 100 \
--quote-currency USD
anypay-client submit-payment \
--uid inv_123 \
--chain BTC \
--currency BTC \
--txhex 0200000001...
anypay-client get-invoice inv_123
anypay-client cancel-invoice inv_123
anypay-client get-prices
anypay-client monitor inv_123
--json
: Output responses in JSON format--endpoint URL
: Use a custom API endpoint--debug
: Enable debug logging
Configure the server using environment variables:
# Required π
export SUPABASE_URL=your_supabase_url
export SUPABASE_KEY=your_supabase_key
# Optional π§
export PORT=8080 # Default: 8080
export HOST=0.0.0.0 # Default: 0.0.0.0
export LOG_LEVEL=debug # Default: info
# Start the server
anypay-server
# With custom port
anypay-server --port 9000
# With debug logging
anypay-server --debug
- Real-time WebSocket communication π
- Price updates and conversions π±
- Invoice creation and management π
- Payment processing π³
- Event subscriptions π‘
- Automatic payment option generation β‘
- Rust 1.70 or later
- Cargo package manager
# Debug build
cargo build
# Release build
cargo build --release
cargo test
For detailed API documentation, including WebSocket message formats and HTTP endpoints, see API.md.
Start accepting cryptocurrency payments in minutes with Anypay's WebSocket tools. For more information, visit our documentation or contact our support team.
MIT License. See LICENSE for details.
Thank you for choosing Anypay! We look forward to powering your payment solutions. π