Skip to content

ASGCompute/asg-pay-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
ASG Pay

Cross-Chain Payment Gateway for AI Agents

Fund any AI agent from any chain. One URL. Three payment rails.
Fiat β†’ Crypto β†’ Bridge β€” all settling on Stellar.


Live Apache 2.0 Stellar Wormhole


Live Demo Β· Integration Guide Β· Wormhole Bridge Docs Β· Stellar Tutorial Β· Contributing




The Problem

AI agents are becoming autonomous economic participants β€” they purchase APIs, rent compute, pay for storage, and subscribe to SaaS. But funding them is broken:

  • Crypto users need to know the exact chain, token, and address
  • Fiat users have no checkout flow at all
  • Cross-chain users must manually bridge and swap before sending

There is no universal, chain-agnostic way for a human to fund an AI agent.

The Solution

ASG Pay is an open-source checkout page that any AI agent generates with a single URL:

https://fund.asgcard.dev/?agentName=MyBot&toAddress=GDQP...&toAmount=50&toToken=USDC

The user clicks the link, picks any payment method, and the agent's wallet is funded. That's it.


Built with Stellar
Stellar
Wormhole
Wormhole
Stripe
Stripe
Circle USDC
Circle USDC
MasterCard
MasterCard
Source
chains
Ethereum
Ethereum
Solana
Solana
Base
Base
Polygon
Polygon
BSC
BNB Chain
β†’ Stellar
Stellar


Three Payment Rails

Rail How it Works Source Settlement Status
🏦 Bank & Card Stripe Checkout β†’ USDC purchase β†’ Stellar delivery Fiat (Card / Bank) Stellar βœ… Live
🌐 Bridge & Swap Wormhole cross-chain bridge β†’ auto-route β†’ Stellar Ethereum, Solana, Base, Polygon, BSC Stellar βœ… Live
πŸ“€ Direct Send Freighter wallet β†’ sign β†’ Horizon submit Stellar (XLM / USDC) Stellar βœ… Live

All three rails share the same universal URL interface. No matter how the user pays, the agent receives USDC on Stellar.


Wormhole Integration

ASG Pay uses Wormhole as its cross-chain interoperability layer, enabling users on any supported EVM chain to fund AI agents on Stellar in a single transaction.

graph LR
    subgraph Source Chains
        ETH[Ethereum]
        SOL[Solana]
        BASE[Base]
        POLY[Polygon]
        BSC[BNB Chain]
    end

    subgraph Wormhole
        WH["πŸŒ€ Wormhole Bridge<br/>Token Bridge + Connect"]
    end

    subgraph Settlement
        STELLAR["⭐ Stellar Network<br/>USDC Settlement"]
    end

    subgraph Destination
        AGENT["πŸ€– AI Agent Wallet"]
    end

    ETH --> WH
    SOL --> WH
    BASE --> WH
    POLY --> WH
    BSC --> WH
    WH --> STELLAR
    STELLAR --> AGENT

    style WH fill:#7c3aed,stroke:#fff,stroke-width:2px,color:#fff
    style STELLAR fill:#000,stroke:#fff,stroke-width:2px,color:#fff
    style AGENT fill:#22c55e,stroke:#fff,stroke-width:2px,color:#000
Loading

How the Bridge Works

  1. User selects source chain and token (e.g., USDC on Ethereum)
  2. ASG Pay generates a Wormhole transfer via the Token Bridge
  3. User signs in their wallet (MetaMask, Phantom, etc.)
  4. Wormhole bridges the tokens cross-chain to Stellar
  5. Agent receives USDC on their Stellar address

Supported Bridge Paths

From Token To Bridge
Ethereum USDC, USDT, ETH Stellar (USDC) Wormhole Token Bridge
Solana USDC, SOL Stellar (USDC) Wormhole Token Bridge
Base USDC, ETH Stellar (USDC) Wormhole Token Bridge
Polygon USDC, POL Stellar (USDC) Wormhole Token Bridge
BNB Chain USDC, BNB Stellar (USDC) Wormhole Token Bridge

See docs/WORMHOLE_BRIDGE.md for detailed integration documentation.


Quick Start

