AgentSkillsCN

Bridge Index

Bridge.xyz API所有技能的总览索引。内含技能导航、快速参考指南、功能对比,以及学习路径。适用于:精准查找所需Bridge技能、全面了解各项功能覆盖范围,以及快速上手Bridge API集成。

SKILL.md
--- frontmatter
name: Bridge Index
description: Master index for all Bridge.xyz API skills. Contains skill navigation, quick reference guides, feature comparison, and learning path. Use for: finding the right Bridge skill, understanding feature coverage, and getting started with Bridge API integration.

Bridge.xyz API Skills Index

Skills Overview

SkillDescriptionUse Case
bridge-coreCore client setup, error handling, validationInitial setup and common utilities
bridge-customersCustomer onboarding, KYC, managementUser registration and verification
bridge-walletsCustodial wallets, multi-chain supportTreasury and fund management
bridge-virtual-accountsVirtual USD/EUR/MXN accountsReceiving fiat deposits
bridge-transfersMoney movement, on/off rampsPayment processing
bridge-cardsVisa card provisioningCrypto spending
bridge-external-accountsBank account linkingOfframping to bank accounts
bridge-stablecoinsUSDB management, rewardsStablecoin operations
bridge-feesDeveloper fee configurationMonetization
bridge-webhooksEvent handling, signature verificationReal-time updates
bridge-crypto-return-policiesReturn policy managementFailed transfer handling

Quick Start Path

Path 1: Payments Platform

code
bridge-core → bridge-customers → bridge-wallets → bridge-transfers → bridge-fees

Path 2: Banking Integration

code
bridge-core → bridge-customers → bridge-external-accounts → bridge-transfers

Path 3: Card Issuing

code
bridge-core → bridge-customers → bridge-wallets → bridge-cards → bridge-webhooks

Feature Comparison

FeatureCustomerWalletVirtual AccountTransferCard
Create customers
Create wallets
Manage funds
Receive fiat
Send crypto
Link banks
Issue cards
Configure fees

Common Integration Patterns

Pattern 1: Complete Onramp

code
1. bridge-customers.createKycLink()
2. bridge-wallets.create()
3. bridge-virtual-accounts.create()  [optional]
4. bridge-transfers.create()
5. bridge-webhooks.handle() [listen for completion]

Pattern 2: Complete Offramp

code
1. bridge-customers.createKycLink()
2. bridge-external-accounts.create()
3. bridge-transfers.create()
4. bridge-webhooks.handle() [listen for completion]

Pattern 3: Card Spending

code
1. bridge-customers.createKycLink()
2. bridge-wallets.create()
3. bridge-cards.provision()
4. bridge-transfers.fundCard()
5. bridge-webhooks.handle() [transactions]

Pattern 4: Treasury Management

code
1. bridge-customers.createKycLink() [business]
2. bridge-wallets.create() [multiple chains]
3. bridge-wallets.tagWallet()
4. bridge-transfers.walletToWallet()
5. bridge-fees.updateDefault()

Code Examples

Basic Setup

typescript
import { Bridge } from './bridge-core';

// Initialize client
export const bridge = new Bridge({
  apiKey: process.env.BRIDGE_API_KEY!,
});

Customer Onboarding

typescript
// From bridge-customers
const kycLink = await bridge.customers.createKycLink({
  full_name: 'John Doe',
  email: 'john@example.com',
  type: 'individual',
});
console.log('KYC Link:', kycLink.kyc_link);

Create Wallet

typescript
// From bridge-wallets
const wallet = await bridge.wallets.create(customerId, 'solana');
console.log('Wallet:', wallet.address);

Transfer Funds

typescript
// From bridge-transfers
const transfer = await bridge.transfers.create({
  amount: '100',
  on_behalf_of: customerId,
  source: { payment_rail: 'ach_push', currency: 'usd' },
  destination: { payment_rail: 'solana', currency: 'usdc', to_address: wallet.address },
});

Handle Webhooks

typescript
// From bridge-webhooks
app.post('/webhooks/bridge', express.raw({ type: 'application/json' }), (req, res) => {
  const payload = req.body;
  const signature = req.headers['x-webhook-signature'];
  const isValid = verifyWebhookSignature(payload, signature);
  if (isValid) {
    handleWebhookEvent(JSON.parse(payload.toString()));
  }
  res.status(200).json({ received: true });
});

Error Handling

typescript
// From bridge-core
try {
  const result = await bridge.transfers.create(request);
} catch (error) {
  if (error instanceof BridgeApiError) {
    switch (error.code) {
      case 'required':
        console.error('Missing required field');
      case 'invalid':
        console.error('Invalid value');
    }
  }
}

Environment Setup

bash
# Required environment variables
BRIDGE_API_KEY=your_api_key_here
BRIDGE_WEBHOOK_SECRET=your_webhook_public_key

# Optional
BRIDGE_BASE_URL=https://api.bridge.xyz/v0
BRIDGE_TIMEOUT=30000

Testing Checklist

  • Initialize Bridge client
  • Create test customer with KYC
  • Create test wallet
  • Create virtual account
  • Execute test transfer (sandbox)
  • Set up webhook endpoint
  • Verify webhook signature
  • Handle transfer completed event
  • Configure developer fees
  • Test error scenarios

Resources

Skill Dependencies

code
bridge-core
├── bridge-customers
├── bridge-wallets
├── bridge-virtual-accounts
├── bridge-transfers
├── bridge-cards
├── bridge-external-accounts
├── bridge-stablecoins
├── bridge-fees
├── bridge-webhooks
└── bridge-crypto-return-policies

Best Practices

  1. Start with bridge-core - Always initialize properly
  2. Use TypeScript - Full type safety available
  3. Handle errors gracefully - Use BridgeApiError
  4. Use idempotency keys - Prevent duplicates
  5. Implement webhooks - Better than polling
  6. Validate inputs - Use validation utilities
  7. Rate limit requests - Implement rate limiting
  8. Test in sandbox - Before production
  9. Monitor webhooks - Track all events
  10. Keep API keys secure - Never commit to code