@asgcard/fund
v1.0.3
Published
Generate ASG Pay payment links for AI agent funding — CLI & programmatic API. Zero dependencies.
Maintainers
Readme
@asgcard/fund
Generate ASG Pay payment links for AI agent funding — CLI & programmatic API
What is this?
A zero-dependency CLI tool and Node.js API that generates payment links for ASG Pay — the universal pay-in gateway for AI agents on Stellar.
Users who open the link can fund your agent's wallet via:
- 💳 Credit/Debit Card (Stripe)
- 🌉 Cross-chain Bridge (ROZO — ETH, SOL, USDC from any EVM chain)
- ⚡ Direct Stellar (Freighter wallet)
Prerequisites (For AI Agents)
To receive funds, your agent needs a Stellar wallet address.
Don't have one? Install the ASG Card agent skill & CLI to generate a secure wallet instantly:
npx @asgcard/cli installQuick Start
npx @asgcard/fund --address GDQP2KPQ... --amount 100Output:
🔗 ASG Pay — Payment Link Generated
─────────────────────────────────────
Agent: Agent
Amount: 100 USDC
To: GDQP2KPQ…YSHWM
https://fund.asgcard.dev/?agentName=Agent&toAddress=GDQP2KPQ...&toAmount=100&toToken=USDC
Share this link with the user to collect payment.
Supports: Credit Card • Bank Transfer • Crypto Bridge • Stellar DirectCLI Options
npx @asgcard/fund \
--address GDQP2KPQ... # Stellar public key (required)
--amount 50 # Amount in USDC (required)
--agent "Trading Bot" # Agent display name
--token USDC # Token: USDC, USDT, XLM, SOL, ETH, BTC, DAI, EURC
--redirect https://... # Redirect URL after payment
--json # Output as JSON (for scripting)
--api # Validate via server API
--help # Show helpProgrammatic API
import { generateFundLink } from '@asgcard/fund';
const { url, params } = await generateFundLink({
agentName: 'Trading Bot',
toAddress: 'GDQP2KPQGKIHIQAEFHQ3XNKFYJVXVSHRQEB37AIR6T3JZWNM7YSHWM',
toAmount: 100,
toToken: 'USDC',
redirectUrl: 'https://myapp.com/callback',
});
console.log(url);
// → https://fund.asgcard.dev/?agentName=Trading+Bot&toAddress=GDQP...&toAmount=100&toToken=USDCOptions
| Option | Type | Required | Default | Description |
|--------|------|----------|---------|-------------|
| toAddress | string | ✅ | — | Stellar public key (G..., 56 chars) |
| toAmount | number | ✅ | 50 | Amount in token units |
| agentName | string | — | "Agent" | Display name shown to payer |
| toToken | string | — | "USDC" | Token to receive |
| redirectUrl | string | — | — | HTTPS redirect after payment |
| useApi | boolean | — | false | Validate via server API |
Server-validated mode
const result = await generateFundLink({
toAddress: 'GDQP...',
toAmount: 100,
useApi: true, // calls fund.asgcard.dev/api/generate-link
});MCP Integration
This package exports an MCP tool schema for AI agent frameworks:
import { mcpToolSchema } from '@asgcard/fund';
// Register as an MCP tool
server.tool(mcpToolSchema.name, mcpToolSchema.inputSchema, async (args) => {
const result = await generateFundLink(args);
return { content: [{ type: 'text', text: result.url }] };
});How It Works
Your Agent → generates URL → User opens link → Pays via card/bridge/stellar → Agent wallet fundedASG Pay handles all payment processing, currency conversion, and Stellar settlement automatically. Your agent just needs to generate the link and share it.
Related Packages
| Package | Description | |---------|-------------| | @asgcard/sdk | Full SDK — create cards, manage wallets | | @asgcard/cli | CLI toolkit — onboarding, MCP install | | @asgcard/mcp-server | MCP server for Claude, Codex, Cursor |
License
MIT
