@circle-fin/app-kit

中文文档
1.21.0发布于 2026/11/06TypeScriptESM + CJS近 30 天下载 3万

A one-stop Circle SDK solution for building stablecoin (e.g. USDC) applications, with bridging, swapping, and more on-chain operations

原始使用文档
文档目录37 节
  1. Table of Contents
  2. Overview
  3. Why App Kit?
  4. Developer Documentation
  5. Architecture Flow
  6. Installation
  7. Adapters
  8. Chain Definitions
  9. Quick Start
  10. 🌉 Cross-Chain Bridge
  11. 🔄 Same-Chain Swap
  12. 📊 Estimate Operations
  13. 🔍 Query Supported Chains
  14. 💰 Unified Balance
  15. 🏦 Earn
  16. Configuration
  17. Send Parameters
  18. Authentication
  19. Swap Parameters
  20. Bridge Parameters
  21. Custom Fees
  22. Operation-Level Custom Fees
  23. Kit-Level Custom Fee Policies
  24. Error Handling
  25. Examples
  26. Basic Cross-Chain Transfer
  27. Same-Chain Token Swap
  28. Send to Different Address
  29. Event Monitoring
  30. API Reference
  31. Core Methods
  32. Development
  33. Building
  34. Testing
  35. Local Development
  36. Community & Support
  37. License

App Kit

npm version TypeScript License Discord

A one-stop Circle SDK for building stablecoin (e.g. USDC) applications, providing a unified set of on-chain tools for bridging, swapping, unified balance management, and other stablecoin operations.

Making cross-chain transfers, same-chain swaps, unified balance management, and token sends as simple as a single function call

Table of Contents

Overview

The App Kit ecosystem is Circle's open-source effort to streamline stablecoin development with SDKs that are easy to use correctly and hard to misuse. Kits are cross-framework (viem, ethers, @solana/web3) and integrate cleanly into any stack. They're opinionated with sensible defaults, but offer escape hatches for full control. A pluggable architecture makes implementation flexible, and all kits are interoperable, so they can be composed to suit a wide range of use cases.

The App Kit provides a unified interface for cross-chain transfers, same-chain swaps, token sends, earn vault operations, and unified balance management. It combines the power of Bridge Kit, Swap Kit, Earn Kit, and Unified Balance Kit into a single, cohesive API with explicit methods for each operation.

Why App Kit?

  • 🎯 Unified interface: Single SDK surface for bridge, swap, send, earn, and unified balance operations
  • 🧭 Explicit operation methods: Choose bridge, swap, send, earn, or unifiedBalance based on the flow you are building
  • ⚡ Zero-config defaults: Built-in reliable RPC endpoints - start building right away
  • 🔧 Bring your own infrastructure: Seamlessly integrate with your existing setup when needed
  • 🔒 Production-ready security: Leverages Circle's CCTPv2 for bridging and trusted swap providers
  • 🚀 Developer experience: Complete TypeScript support, comprehensive validation, and instant connectivity
  • 🌍 Multi-chain support: Bridge across 52 chains with 1300 total bridge routes through Circle's CCTPv2
    • Mainnet (26 chains): Arbitrum, Arc, Avalanche, Base, Codex, Cronos, Edge, Ethereum, HyperEVM, Injective, Ink, Linea, Monad, Morph, OP Mainnet, Pharos, Plasma, Plume, Polygon PoS, Sei, Solana, Sonic, Unichain, World Chain, XDC, X Layer
    • Testnet (26 chains): Arc Testnet, Arbitrum Sepolia, Avalanche Fuji, Base Sepolia, Codex Testnet, Cronos Testnet, Edge Testnet, Ethereum Sepolia, HyperEVM Testnet, Injective Testnet, Ink Testnet, Linea Sepolia, Monad Testnet, Morph Testnet, OP Sepolia, Pharos Atlantic, Plasma Testnet, Plume Testnet, Polygon PoS Amoy, Sei Testnet, Solana Devnet, Sonic Testnet, Unichain Sepolia, World Chain Sepolia, XDC Apothem, X Layer Testnet
  • 🔄 Swap support: Same-chain token swaps powered by Circle's Stablecoin Service
  • 🏦 Earn support: DeFi lending vault deposits, withdrawals, and reward claims via kit.earn
  • 🎯 Flexible adapters: Supporting EVM (Viem, Ethers) and Solana (@solana/web3)
  • 📡 Real-time event monitoring: Track progress throughout the operation lifecycle
  • 🛡️ Robust error handling: Graceful partial success recovery
  • ✈️ Pre-flight validation: Verify operations with cost estimation before execution