Use the Hosted Version

https://fund.asgcard.dev/?agentName=MyBot&toAddress=GDQP...&toAmount=100&toToken=USDC

Self-Host

git clone https://github.com/ASGCompute/asg-pay-public.git
cd asg-pay-public
npm install
npm run dev       # β†’ http://localhost:5173

URL Parameters

Parameter Required Default Description
agentName Recommended Stacy agent Display name of the AI agent
toAddress Required Demo address Stellar public key (G...)
toAmount Recommended 50 Amount to fund
toToken No USDC Token to receive (USDC, XLM)
toChain No Stellar Settlement chain

Architecture

graph TB
    Agent["πŸ€– AI Agent"] -->|Generates URL| Portal["ASG Pay Portal"]
    User["πŸ‘€ User"] -->|Opens link| Portal

    Portal --> Selection["Payment Method Selection"]

    Selection --> Fiat["🏦 Bank & Card"]
    Selection --> Bridge["🌐 Bridge & Swap"]
    Selection --> Send["πŸ“€ Direct Send"]

    Fiat -->|"Stripe Checkout"| StripeAPI["Stripe API"]
    StripeAPI -->|"Webhook"| Settlement["Settlement Engine"]
    Settlement -->|"USDC"| AgentWallet["Agent Wallet<br/>(Stellar)"]

    Bridge -->|"Wormhole SDK"| WH["Wormhole<br/>Token Bridge"]
    WH -->|"Cross-chain settle"| AgentWallet

    Send -->|"Freighter Sign"| Horizon["Stellar Horizon"]
    Horizon --> AgentWallet

    style AgentWallet fill:#22c55e,stroke:#fff,stroke-width:2px,color:#000
    style Portal fill:#7c3aed,stroke:#fff,stroke-width:2px,color:#fff
    style WH fill:#6366f1,stroke:#fff,stroke-width:2px,color:#fff
Loading

Tech Stack

Layer Technology
Frontend React 19, TypeScript, Vite 8
Styling Vanilla CSS (glassmorphic design system, 1700+ lines)
Stellar @stellar/stellar-sdk, @stellar/freighter-api
Cross-chain Wormhole Token Bridge, Wormhole Connect
Fiat Stripe Checkout
Hosting Vercel (auto-deploy from main)

Developer Tools

ASG Pay is part of the broader ASG Card ecosystem β€” a suite of open-source tools for AI agent payments:

Package Description Install
ASG Pay Cross-chain funding portal (this repo) git clone / hosted
@asgcard/sdk TypeScript SDK for payment integration npm i @asgcard/sdk
@asgcard/cli CLI for wallet setup + card management npx @asgcard/cli
@asgcard/mcp-server MCP Server (11 tools) for AI agents npx @asgcard/mcp-server

Integration Examples

Python β€” Generate payment link
from urllib.parse import urlencode

def create_funding_url(agent_name: str, address: str, amount: float) -> str:
    params = {
        "agentName": agent_name,
        "toAddress": address,
        "toAmount": str(amount),
        "toToken": "USDC",
    }
    return f"https://fund.asgcard.dev/?{urlencode(params)}"

# Usage
url = create_funding_url("Trading Bot", "GDQP2KPQ...", 100)
print(f"Fund your agent: {url}")
TypeScript β€” Generate payment link
function createFundingUrl(params: {
  agentName: string;
  toAddress: string;
  toAmount: number;
  toToken?: string;
}): string {
  const search = new URLSearchParams({
    agentName: params.agentName,
    toAddress: params.toAddress,
    toAmount: String(params.toAmount),
    toToken: params.toToken || "USDC",
  });
  return `https://fund.asgcard.dev/?${search.toString()}`;
}
MCP Tool β€” Auto-generate via AI agent
# Install the MCP server
npx @asgcard/mcp-server

# The MCP server provides payment URL generation as a built-in tool
# AI agents using Claude, Cursor, or Codex can create funding links automatically
Stellar β€” Monitor incoming payments
import { Horizon } from "@stellar/stellar-sdk";

const server = new Horizon.Server("https://horizon.stellar.org");

