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
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.ChainDefinition[]
FeeOperationType
Operation types that support thegetFee/getFeeRecipient hooks.
GetSupportedChainsOptions
Options for filtering supported chains.
Usage Examples
getSwapStatus(params)
Fetch the current status of a swap from the Stablecoin Service. Delegates to SwapKit.getSwapStatus. Performs a single HTTP request and returns the service’s snapshot of the swap’s state. For crosschain swaps the status can remain'PENDING' for several minutes while attestation and destination-chain
mint complete; callers are responsible for polling — re-calling this method with
a delay — until progress.status is terminal ('DONE', 'FAILED', or
'NOT_FOUND'). Use AppKit.waitForSwap if you’d rather not write the polling
loop yourself.
GetSwapStatusParams
Parameters for SwapKit.getSwapStatus.
Returns
Promise<SwapStatusResult>
SwapStatusResult
Result of a swap status lookup — a single snapshot of the swap’s state at the time of the call.
Usage Examples
getTokenRates(params)
Fetch cached USD rates for one or more tokens from the Stablecoin Service. Two lookup modes are supported:- Per-chain dump: omit
tokensto retrieve every rate cached forchain. - Targeted lookup: supply
tokens(up to 100) to retrieve a specific set of rates onchain. Each entry may be a registered token symbol (e.g.'USDC','EURC'), the literal'NATIVE', the chain’s native gas symbol (e.g.'ETH'on Ethereum), or a raw EVM address / Solana mint. Unknown strings are rejected with aKitError.
chain accepts any
Blockchain value or ChainDefinition, not just the swap-supported subset. Chains
the cron does not track return an empty rates map.
Response keys preserve the service’s canonical casing: EVM hex addresses are
lowercased, Solana base58 mints are case-preserved. Lowercase EVM addresses
before indexing into result.rates[chain].
Native gas rates: 'NATIVE' (or a chain’s native currency symbol) translates to
the chain’s native sentinel address — 0xEee… for EVM, 1111… for Solana —
before querying the service.
GetTokenRatesParams
Parameters for SwapKit.getTokenRates.
Returns
Promise<GetTokenRatesResponse>
ChainIdentifier
Chain identifier that can be used in transfer parameters and factory functions. This can be either:- A ChainDefinition object
- A Blockchain enum value (e.g., Blockchain.Ethereum)
- A string literal of the blockchain value (e.g., “Ethereum”)
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 step events from bridge, earn, or unified balance operations. Action names are namespaced:bridge., earn., and unifiedBalance.. Use ''
to receive every action.
Handlers receive strongly-typed payloads for the chosen action. Multiple
handlers may be registered for the same action.
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
Returns
Promise<SwapResult>
SwapResult
Result of an executed swap operation. Captures the source-chain execution outcome for a swap transaction.
Usage Example
waitForSwap(params)
Poll the Stablecoin Service until a swap reaches a terminal status ('DONE',
'FAILED', 'NOT_FOUND') or timeoutMs elapses.
Delegates to SwapKit.waitForSwap. Use this after kit.swap() to collapse the
while (status === 'PENDING') polling loop into a single awaitable. Same-chain
swaps return on the first poll because they are already terminal at swap time;
crosschain swaps follow an escalating backoff (3s → 6s → 12s → 24s → 24s) until
the wait budget expires. Timeouts surface as a RETRYABLE KitError so callers
can re-invoke with the same txHash.
WaitForSwapParams
Parameters for SwapKit.waitForSwap.Promise<SwapStatusResult>
SwapStatusResult
Result of a swap status lookup — a single snapshot of the swap’s state at the time of the call.WaitForSwapResultParams
waitForSwap parameter shape that pipes a SwapResult straight through — the
most ergonomic form when you’ve just called SwapKit.swap or SwapKit.executeSwap.
WaitForSwapDiscreteParams
waitForSwap parameter shape for callers that don’t have a SwapResult on hand —
e.g. picking up an in-flight swap from a persisted record or a copy-pasted tx
hash.
Usage Examples
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.
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.
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>
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.
getSupportedChains(token)
Get all chains supported by the unified balance operations.GetSupportedChainsOptions
Options for filtering supported chains.
Returns
ChainDefinition[]
Usage Example
initiateRemoveFund(params)
Initiate a trustless recovery removal from an account. Usespend for normal movement out of a Unified Balance. removeFund is a
recovery path for situations where the normal spend flow is unavailable. Calling
this method starts the 7-day withdrawal delay before the removal can be
completed.
InitiateRemoveFundParams
Parameters for initiating a delayed recovery 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
removeFeeRecipients()
Remove the declarative fee recipient map for the kit.removeFund(params)
Complete a trustless recovery removal after the withdrawal delay. Usespend for normal movement out of a Unified Balance. removeFund is a
recovery path for situations where the normal spend flow is unavailable. Both
EVM and Solana removals require a 7-day withdrawal delay after
initiateRemoveFund before funds can be removed.
RemoveFundParams
Parameters for completing a recovery fund removal after the withdrawal delay.
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
setFeeRecipients(config)
Set a declarative fee recipient map, keyed by chain type. Once set,spend()/estimateSpend() resolve the fee recipient by looking up
the spend’s destination chain type in this map — taking priority over
customFeePolicy’s resolveFeeRecipientAddress callback.
FeeRecipientsConfig
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.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.
Usage Example
Supporting Types
Common
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.
DeveloperFeeHooks
Chains
BaseChainDefinition
Base information that all chain definitions must include.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,
Cronos, Cronos_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
ChainDefinition
Public chain definition type.Currency
Represents basic information about a currency or token.EVMChainDefinition
Represents chain definitions for Ethereum Virtual Machine (EVM) compatible blockchains.KitContractType
Available kit contract types for enhanced chain functionality.NonEVMChainDefinition
Represents chain definitions for non-EVM blockchains.TokenInfo
Represents the metadata associated with a token.Event Actions
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.
AppKitEarnActions
Prefixed earn actions for AppKit. Earn step events are exposed under theearn. namespace (for example
earn.deposit, earn.approve, earn.withdraw) so they can be subscribed to
via kit.on() alongside bridge and unified balance events.
AppKitUnifiedBalanceActions
Prefixed unified balance actions for AppKit. All UnifiedBalanceKit (Gateway) events are prefixed withunifiedBalance. to
namespace them within the AppKit event system.
Bridge
BridgeConfig
Configuration options for customizing bridge behavior.CCTPConfig
Configuration for the Cross-Chain Transfer Protocol (CCTP).CCTPMergedConfig
Merged CCTP contract configuration. Used by chains that deploy a single unified CCTP contract. This simplified architecture is used by newer chain integrations.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.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
Swap
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.
SwapConfig
Configuration options for swap operations. Controls swap behavior including allowance strategy, slippage tolerance, minimum output amounts, custom fees, and kit identification.SwapDestinationLeg
Destination-leg transaction and token information reported by the service. Present on SwapStatusResult once the service reports destination data. Omitted while the destination leg is still in-flight.SwapProgress
Lifecycle snapshot for a swap. Grouped so progress signals live in one place on both SwapResult and SwapStatusResult.SwapSourceLeg
Source-leg transaction and token information reported by the service. Populated on SwapStatusResult from the service’ssendingTxHash. token is
shape-reserved for future service support (the status endpoint does not report
source-token metadata today) so consumers can rely on a symmetric source /
destination layout.
SwapStatus
All possible status values for a swap tracked by the Stablecoin Service.'PENDING' means the swap is still in-flight. Callers should keep calling
SwapKit.getSwapStatus on 'PENDING' until the status becomes terminal (see
SwapTerminalStatus).
SwapTerminalStatus
Terminal status values for a swap tracked by the Stablecoin Service.'DONE' indicates the swap completed (including any crosschain delivery).
'FAILED' indicates the swap failed after on-chain submission. 'NOT_FOUND'
indicates the service has no record of the transaction.
Unified Balance
FeeAllocation
Per-chain breakdown of a fee amount.FeeEntry
A single fee line item within an estimate.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.
SupportedToken
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.
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.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