Developer Documentation

Architecture Flow

The App Kit follows a composable architecture that integrates Bridge Kit, Swap Kit, Unified Balance Kit, and Earn Kit:

┌──────────────────────────────────────────────────────────────────────────┐
│                                 App Kit                                  │
│                           (Unified Interface)                            │
└───────────────────────────────────┬──────────────────────────────────────┘
                                    │
       ┌────────────────┬───────────┴──────┬──────────────────┐
       │                │                  │                  │
       ▼                ▼                  ▼                  ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│  Bridge Kit  │ │   Swap Kit   │ │ Unified Balance  │ │   Earn Kit   │
│ (Cross-Chain)│ │ (Same-Chain) │ │      Kit         │ │  (Vaults)    │
└──────┬───────┘ └──────┬───────┘ └────────┬─────────┘ └──────┬───────┘
       │                │                  │                  │
       ▼                ▼                  ▼                  ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│   Provider   │ │   Provider   │ │     Provider     │ │   Provider   │
│   (CCTPv2)   │ │  (Service)   │ │   (Gateway v1)   │ │   (Earn)     │
└──────┬───────┘ └──────┬───────┘ └────────┬─────────┘ └──────┬───────┘
       │                │                  │                  │
       └────────────────┴───────────┬──────┴──────────────────┘
                                    │
                                    ▼
                           ┌─────────────────┐
                           │     Adapter     │
                           │  (Blockchain)   │
                           └─────────────────┘
  1. Adapter: Handles blockchain-specific operations (wallets, transactions, gas)
  2. Provider: Implements protocols (CCTPv2 for bridging, Circle Service for swaps, Gateway for unified balance, Earn for vaults)
  3. Bridge/Swap/Unified Balance/Earn Kit: Specialized kits for each operation type
  4. App Kit: Unified orchestration layer providing a consistent API

This separation ensures that each component has a single responsibility while maintaining seamless integration across the entire stablecoin operation lifecycle.

Installation

npm install @circle-fin/app-kit
# or
yarn add @circle-fin/app-kit

Adapters

Choose the appropriate adapter for your target chains:

# For EVM chains (Ethereum, Base, Arbitrum, etc.)
npm install @circle-fin/adapter-viem-v2 viem
# or
yarn add @circle-fin/adapter-viem-v2 viem

# For EVM chains using Ethers.js
npm install @circle-fin/adapter-ethers-v6 ethers
# or
yarn add @circle-fin/adapter-ethers-v6 ethers

# For Solana
npm install @circle-fin/adapter-solana @solana/web3.js
# or
yarn add @circle-fin/adapter-solana @solana/web3.js

Chain Definitions

Import chain definitions directly from the kit:

import { Ethereum, Base, Polygon, Solana } from '@circle-fin/app-kit/chains'

// Use with adapter context
const result = await kit.bridge({
  from: { adapter, chain: Ethereum },
  to: { adapter, chain: Base },
  amount: '10.50',
})

A curated subset of 40 CCTPv2-supported chains is available for import from App Kit.

Quick Start

🌉 Cross-Chain Bridge

Transfer USDC from one chain to another:

import { AppKit } from '@circle-fin/app-kit'
import { createViemAdapterFromPrivateKey } from '@circle-fin/adapter-viem-v2'

// Initialize the kit
const kit = new AppKit()

// Create ONE adapter that works across all chains
const adapter = createViemAdapterFromPrivateKey({
  privateKey: process.env.PRIVATE_KEY as string,
})