server.payments()
  .forAccount("YOUR_AGENT_ADDRESS")
  .cursor("now")
  .stream({
    onmessage: (payment) => {
      if (payment.type === "payment") {
        console.log(`Received ${payment.amount} ${payment.asset_code || "XLM"}`);
      }
    },
  });

Project Structure

src/
β”œβ”€β”€ App.tsx                    # Root: URL params, balance fetching, routing
β”œβ”€β”€ types.ts                   # TypeScript interfaces (AppState, TokenInfo)
β”œβ”€β”€ index.css                  # Design system (1700+ lines, CSS variables)
β”œβ”€β”€ providers.tsx              # React context providers
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ AgentInfoCard.tsx      # Left panel: agent identity, destination, balances
β”‚   β”œβ”€β”€ PaymentSelection.tsx   # Payment method selection (Fiat / Stablecoin / Crypto)
β”‚   β”œβ”€β”€ ExchangeWidget.tsx     # Tabbed widget: Bank & Card / Bridge & Swap / Send
β”‚   β”œβ”€β”€ ReceiveWidget.tsx      # Route selection and bridge confirmation
β”‚   β”œβ”€β”€ Header.tsx             # Page header with wallet status
β”‚   β”œβ”€β”€ ErrorBoundary.tsx      # React error boundary
β”‚   └── modals/
β”‚       β”œβ”€β”€ TokenModal.tsx     # Multi-chain token selector
β”‚       β”œβ”€β”€ SettingsModal.tsx   # Bridge settings (slippage, gas, routes)
β”‚       β”œβ”€β”€ WalletModal.tsx    # Wallet connection (Freighter, MetaMask, Phantom, WC)
β”‚       └── ProgressOverlay.tsx # Tx progress + Wormhole bridge tracking + success state
└── utils/
    └── stellar.ts             # Stellar SDK: build, sign, submit transactions

Wallet Support

Wallet Chains Protocol
Freighter Stellar Native (TESTNET + MAINNET)
MetaMask Ethereum, Base, Polygon, BSC EVM + Wormhole Bridge
Phantom Solana Solana + Wormhole Bridge
WalletConnect Multi-chain QR Code

Security

  • πŸ”’ Destination locked β€” recipient address is pre-filled and immutable
  • πŸ”‘ No private keys β€” all signing happens in the user's wallet extension
  • 🌐 Client-side only β€” no backend stores sensitive data
  • βœ… Open source β€” fully auditable codebase
  • πŸ›‘οΈ CSP headers β€” Content Security Policy enforced via Vercel

Roadmap

Phase Status Description
βœ… Phase 1 Complete Core UI: agent card, payment selection, glassmorphic design system
βœ… Phase 2 Complete Stellar wallet: Freighter integration, real tx signing, Horizon submission
βœ… Phase 3 Complete Fiat on-ramp: Stripe Checkout with fee calculation
βœ… Phase 4 Complete Cross-chain bridge: Wormhole Token Bridge integration
πŸ”§ Phase 5 In Progress Wormhole Connect widget embedding + advanced route optimization
πŸ“‹ Phase 6 Planned Payment API: programmatic checkout sessions + webhook callbacks
πŸ“‹ Phase 7 Planned Soroban: on-chain payment verification smart contract

Contributing

We welcome contributions from the Stellar and Wormhole communities. See CONTRIBUTING.md for guidelines.

Good First Issues

  • Add Wormhole Connect widget to Bridge & Swap tab
  • Implement bridge transaction status polling via Wormhole API
  • Add loading skeletons while Horizon balance data loads
  • Keyboard accessibility for modal overlays

Ecosystem & Collaboration

Stellar
Stellar
Settlement network
Wormhole
Wormhole
Cross-chain bridge
Stripe
Stripe
Fiat on-ramp
Circle
Circle
USDC issuer
MasterCard
MasterCard
Card issuance (via ASG Card)

License

Apache 2.0 β€” Use it, fork it, build on it.


Built with β™₯ by ASG Compute for the Stellar and Wormhole ecosystems.

About

Cross-chain payment gateway for AI agents - Fund any agent from any chain via Wormhole, Stripe, or Stellar. One URL. Three payment rails.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors