AppKit Class
TheAppKit is how you’ll perform all stablecoin operations including
crosschain bridging, same-chain swaps, token transfers, and fee estimation. It
also enables you to add event listeners for bridge transfers.
constructor(config?)
Creates a newAppKit instance.
Usage
AppKitConfig
Methods
bridge(params)
Execute a crosschain USDC bridge transfer. Transfers USDC between different blockchain networks using Circle’s Cross-Chain Transfer Protocol (CCTP). Supports both fast and standard transfer speeds with automatic attestation handling.BridgeParams
Parameters for initiating a crosschain USDC bridge transfer. This type is used as the primary input to BridgeKit.bridge, allowing users to specify the source and destination adapters, transfer amount, and optional configuration.- The
fromfield specifies the source adapter context (wallet and chain). - The
tofield specifies the destination, supporting both explicit and derived recipient addresses. - The
configfield allows customization of bridge behavior (e.g., transfer speed). - The
tokenfield is optional and defaults toUSDC; other tokens are not currently supported.
Returns
Promise<BridgeResult>
BridgeResult
Result object returned after a successful crosschain bridge operation. This interface contains all the details about a completed bridge, including the bridge parameters, source and destination information, and the sequence of steps that were executed.
Usage Example
estimateBridge(params)
Estimate the bridge operation. Calculates gas costs, protocol fees, and optional custom fees for a crosschain bridge transfer without executing the transaction. Useful for displaying cost estimates to users before they confirm a transfer.BridgeParams
Parameters for initiating a crosschain USDC bridge transfer. This type is used as the primary input to BridgeKit.bridge, allowing users to specify the source and destination adapters, transfer amount, and optional configuration.- The
fromfield specifies the source adapter context (wallet and chain). - The
tofield specifies the destination, supporting both explicit and derived recipient addresses. - The
configfield allows customization of bridge behavior (e.g., transfer speed). - The
tokenfield is optional and defaults toUSDC; other tokens are not currently supported.
Returns
Promise<EstimateResult>
EstimateResult
Cost estimation result for a crosschain transfer operation. This interface provides detailed information about the expected costs for a transfer, including gas fees on different chains and protocol fees. It also includes the input context (token, amount, source, destination) to provide a complete view of the transfer being estimated.
Usage Example
estimateSend(params)
Estimate network fees for a send operation. Prepare the send (validation + recipient resolution) and returns the gas estimate without executing the actual transaction. This allows developers to show users the cost before committing to the transfer.SendParams
Parameters for sending USDC, USDT, native tokens, or custom ERC-20/SPL tokens. This interface is the canonical input for send operations in App Kit. It supports sending to either a destination Adapter (recipient derives from the adapter’s default account) or an explicit recipientstring address.
- The
fromfield provides the source signing context and chain. - The
tofield identifies the destination as an adapter or an explicit address. - The
amountfield is a human-readable decimal string (for example,'10.5'). - The
tokenfield selects the asset to move and defaults to'USDC'.
Returns
Promise<EstimatedGas>
EstimatedGas
Estimated gas information for a blockchain transaction. This interface provides a unified way to represent gas costs across different blockchain networks, supporting both EVM-style gas calculations and other fee models.estimateSwap(params)
Estimate the output and fees for a swap operation. Calculates the expected output amount, minimum output (with slippage), and fee breakdown for a token swap without executing the transaction.SwapParams
Parameters for initiating a same-chain stablecoin swap. This type is used as the primary input to swap operations, allowing users to specify the source context, input/output tokens, swap amount, and optional configuration. SwapKit supports swaps between stablecoins (USDC, USDT, EURC, USDe, DAI, PYUSD), wrapped tokens (WBTC, WETH, WSOL, WAVAX, WPOL), and native tokens (e.g., ETH on Ethereum, SOL on Solana) via theNATIVE alias.
- The
fromfield specifies the source adapter context (wallet and chain). The chain must be a SwapChain member (or its corresponding string literal) so IDE autocomplete only surfaces swap-supported networks. - The
tokenInfield specifies the input token (see SupportedToken). - The
tokenOutfield specifies the output token (see SupportedToken). - The
amountInfield is a human-readable decimal string (e.g.,10.5). - The
configfield allows customization of swap behavior.
Returns
Promise<SwapEstimate>
SwapEstimate
Estimation result for a swap operation. Contains the provider’s swap quote including minimum output (stop limit), estimated output amount, fee breakdown, and input context fields
Usage Example
getSupportedChains(operationType)
Get chains supported by AppKit operations. Returns blockchain networks that support specific stablecoin operations. When no operation type is specified, returns all chains supporting any operation (bridge, swap, earn, or unified balance).OperationType
Union type of all supported operation types in the AppKit. This type ensures type safety when specifying operation types and enables proper parameter validation based on the selected operation.off(action)
Unregister an event handler for a specific AppKit action. This method removes a previously registered event handler. You must pass the exact same handler function reference that was used during registration. Use the wildcard* to remove handlers listening to all actions.
Usage Example
on(action)
Register an event handler for a specific AppKit action. Subscribe to events emitted during bridge or unified balance operations. Bridge events are prefixed withbridge. and unified balance events with
unifiedBalance. to namespace them within the AppKit event system.
Handlers receive strongly-typed payloads based on the action name. Multiple
handlers can be registered for the same action, and all will be invoked when the
action occurs. Use the wildcard * to listen to all actions.
Usage Example
retryBridge(result)
Retry a failed crosschain USDC bridge transfer. Resume a bridge operation that failed due to a transient error. Use isRetryableError to check whether a failed step’s error is eligible for retry before calling this method.BridgeResult
Result object returned after a successful crosschain bridge operation. This interface contains all the details about a completed bridge, including the bridge parameters, source and destination information, and the sequence of steps that were executed.RetryContext
Context for retry operations containing source and destination adapter contexts. This interface provides the necessary context for retry operations, including both the source adapter context (where the retry originates) and the destination adapter context (where the retry is targeted). This ensures that retry operations have access to both the source and destination chain information needed for validation and execution. The destination adapter (to) is optional to support forwarder-only
destinations where Circle’s Orbit relayer handles the mint transaction without
requiring a destination adapter. When to is undefined, the retry operation
relies on IRIS API confirmation instead of on-chain transaction confirmation.
Returns
Promise<BridgeResult>
BridgeResult
Result object returned after a successful crosschain bridge operation. This interface contains all the details about a completed bridge, including the bridge parameters, source and destination information, and the sequence of steps that were executed.
Usage Example
send(params)
Execute a send operation for known token aliases (USDC, USDT, NATIVE) or custom ERC-20/SPL tokens. For custom tokens, the token address must be provided. This method handles the complete send transfer flow using the underlying AppKit infrastructure. It supports sending to either a destination adapter or an explicit recipient address, with full type safety and comprehensive error handling.SendParams
Parameters for sending USDC, USDT, native tokens, or custom ERC-20/SPL tokens. This interface is the canonical input for send operations in App Kit. It supports sending to either a destination Adapter (recipient derives from the adapter’s default account) or an explicit recipientstring address.
- The
fromfield provides the source signing context and chain. - The
tofield identifies the destination as an adapter or an explicit address. - The
amountfield is a human-readable decimal string (for example,'10.5'). - The
tokenfield selects the asset to move and defaults to'USDC'.
Returns
Promise<BridgeStep>
BridgeStep
A step in the bridge process.
Usage Examples
swap(params)
Execute a same-chain token swap operation. Swaps between USDC, USDT, and native tokens on the same blockchain with configurable slippage tolerance and allowance strategies.SwapParams
Parameters for initiating a same-chain stablecoin swap. This type is used as the primary input to swap operations, allowing users to specify the source context, input/output tokens, swap amount, and optional configuration. SwapKit supports swaps between stablecoins (USDC, USDT, EURC, USDe, DAI, PYUSD), wrapped tokens (WBTC, WETH, WSOL, WAVAX, WPOL), and native tokens (e.g., ETH on Ethereum, SOL on Solana) via theNATIVE alias.
- The
fromfield specifies the source adapter context (wallet and chain). The chain must be a SwapChain member (or its corresponding string literal) so IDE autocomplete only surfaces swap-supported networks. - The
tokenInfield specifies the input token (see SupportedToken). - The
tokenOutfield specifies the output token (see SupportedToken). - The
amountInfield is a human-readable decimal string (e.g.,10.5). - The
configfield allows customization of swap behavior.
Returns
Promise<SwapResult>
SwapResult
Result of an executed swap operation. Captures the outcome of a swap transaction, including input/output tokens, transaction hash, and fee information. This is the high-level result returned to users after a swap operation completes.
Usage Example
kit.unifiedBalance Methods
unifiedBalance is a property on every AppKit instance. Call these methods as
kit.unifiedBalance.methodName().
addDelegate(params)
Grant spending rights to another address on the owner’s account.UpdateDelegateParams
Parameters for adding or removing a delegate on a Gateway account.
Returns
Promise<UpdateDelegateResult>
UpdateDelegateResult
Result returned after a successful add or remove delegate operation.
Usage Example
deposit(params)
Deposit USDC into the caller’s account on a specific chain.DepositParams
Parameters for depositing tokens into the caller’s own Gateway account on a specific chain.
Returns
Promise<DepositResult>
DepositResult
Result returned after a successful deposit operation.
Usage Example
depositFor(params)
Deposit USDC into another account (not the caller’s).DepositForParams
Parameters for depositing tokens into another Gateway account.
Returns
Promise<DepositResult>
DepositResult
Result returned after a successful deposit operation.
Usage Example
estimateSpend(params)
Estimate the fees for a spend operation without executing it.SpendParams
Parameters for spending (minting) USDC on a destination chain from one or more Gateway account sources.Promise<EstimateSpendResult>
EstimateSpendResult
Cost estimation for a spend (mint) operation.
Usage Example
getBalances(params)
Fetch aggregated and per-chain balances for one or more accounts.GetBalancesParams
Parameters for the balances and pending-deposits API requests. Specify thetoken to query and one or more sources identifying the accounts
or adapters whose balances should be retrieved. When includePending is true,
the result includes pending balances and pending transaction details per chain.
Returns
Promise<GetBalancesResult>
GetBalancesResult
Result returned from the provider’sgetBalances method (combined confirmed and
pending).
When includePending is false (default), only totalConfirmedBalance and
breakdown with confirmed fields are returned. When includePending is true,
totalPendingBalance is present and breakdown entries include pending amounts
and pendingTransactions per chain.
Usage Example
getDelegateStatus(params)
Check the finality-aware delegate status of an address.GetDelegateStatusParams
Parameters for checking the delegate status of an address on a Gateway account.
Returns
Promise<DelegateStatus>
Usage Example
getSupportedChains(token)
Get all chains supported by the unified balance operations.GetSupportedChainsOptions
Options for filtering supported chains.
Returns
ChainDefinition[]
Usage Example
initiateRemoveFund(params)
Start a trustless fund removal and its seven-day waiting period.InitiateRemoveFundParams
Parameters for initiating a trustless fund removal from a Gateway account.
Returns
Promise<InitiateRemoveFundResult>
InitiateRemoveFundResult
Result returned after successfully initiating a fund removal.
Usage Example
off(action)
Unregister an event handler for a specific gateway lifecycle action. Removes a previously registered event handler. You must pass the exact same handler function reference that was used during registration.
Usage Example
on(action)
Register an event handler for a specific gateway lifecycle action. Subscribe to events emitted during gateway operations such as deposit, spend, getBalances, etc. Handlers receive strongly-typed payloads based on the action name. Multiple handlers can be registered for the same action, and all will be invoked when the action occurs. Use the wildcard'*' to listen to all actions.
Note: TypeScript autocomplete may only show '*' due to internal type erasure.
The following action names are available at runtime and can be imported as
GatewayActionName from @circle-fin/provider-gateway-v1:
Usage Example
removeCustomFeePolicy()
Remove the custom fee policy for the kit.removeDelegate(params)
Revoke spending rights from a delegate on the owner’s account.UpdateDelegateParams
Parameters for adding or removing a delegate on a Gateway account.
Returns
Promise<UpdateDelegateResult>
UpdateDelegateResult
Result returned after a successful add or remove delegate operation.
Usage Example
removeFund(params)
Complete a trustless fund removal after its seven-day waiting period has passed.RemoveFundParams
Parameters for completing a fund removal after the seven-day waiting period.
Returns
Promise<RemoveFundResult>
RemoveFundResult
Result returned after successfully completing a fund removal.
Usage Example
setCustomFeePolicy(policy)
Set a custom fee policy for spend operations. Once set, every subsequentspend() and estimateSpend() call will include the computed fee unless
overridden by per-call config.customFee.
CustomFeePolicy
spend(params)
Spend (mint) USDC on a destination chain by pulling funds from one or more account sources.SpendParams
Parameters for spending (minting) USDC on a destination chain from one or more Gateway account sources.Promise<SpendResult>
SpendResult
Result returned after a successful spend (mint) operation.
Usage Example
Supporting Types
BridgeConfig
Configuration options for customizing bridge behavior.TransferSpeed
Transfer speed options for crosschain operations. Defines the available speed modes for CCTPv2 transfers, affecting both transfer time and potential fee implications.FAST, SLOW
AdapterContext
Represents the context of an adapter used for crosschain operations. An AdapterContext must always specify both the adapter and the chain explicitly. The address field behavior is determined by the adapter’s address control model:- Developer-controlled adapters: The
addressfield is required because each operation must explicitly specify which address to use. - User-controlled adapters: The
addressfield is forbidden because the address is automatically resolved from the connected wallet or signer. - Legacy adapters: The
addressfield remains optional for backward compatibility.
ChainDefinition
Public chain definition type.EVMChainDefinition
Represents chain definitions for Ethereum Virtual Machine (EVM) compatible blockchains.CCTPConfig
Configuration for the Cross-Chain Transfer Protocol (CCTP).Blockchain
Enumeration of all blockchains known to this library. This enum contains every blockchain that has a chain definition, regardless of whether bridging is currently supported. For chains that support bridging via CCTPv2, see BridgeChain.Algorand, Algorand_Testnet, Aptos, Aptos_Testnet, Arbitrum,
Arbitrum_Sepolia, Arc_Testnet, Avalanche, Avalanche_Fuji, Base,
Base_Sepolia, Celo, Celo_Alfajores_Testnet, Codex, Codex_Testnet,
Edge, Edge_Testnet, Ethereum, Ethereum_Sepolia, Hedera,
Hedera_Testnet, HyperEVM, HyperEVM_Testnet, Injective,
Injective_Testnet, Ink, Ink_Testnet, Linea, Linea_Sepolia, Monad,
Monad_Testnet, Morph, Morph_Testnet, NEAR, NEAR_Testnet, Noble,
Noble_Testnet, Optimism, Optimism_Sepolia, Pharos, Pharos_Testnet,
Plume, Plume_Testnet, Polkadot_Asset_Hub, Polkadot_Westmint, Polygon,
Polygon_Amoy_Testnet, Sei, Sei_Testnet, Solana, Solana_Devnet,
Sonic, Sonic_Testnet, Stellar, Stellar_Testnet, Sui, Sui_Testnet,
Unichain, Unichain_Sepolia, World_Chain, World_Chain_Sepolia, XDC,
XDC_Apothem, ZKSync_Era, ZKSync_Sepolia
KitContractType
Available kit contract types for enhanced chain functionality.Currency
Represents basic information about a currency or token.NonEVMChainDefinition
Represents chain definitions for non-EVM blockchains.SwapConfig
Configuration options for swap operations. Controls swap behavior including allowance strategy, slippage tolerance, minimum output amounts, custom fees, and kit identification.AllowanceStrategy
Allowance strategy for token approvals during swap operations. Defines how token allowances should be granted to the swap contract:permit: Use EIP-2612 permit signature (gas-efficient, no approval transaction)approve: Traditional approval transaction
permit with fallback to approve if permit is not
supported.
FeeOperationType
Operation types that support thegetFee/getFeeRecipient hooks.
AppKitActions
All actions available in AppKit.AppKitBridgeActions
Prefixed bridge actions for AppKit. All BridgeKit events are prefixed withbridge. to namespace them within the
AppKit event system.
AppKitUnifiedBalanceActions
Prefixed unified balance actions for AppKit. All UnifiedBalanceKit (Gateway) events are prefixed withunifiedBalance. to
namespace them within the AppKit event system.
DeveloperFeeHooks
UnifiedBalanceKitConfig
Configuration options for initializing a UnifiedBalanceKit instance. When no providers are specified, the kit uses the default Gateway v1 provider. Any additional providers supplied via config are appended to the defaults.SupportedTokenInput
Case-insensitive variant of SupportedToken for user-facing input. Accepts the canonical uppercase form, fully lowercase, and title-case (e.g.'USDC', 'usdc', 'Usdc'). Arbitrary mixed-case input like 'uSdC' is
handled at runtime by the Zod schema and normalizeToken, so exhaustive
compile-time permutations are unnecessary. Avoiding a recursive
CasePermutations type prevents 2^N type-literal explosion as the token list
grows.
SupportedToken
FeeEntry
A single fee line item within an estimate.FeeAllocation
Per-chain breakdown of a fee amount.FeeType
Fee category describing the origin of a fee line item.'provider': Fee charged by the crosschain provider (e.g. protocol fee).'gasFee': On-chain gas cost denominated in the transfer token (e.g. USDC).'kit': Fee charged by the kit / developer integration.'forwarder': Fee charged by Circle’s Forwarding Service for automatic mint.
NetworkType
Network type for balance queries when the target chain(s) are not explicitly specified. Default is mainnet.BalanceWithPendingBreakdown
Per-account balance breakdown used in GetBalancesResult. WhenincludePending is true, totalPending is present and each chain entry
may include pendingBalance and pendingTransactions.
ChainBalanceBreakdown
Per-chain balance within a breakdown in GetBalancesResult. WhenincludePending is true, pendingBalance and pendingTransactions are
present.
PendingBalanceTransaction
A pending transaction included in GetBalancesResult whenincludePending is
true.
DelegateStatus
The finality-aware status of a delegate on a Gateway account.'none': not a delegate on-chain.'pending': delegate set on-chain but Gateway hasn’t finalized it yet; spend will fail until the status advances to'ready'.'ready': finalized at Gateway; spend will succeed.
AllocationResult
Extends Allocation with the resolved source Gateway account address.UnifiedBalanceChainIdentifier
Type representing valid unified-balance chain identifiers. Constrains chain parameters to only accept chains that support Gateway V1 operations. Accepts:- An UnifiedBalanceChain enum value (e.g.,
UnifiedBalanceChain.Ethereum) - A string literal matching an UnifiedBalanceChain value (e.g.,
'Ethereum') - A ChainDefinition object for a supported chain
UnifiedBalanceChain
Enumeration of blockchains that support Gateway V1 operations (deposit, spend, balance, delegate, removeFund). Derived from the full Blockchain enum but filtered to only include chains with active Gateway V1 contract support. When new chains gain Gateway V1 support, they are added to this enum.Arbitrum, Arbitrum_Sepolia, Arc_Testnet, Avalanche, Avalanche_Fuji,
Base, Base_Sepolia, Ethereum, Ethereum_Sepolia, HyperEVM,
HyperEVM_Testnet, Optimism, Optimism_Sepolia, Polygon,
Polygon_Amoy_Testnet, Sei, Sei_Testnet, Solana, Solana_Devnet,
Sonic, Sonic_Testnet, Unichain, Unichain_Sepolia, World_Chain,
World_Chain_Sepolia
SpendStep
Data payload for a single step in a spend operation.CCTPSplitConfig
Split CCTP contract configuration. Used by chains that deploy separate TokenMessenger and MessageTransmitter contracts. This is the traditional CCTP architecture used by most EVM chains.CCTPMergedConfig
Merged CCTP contract configuration. Used by chains that deploy a single unified CCTP contract. This simplified architecture is used by newer chain integrations.BaseChainDefinition
Base information that all chain definitions must include.TokenInfo
Represents the metadata associated with a token.Event Types
Bridge Events
Bridge events are emitted for each provider in the kit. Events for the built-in CCTP provider follow its transaction steps. You can subscribe to each event multiple times with different callbacks. Bridge events are prefixed withbridge. to namespace them within AppKit:
Usage Example