// Bridge from Ethereum to Base
const result = await kit.bridge({
  from: { adapter, chain: 'Ethereum' },
  to: { adapter, chain: 'Base' },
  amount: '10.50',
})

🔄 Same-Chain Swap

Swap tokens on the same chain with support for multiple stablecoins:

// Swap USDC to USDT on Ethereum
const result = await kit.swap({
  from: { adapter, chain: 'Ethereum' },
  tokenIn: 'USDC',
  tokenOut: 'USDT',
  amountIn: '100.0',
  config: {
    apiKey: process.env.CIRCLE_API_KEY,
  },
})

// Swap DAI to USDC (18 decimals handled automatically)
const daiSwap = await kit.swap({
  from: { adapter, chain: 'Ethereum' },
  tokenIn: 'DAI',
  tokenOut: 'USDC',
  amountIn: '500.0',
  config: {
    apiKey: process.env.CIRCLE_API_KEY,
  },
})

// Swap native ETH to stablecoin
const nativeSwap = await kit.swap({
  from: { adapter, chain: 'Ethereum' },
  tokenIn: 'NATIVE', // ETH on Ethereum
  tokenOut: 'USDC',
  amountIn: '1.5',
  config: {
    apiKey: process.env.CIRCLE_API_KEY,
  },
})

📊 Estimate Operations

Get cost estimates before executing operations:

// Estimate bridge operation
const bridgeEstimate = await kit.estimateBridge({
  from: { adapter, chain: 'Ethereum' },
  to: { adapter, chain: 'Base' },
  amount: '10.50',
})

// Estimate swap operation
const swapEstimate = await kit.estimateSwap({
  from: { adapter, chain: 'Ethereum' },
  tokenIn: 'USDC',
  tokenOut: 'USDT',
  amountIn: '100.0',
  config: {
    apiKey: process.env.CIRCLE_API_KEY,
  },
})

console.log('Bridge fees:', bridgeEstimate.fees)
console.log(
  'Swap estimated output:',
  swapEstimate.estimatedOutput?.amount,
  swapEstimate.estimatedOutput?.token,
)

🔍 Query Supported Chains

Check which chains support specific operations:

// Get all chains (bridge, swap, earn, borrow, and unified balance)
const allChains = kit.getSupportedChains()

// Get all chains that support bridging
const bridgeChains = kit.getSupportedChains('bridge')

// Get all chains that support swapping
const swapChains = kit.getSupportedChains('swap')

// Get chains that support earn vault operations
const earnChains = kit.getSupportedChains('earn')

// Get chains that support borrow operations
const borrowChains = kit.getSupportedChains('borrow')

// Get chains that support unified balance operations
const ubChains = kit.getSupportedChains('unifiedBalance')

💰 Unified Balance

Manage a unified, cross-chain USDC balance — deposit on any chain, spend on any other, query balances, and manage delegates:

import { AppKit } from '@circle-fin/app-kit'
import { createViemAdapterFromPrivateKey } from '@circle-fin/adapter-viem-v2'

const kit = new AppKit()
const adapter = createViemAdapterFromPrivateKey({
  privateKey: process.env.PRIVATE_KEY as string,
})

// Query balances across all chains
const balances = await kit.unifiedBalance.getBalances({
  token: 'USDC',
  sources: { adapter },
})

// Deposit USDC into unified balance
const deposit = await kit.unifiedBalance.deposit({
  from: { adapter, chain: 'Ethereum' },
  amount: '100',
  token: 'USDC',
})

// Spend from unified balance on a different chain
const spend = await kit.unifiedBalance.spend({
  amount: '50',
  token: 'USDC',
  from: { adapter, allocations: [{ amount: '50', chain: 'Ethereum' }] },
  to: { adapter, chain: 'Base' },
})

// Estimate spend fees before executing
const estimate = await kit.unifiedBalance.estimateSpend({
  amount: '50',
  token: 'USDC',
  from: { adapter, allocations: [{ amount: '50', chain: 'Ethereum' }] },
  to: { adapter, chain: 'Base' },
})

// Manage delegates
await kit.unifiedBalance.addDelegate({
  from: { adapter, chain: 'Ethereum' },
  delegateAddress: '0xDelegate…',
})

// Listen to unified balance events
kit.on('unifiedBalance.gateway.spend.succeeded', (payload) => {
  console.log('Spend succeeded:', payload)
})

For the full Unified Balance API, see the @circle-fin/unified-balance-kit README.

🏦 Earn

Note: Earn Kit is coming soon. The APIs documented here are published for early integration and feedback; vault availability and production readiness will be announced ahead of general availability.

Deposit into and withdraw from DeFi lending vaults, claim rewards, and query positions:

import { AppKit, Blockchain, EarnChain } from '@circle-fin/app-kit'
import { createViemAdapterFromPrivateKey } from '@circle-fin/adapter-viem-v2'

const kit = new AppKit()
const adapter = createViemAdapterFromPrivateKey({
  privateKey: process.env.PRIVATE_KEY as string,
})

// Preview a deposit
const quote = await kit.earn.getDepositQuote({
  from: { adapter, chain: EarnChain.Arc_Testnet },
  vaultAddress: '0xAabbeF1D3971c710276ed41eC791BbE14CdB8E88',
  amount: '100.50',
})

// Execute a same-chain deposit
const depositResult = await kit.earn.deposit({
  from: { adapter, chain: EarnChain.Arc_Testnet },
  vaultAddress: '0xAabbeF1D3971c710276ed41eC791BbE14CdB8E88',
  amount: '100.50',
})

console.log(`Deposit submitted: ${depositResult.txHash}`)

// Execute a cross-chain deposit into an Earn vault
const bridgeDeposit = await kit.earn.deposit({
  from: { adapter, chain: Blockchain.Ethereum_Sepolia },
  to: {
    chain: EarnChain.Arc_Testnet,
    recipientAddress: '0x1234567890123456789012345678901234567890',
  },
  vaultAddress: '0xAabbeF1D3971c710276ed41eC791BbE14CdB8E88',
  amount: '100.50',
})

console.log(`Bridge deposit submitted: ${bridgeDeposit.execId}`)

// Cross-chain Earn deposits currently support Ethereum Sepolia, Arbitrum
// Sepolia, and Base Sepolia as sources, with Arc Testnet as the Earn
// destination.

// Query a vault position
const position = await kit.earn.getPosition({
  from: { adapter, chain: EarnChain.Arc_Testnet },
  vaultAddress: '0xAabbeF1D3971c710276ed41eC791BbE14CdB8E88',
})

// Claim accrued rewards
await kit.earn.claimRewards({
  from: { adapter, chain: EarnChain.Arc_Testnet },
  vaultAddress: '0xAabbeF1D3971c710276ed41eC791BbE14CdB8E88',
})

Same-chain Earn deposits keep the existing transaction result. Cross-chain Earn deposits return bridge submission details such as execId, status, and expiresAt.

For the full Earn API, see the @circle-fin/earn-kit README.

Configuration

Send Parameters

The send() method transfers tokens on the same chain from the source adapter to a recipient address or adapter:

interface SendParams {
  from: AdapterContext // Source wallet and chain
  to: Adapter | string // Destination wallet or address
  amount: string // Amount to transfer (e.g., '10.50')
  token?: TokenAlias | string // Optional, defaults to 'USDC'
}

Token Support

The token field accepts both known aliases and custom token contract addresses:

Known aliases (for send operations):

  • 'USDC' - USD Coin (6 decimals)
  • 'USDT' - Tether USD (6 decimals)
  • 'NATIVE' - Chain's native currency (ETH, SOL, etc.)
  • 'EURC' - Euro Coin, on chains with eurcAddress configured

Custom addresses:

  • EVM contract addresses (e.g., 0x6B175474E89094C44Da98b954EedeAC495271d0F)
  • Solana SPL mint addresses

Note: For swap operations, additional stablecoins and wrapped assets are supported. See Swap Parameters section below.

Examples

// Using USDC (default)
await kit.send({
  from: { adapter, chain: 'Ethereum' },
  to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
  amount: '10.0',
  token: 'USDC',
})

// Using USDT
await kit.send({
  from: { adapter, chain: 'Ethereum' },
  to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
  amount: '100.0',
  token: 'USDT',
})

// Using NATIVE
await kit.send({
  from: { adapter, chain: 'Ethereum' },
  to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
  amount: '1.5',
  token: 'NATIVE', // ETH on Ethereum
})

// Using a custom ERC-20 token address (e.g., DAI)
await kit.send({
  from: { adapter, chain: 'Ethereum' },
  to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
  amount: '50.0',
  token: '0x6B175474E89094C44Da98b954EedeAC495271d0F', // DAI contract address
})

// Using a custom SPL token on Solana
await kit.send({
  from: { adapter, chain: 'Solana' },
  to: 'DhzPkKCLJGHBZbs1AzmK2tRNLZkV8J3yWF3LuWMuKJpN',
  amount: '50.0',
  token: 'So11111111111111111111111111111111111111112', // Wrapped SOL
})

Authentication

Service-backed operations take a Circle API key as config.apiKey. Omit it to use the permissionless (keyless) path.

config: {
  apiKey: process.env.CIRCLE_API_KEY, // <ENV>_API_KEY:<keyId>:<keySecret>
}

The API key is a server-only secret — supplying it from a browser throws. Hold it on your server and forward the prepared transaction to the client.

Migrating from kitKey: config.kitKey is deprecated in favor of config.apiKey. It keeps working, and legacy KIT_KEY:<keyId>:<keySecret> values are still accepted, so you can move over at your own pace. When both fields are set, apiKey wins.

Swap Parameters

For explicit same-chain swaps:

interface SwapParams {
  from: AdapterContext // Source wallet and chain
  tokenIn: SupportedToken // Input token
  tokenOut: SupportedToken // Output token
  amountIn: string // Amount to swap
  to?: string // Optional recipient address
  config?: SwapConfig // Optional swap configuration
}

// SupportedToken includes:
// - Stablecoins (6 decimals): 'USDC', 'EURC', 'USDT', 'PYUSD'
// - Stablecoins (18 decimals): 'DAI', 'USDE'
// - Wrapped assets: 'WBTC', 'WETH', 'WSOL', 'WAVAX', 'WPOL', 'CIRBTC'
// - Native: 'NATIVE' (chain's native currency)

Swap Examples with Different Tokens

// Swap between 6-decimal stablecoins
await kit.swap({
  from: { adapter, chain: 'Ethereum' },
  tokenIn: 'EURC',
  tokenOut: 'USDC',
  amountIn: '100.0',
  config: {
    apiKey: process.env.CIRCLE_API_KEY,
  },
})

// Swap DAI (18 decimals) to USDT
await kit.swap({
  from: { adapter, chain: 'Ethereum' },
  tokenIn: 'DAI',
  tokenOut: 'USDT',
  amountIn: '500.0', // SDK automatically handles 18-decimal precision
  config: {
    apiKey: process.env.CIRCLE_API_KEY,
  },
})

// Swap native token to stablecoin
await kit.swap({
  from: { adapter, chain: 'Ethereum' },
  tokenIn: 'NATIVE', // ETH on Ethereum
  tokenOut: 'USDC',
  amountIn: '2.5',
  config: {
    apiKey: process.env.CIRCLE_API_KEY,
  },
})

Bridge Parameters

For explicit cross-chain bridges:

interface BridgeParams {
  from: AdapterContext // Source wallet and chain
  to: BridgeDestination // Destination wallet/address and chain
  amount: string // Amount to transfer (e.g., '10.50')
  token?: 'USDC' // Optional, defaults to 'USDC'
  config?: BridgeConfig // Optional bridge configuration
}

Custom Fees

App Kit supports custom developer fees on both bridge and swap operations.

Operation-Level Custom Fees

Apply custom fees to individual operations:

// Bridge with custom fee
await kit.bridge({
  from: { adapter, chain: 'Ethereum' },
  to: { adapter, chain: 'Base' },
  amount: '1000',
  config: {
    customFee: {
      value: '10', // 10 USDC fee
      recipientAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0',
    },
  },
})

// Swap with custom fee
await kit.swap({
  from: { adapter, chain: 'Ethereum' },
  tokenIn: 'USDC',
  tokenOut: 'USDT',
  amountIn: '1000',
  config: {
    apiKey: process.env.CIRCLE_API_KEY,
    customFee: {
      value: '10',
      recipientAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0',
    },
  },
})

Kit-Level Custom Fee Policies

For dynamic fee calculation, provide operation-scoped custom fee policies at the App Kit level. Configure only the operations that need custom fees.

import { AppKit } from '@circle-fin/app-kit'

const kit = new AppKit()

kit.setCustomFeePolicy({
  bridge: {
    computeFee: (params) => {
      const amount = Number(params.amount)
      return (amount * 0.01).toFixed(6)
    },
    resolveFeeRecipientAddress: (chain) => {
      return chain.type === 'solana'
        ? 'SolanaAddressBase58...'
        : '0xEvmAddress...'
    },
  },
  swap: {
    computeFee: (params) => {
      const amount = Number(params.amountIn)
      return (amount * 0.005).toFixed(6)
    },
    resolveFeeRecipientAddress: (chain) => {
      return chain.type === 'solana'
        ? 'SolanaAddressBase58...'
        : '0xEvmAddress...'
    },
  },
  unifiedBalance: {
    computeFee: (params) => {
      const amount = Number(params.amount)
      return (amount * 0.01).toFixed(6)
    },
    resolveFeeRecipientAddress: (destinationChain) => {
      return destinationChain.type === 'solana'
        ? 'SolanaAddressBase58...'
        : '0xEvmAddress...'
    },
  },
})

// All subsequent configured operations will use these policies
await kit.bridge({
  from: { adapter, chain: 'Ethereum' },
  to: { adapter, chain: 'Base' },
  amount: '1000', // Custom fee calculated automatically
})

// Remove one operation-scoped policy without affecting the others
kit.removeCustomFeePolicy('bridge')

Error Handling

The kit uses a thoughtful error handling approach:

  • Hard errors (thrown): Validation, configuration, and authentication errors
  • Soft errors (returned): Recoverable issues like insufficient balance or network errors
import { AppKit } from '@circle-fin/app-kit'
import { createViemAdapterFromPrivateKey } from '@circle-fin/adapter-viem-v2'

const kit = new AppKit()
const adapter = createViemAdapterFromPrivateKey({
  privateKey: process.env.PRIVATE_KEY as string,
})

const result = await kit.bridge({
  from: { adapter, chain: 'Ethereum' },
  to: { adapter, chain: 'Base' },
  amount: '100.0',
})

if (result.state === 'success') {
  console.log('Operation successful!')
} else {
  // Handle partial completion with recovery information
  console.log(
    'Successful steps:',
    result.steps.filter((s) => s.state === 'success'),
  )
}

Examples

Basic Cross-Chain Transfer

import { AppKit } from '@circle-fin/app-kit'
import { createViemAdapterFromPrivateKey } from '@circle-fin/adapter-viem-v2'

const kit = new AppKit()
const adapter = createViemAdapterFromPrivateKey({
  privateKey: process.env.PRIVATE_KEY as string,
})

// Bridge USDC from Ethereum to Base
const result = await kit.bridge({
  from: { adapter, chain: 'Ethereum' },
  to: { adapter, chain: 'Base' },
  amount: '50.0',
})

console.log('Bridge result:', result)

Same-Chain Token Swap

// Swap USDC to USDT on Ethereum
const result = await kit.swap({
  from: { adapter, chain: 'Ethereum' },
  tokenIn: 'USDC',
  tokenOut: 'USDT',
  amountIn: '100.0',
  config: {
    apiKey: process.env.CIRCLE_API_KEY,
  },
})

console.log('Swap result:', result)

Send to Different Address

// Send to a different address on the same chain
const result = await kit.send({
  from: { adapter, chain: 'Ethereum' },
  to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
  amount: '10.50',
  token: 'USDC',
})

Event Monitoring

// Listen to bridge events
kit.on('bridge.approve', (payload) => {
  console.log('Approval transaction:', payload.values.txHash)
})

kit.on('bridge.burn', (payload) => {
  console.log('Burn transaction:', payload.values.txHash)
})

// Listen to all events
kit.on('*', (payload) => {
  console.log('Action:', payload.method)
})

// Execute operation
await kit.bridge({
  from: { adapter, chain: 'Ethereum' },
  to: { adapter, chain: 'Base' },
  amount: '10.0',
})

API Reference

Core Methods

  • kit.send(params) - Send tokens to a recipient on the same chain
  • kit.bridge(params) - Execute cross-chain bridge operation
  • kit.retryBridge(result, retryContext) - Retry a failed bridge operation
  • kit.swap(params) - Execute same-chain swap operation
  • kit.estimateBridge(params) - Get cost estimates for bridging
  • kit.estimateSwap(params) - Get cost estimates for swapping
  • kit.estimateSend(params) - Get cost estimates for send operation
  • kit.getSwapStatus(params) - Fetch the current status of a swap
  • kit.waitForSwap(params) - Poll until a swap reaches a terminal status
  • kit.getTokenRates(params) - Fetch cached token USD rates
  • kit.getSupportedChains(operationType?) - Query supported chains by operation type ('bridge', 'swap', 'earn', 'borrow', 'unifiedBalance')
  • kit.setCustomFeePolicy(policy) - Set operation-scoped custom fee policies
  • kit.removeCustomFeePolicy(operation) - Remove an operation-scoped custom fee policy
  • kit.on(event, handler) - Listen to operation events
  • kit.off(event, handler) - Remove event listener
  • kit.unifiedBalance.* - Unified balance operations (deposit, spend, getBalances, estimateSpend, delegates, and more). See the @circle-fin/unified-balance-kit README for the full API.
  • kit.earn.* - Earn vault operations (deposit, withdraw, claimRewards, getVaults, getPosition, and quote helpers). See the @circle-fin/earn-kit README for the full API.

Development

Building

# From the root of the monorepo
nx build @circle-fin/app-kit

Testing

# From the root of the monorepo
nx test @circle-fin/app-kit

Local Development

# Install dependencies
yarn install

# Build all packages
yarn build

# Build the app-kit specifically
nx build @circle-fin/app-kit

# Run tests
nx test @circle-fin/app-kit

Community & Support

License

This project is licensed under the Apache 2.0 License. Contact support for details.


Ready to start building?

Join Discord

Built with ❤️ by Circle

版本与发布记录

@circle-fin/app-kit 共发布 33 个版本,首次发布于 2026/03/18;过去 12 个月发布了 33 个版本。

版本发布日期距今
1.21.0latest2026/11/063 天前
1.20.02026/10/319 天前
1.19.02026/10/2317 天前
1.18.02026/10/2119 天前
1.17.02026/10/1624 天前
1.16.02026/09/301 个月前

关于 @circle-fin/app-kit 的常见问题

@circle-fin/app-kit 是什么?

A one-stop Circle SDK solution for building stablecoin (e.g. USDC) applications, with bridging, swapping, and more on-chain operations

如何安装 @circle-fin/app-kit?

在项目目录运行 npm install @circle-fin/app-kit,或使用 pnpm add / yarn add / bun add。

@circle-fin/app-kit 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@circle-fin/app-kit 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@circle-fin/app-kit 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@circle-fin/app-kit 可以商用吗?

@circle-fin/app-kit 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@circle-fin/app-kit 的下载量有多少?

根据 npm 官方下载统计,@circle-fin/app-kit 在 2026/10/10 – 2026/11/08 这 30 天内被下载 30,163 次,日均约 1,005 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@circle-fin/app-kit 还在维护吗?

最新版本 1.21.0 发布于 2026/11/06(3 天前);至今共发布 33 个版本,其中过去 12 个月发布了 33 个;首次发布于 2026/03/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。