Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.arc.network/llms.txt

Use this file to discover all available pages before exploring further.

This reference guide describes the public interfaces, methods, and types available in the App Kit SDK.

AppKit Class

The AppKit 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 new AppKit instance.
constructor(config?: AppKitConfig)
Parameters
NameTypeDescription
configAppKitConfigOptional configuration for fee estimation, developer fees, and the underlying UnifiedBalanceKit.
Usage
import { AppKit } from "@circle-fin/app-kit";

// Minimal — all defaults
const kit = new AppKit();

// With unified balance config
const kitWithUb = new AppKit({
  unifiedBalance: { providers: [myCustomProvider] },
});

AppKitConfig

type AppKitConfig = CreateContextParams & {
  developerFee?: Partial<DeveloperFeeHooks>;
  unifiedBalance?: UnifiedBalanceKitConfig;
};


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.
async bridge(params: BridgeParams<AdapterCapabilities, AdapterCapabilities>): BridgeResult
Parameters
NameTypeDescription
paramsBridgeParamsBridge parameters containing source, destination, amount, and token

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 from field specifies the source adapter context (wallet and chain).
  • The to field specifies the destination, supporting both explicit and derived recipient addresses.
  • The config field allows customization of bridge behavior (e.g., transfer speed).
  • The token field is optional and defaults to USDC; other tokens are not currently supported.
interface BridgeParams {
  amount: string;
  config?: BridgeConfig;
  from: AdapterContext<TFromAdapterCapabilities, BridgeChainIdentifier>;
  invocationMeta?: InvocationMeta;
  to: BridgeDestination<TToAdapterCapabilities, BridgeChainIdentifier>;
  token?: "USDC";
}
Properties
NameTypeDescription
amountstringThe amount to transfer
configBridgeConfigOptional bridge configuration (e.g., transfer speed). If omitted, defaults will be used
fromAdapterContextThe source adapter context (wallet and chain) for the transfer.
invocationMetaInvocationMetaOptional invocation metadata for tracing and correlation.

When provided, the traceId is used to correlate all events emitted during the bridge operation. If not provided, an OpenTelemetry-compatible traceId will be auto-generated.
toBridgeDestinationThe destination for the transfer, supporting explicit or derived recipient addresses
token'USDC'The token to transfer. Defaults to USDC. If omitted, the provider will use USDC by default.
Returns 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.
interface BridgeResult {
  amount: string
  config?: BridgeConfig
  destination: object
  provider: string
  source: object
  state: 'pending' \| 'success' \| 'error'
  steps: BridgeStep[]
  token: 'USDC'
}
Properties
NameTypeDescription
amountstringThe amount that was transferred (as a string to avoid precision issues)
configBridgeConfigThe bridge configuration that was used for this operation
destinationobjectInformation about the destination chain and address
providerstringThe provider that was used for this operation
sourceobjectInformation about the source chain and address
state'pending' | 'success' | 'error'The state of the transfer
stepsBridgeStep[]Array of steps that were executed during the bridge process
token'USDC'The token that was transferred (currently only USDC is supported)
Usage Example
const result = await kit.bridge({
  from: sourceAdapter,
  to: { adapter: destAdapter, chain: "Polygon" },
  amount: "100.50",
  token: "USDC",
});

console.log("Bridge completed:", result.hash);

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.
async estimateBridge(params: BridgeParams<AdapterCapabilities, AdapterCapabilities>): EstimateResult
Parameters
NameTypeDescription
paramsBridgeParamsBridge parameters containing source, destination, amount, and token

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 from field specifies the source adapter context (wallet and chain).
  • The to field specifies the destination, supporting both explicit and derived recipient addresses.
  • The config field allows customization of bridge behavior (e.g., transfer speed).
  • The token field is optional and defaults to USDC; other tokens are not currently supported.
interface BridgeParams {
  amount: string;
  config?: BridgeConfig;
  from: AdapterContext<TFromAdapterCapabilities, BridgeChainIdentifier>;
  invocationMeta?: InvocationMeta;
  to: BridgeDestination<TToAdapterCapabilities, BridgeChainIdentifier>;
  token?: "USDC";
}
Properties
NameTypeDescription
amountstringThe amount to transfer
configBridgeConfigOptional bridge configuration (e.g., transfer speed). If omitted, defaults will be used
fromAdapterContextThe source adapter context (wallet and chain) for the transfer.
invocationMetaInvocationMetaOptional invocation metadata for tracing and correlation.

When provided, the traceId is used to correlate all events emitted during the bridge operation. If not provided, an OpenTelemetry-compatible traceId will be auto-generated.
toBridgeDestinationThe destination for the transfer, supporting explicit or derived recipient addresses
token'USDC'The token to transfer. Defaults to USDC. If omitted, the provider will use USDC by default.
Returns 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.
interface EstimateResult {
  amount: string;
  destination: object;
  fees: object[];
  gasFees: object[];
  source: object;
  token: "USDC";
}
Properties
NameTypeDescription
amountstringThe amount being transferred
destinationobjectInformation about the destination chain and address
feesobject[]Array of protocol and service fees for the transfer
gasFeesobject[]Array of gas fees required for the transfer on different blockchains
sourceobjectInformation about the source chain and address
token'USDC'The token being transferred
Usage Example
const estimate = await kit.estimateBridge({
  from: sourceAdapter,
  to: { adapter: destAdapter, chain: "Polygon" },
  amount: "100.50",
  token: "USDC",
});

console.log("Estimated fee:", estimate.fee);

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.
async estimateSend(params: SendParams): EstimatedGas
Parameters
NameTypeDescription
paramsSendParamsSend parameters: source, destination (address or adapter), amount, token.

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 recipient string address.
  • The from field provides the source signing context and chain.
  • The to field identifies the destination as an adapter or an explicit address.
  • The amount field is a human-readable decimal string (for example, '10.5').
  • The token field selects the asset to move and defaults to 'USDC'.
interface SendParams {
  amount: string
  from: AdapterContext
  to: string \| Adapter<AdapterCapabilities>
  token?: TokenAlias \| TokenAddress
}
Properties
NameTypeDescription
amountstringThe amount to transfer.
fromAdapterContextThe source adapter context (wallet and chain) for the transfer.
tostring | AdapterThe destination for the transfer, supporting explicit or derived recipient addresses.
tokenTokenAlias | TokenAddressThe token to transfer. Defaults to USDC. If omitted, the provider will use USDC by default.

Supports both known aliases and custom token contract addresses:
- Known aliases: USDC, USDT, NATIVE
- Custom token addresses: EVM addresses or Solana SPL token mint addresses
Returns 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.
interface EstimatedGas {
  fee: string;
  gas: bigint;
  gasPrice: bigint;
}
Usage Examples
const estimate = await kit.estimateSend({
  from: { adapter: sourceAdapter, chain: "Ethereum" },
  to: recipientAdapter,
  amount: "100.50",
  token: "USDC",
});

console.log("Estimated gas:", estimate.gas);
const estimate = await kit.estimateSend({
  from: { adapter: sourceAdapter, chain: "Ethereum" },
  to: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
  amount: "50.0",
  token: "USDT",
});

console.log("Estimated gas:", estimate.gas);

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.
async estimateSwap(params: SwapParams<AdapterCapabilities>): SwapEstimate
Parameters
NameTypeDescription
paramsSwapParamsSwap parameters containing source, tokens, amount, and config

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 the NATIVE alias.
  • The from field 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 tokenIn field specifies the input token (see SupportedToken).
  • The tokenOut field specifies the output token (see SupportedToken).
  • The amountIn field is a human-readable decimal string (e.g., 10.5).
  • The config field allows customization of swap behavior.
interface SwapParams {
  amountIn: string
  config?: SwapConfig
  from: SwapAdapterContext<TFromAdapterCapabilities>
  tokenIn: infer<any>
  tokenOut: infer<any>
}
Properties
NameTypeDescription
amountInstringThe amount of the input token to swap.

Expressed as a human-readable decimal string in token units (e.g., '0.05' for 0.05 USDC or 0.05 ETH).
configSwapConfigOptional configuration for swap behavior.

If omitted, defaults will be used:
- allowanceStrategy: permit (fallback to approve)
- slippageBps: 300 (3%)
fromSwapAdapterContextThe source adapter context (wallet and chain) for the swap.
tokenIninferThe input token to swap from.

Supports stablecoins (USDC, USDT, EURC, USDe, DAI, PYUSD), wrapped tokens (WBTC, WETH, WSOL, WAVAX, WPOL), and native tokens (NATIVE or chain-specific symbols).
tokenOutinferThe output token to swap to.

Supports stablecoins (USDC, USDT, EURC, USDe, DAI, PYUSD), wrapped tokens (WBTC, WETH, WSOL, WAVAX, WPOL), and native tokens (NATIVE or chain-specific symbols).
Returns 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
interface SwapEstimate {
  amountIn: string
  chain: Blockchain
  estimatedOutput: TokenAmount
  fees?: any
  fromAddress: string
  stopLimit: TokenAmount
  toAddress: string
  tokenIn: infer<any>
  tokenOut: infer<any>
}
Properties
NameTypeDescription
amountInstringThe input amount that will be swapped.

Expressed as a human-readable decimal string in token units (e.g., '0.05' for 0.05 USDC or 0.05 ETH).
chainBlockchainThe chain where the swap will be executed.

Returns the chain name (e.g., Blockchain.Ethereum) Use getChainByEnum(chain) to resolve back to a full ChainDefinition if needed.
estimatedOutputTokenAmountEstimated output amount with token information.
feesanyDetailed fee breakdown for the swap operation.
fromAddressstringThe address that will initiate the swap.
stopLimitTokenAmountEstimated minimum token out amount with token information.

This represents the minimum amount of tokens the user should receive after accounting for slippage. Amount is in human-readable decimal format.
toAddressstringThe address that will receive the swapped tokens.
tokenIninferThe input token that will be swapped from.
tokenOutinferThe output token that will be swapped to.
Usage Example
const estimate = await kit.estimateSwap({
  from: { adapter, chain: "Ethereum" },
  tokenIn: "USDC",
  tokenOut: "USDT",
  amountIn: "100.50",
  config: {
    slippageBps: 300,
    kitKey: "KIT_KEY:id:secret",
  },
});

console.log("Stop limit:", estimate.stopLimit.amount, estimate.stopLimit.token);
console.log(
  "Estimated output:",
  estimate.estimatedOutput.amount,
  estimate.estimatedOutput.token,
);
console.log("Fees:", estimate.fees);

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, or unified balance).
getSupportedChains(operationType: OperationType): ChainDefinition[]
Parameters
NameTypeDescription
operationTypeOperationTypeOptional operation type to filter chains (bridge | swap | unifiedBalance)

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.
type OperationType = FeeOperationType | "unifiedBalance";
Returns ChainDefinition[] Usage Examples
import { AppKit } from "@circle-fin/app-kit";

const kit = new AppKit();
const allChains = kit.getSupportedChains();

console.log(`Total supported chains: ${allChains.length}`);
allChains.forEach((chain) => {
  console.log(`- ${chain.name} (${chain.type})`);
});
const kit = new AppKit();
const bridgeChains = kit.getSupportedChains("bridge");

console.log(
  "Chains supporting bridge:",
  bridgeChains.map((c) => c.name),
);

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.
off(action: K, handler: (payload: any) => void): void
Parameters
NameTypeDescription
actionKThe namespaced action name or * for all actions
handler(payload: any) => voidThe handler function to remove (must be the same reference)
Usage Example
import { AppKit } from "@circle-fin/app-kit";

const kit = new AppKit();

// Define handler
const handler = (payload) => {
  console.log("Approval:", payload);
};

// Register
kit.on("bridge.approve", handler);

// Later, unregister
kit.off("bridge.approve", handler);

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 with bridge. 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.
on(action: K, handler: (payload: any) => void): void
Parameters
NameTypeDescription
actionKThe namespaced action name or * for all actions
handler(payload: any) => voidCallback function to invoke when the action occurs
Usage Example
import { AppKit } from "@circle-fin/app-kit";

const kit = new AppKit();

// Listen to specific bridge action
kit.on("bridge.approve", (payload) => {
  console.log("Approval transaction:", payload.values.txHash);
});

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

// Listen to all actions
kit.on("*", (payload) => {
  console.log("Action:", payload);
});

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.
async retryBridge(result: BridgeResult, retryContext: RetryContext<AdapterCapabilities, AdapterCapabilities>): BridgeResult
Parameters
NameTypeDescription
resultBridgeResultThe bridge result from the failed operation
retryContextRetryContextThe retry context with source and optional destination adapters

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.
interface BridgeResult {
  amount: string
  config?: BridgeConfig
  destination: object
  provider: string
  source: object
  state: 'pending' \| 'success' \| 'error'
  steps: BridgeStep[]
  token: 'USDC'
}
Properties
NameTypeDescription
amountstringThe amount that was transferred (as a string to avoid precision issues)
configBridgeConfigThe bridge configuration that was used for this operation
destinationobjectInformation about the destination chain and address
providerstringThe provider that was used for this operation
sourceobjectInformation about the source chain and address
state'pending' | 'success' | 'error'The state of the transfer
stepsBridgeStep[]Array of steps that were executed during the bridge process
token'USDC'The token that was transferred (currently only USDC is supported)

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.
interface RetryContext {
  from: Adapter<TFromAdapterCapabilities>;
  to?: Adapter<TToAdapterCapabilities>;
}
Properties
NameTypeDescription
fromAdapterThe source adapter context for the retry operation
toAdapterThe destination adapter context for the retry operation.

Optional for forwarder-only destinations where Circle’s Orbit relayer handles the mint transaction. When undefined, the retry operation relies on IRIS API confirmation (forwardState === 'CONFIRMED') instead of on-chain transaction confirmation via the adapter.
Returns 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.
interface BridgeResult {
  amount: string
  config?: BridgeConfig
  destination: object
  provider: string
  source: object
  state: 'pending' \| 'success' \| 'error'
  steps: BridgeStep[]
  token: 'USDC'
}
Properties
NameTypeDescription
amountstringThe amount that was transferred (as a string to avoid precision issues)
configBridgeConfigThe bridge configuration that was used for this operation
destinationobjectInformation about the destination chain and address
providerstringThe provider that was used for this operation
sourceobjectInformation about the source chain and address
state'pending' | 'success' | 'error'The state of the transfer
stepsBridgeStep[]Array of steps that were executed during the bridge process
token'USDC'The token that was transferred (currently only USDC is supported)
Usage Example
import { AppKit, isRetryableError } from "@circle-fin/app-kit";

const kit = new AppKit();

const result = await kit.bridge({
  from: sourceAdapter,
  to: { adapter: destAdapter, chain: "Polygon" },
  amount: "100.50",
});

const failedStep = result.steps.find((s) => s.error);
if (
  result.state === "error" &&
  failedStep?.error &&
  isRetryableError(failedStep.error)
) {
  const retried = await kit.retryBridge(result, {
    from: sourceAdapter,
    to: destAdapter,
  });
  console.log("Retry result:", retried.state);
}

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.
async send(params: SendParams): BridgeStep
Parameters
NameTypeDescription
paramsSendParamsSend parameters containing source, destination, amount, and token

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 recipient string address.
  • The from field provides the source signing context and chain.
  • The to field identifies the destination as an adapter or an explicit address.
  • The amount field is a human-readable decimal string (for example, '10.5').
  • The token field selects the asset to move and defaults to 'USDC'.
interface SendParams {
  amount: string
  from: AdapterContext
  to: string \| Adapter<AdapterCapabilities>
  token?: TokenAlias \| TokenAddress
}
Properties
NameTypeDescription
amountstringThe amount to transfer.
fromAdapterContextThe source adapter context (wallet and chain) for the transfer.
tostring | AdapterThe destination for the transfer, supporting explicit or derived recipient addresses.
tokenTokenAlias | TokenAddressThe token to transfer. Defaults to USDC. If omitted, the provider will use USDC by default.

Supports both known aliases and custom token contract addresses:
- Known aliases: USDC, USDT, NATIVE
- Custom token addresses: EVM addresses or Solana SPL token mint addresses
Returns BridgeStep

BridgeStep

A step in the bridge process.
interface BridgeStep {
  batched?: boolean
  batchId?: string
  data?: unknown
  error?: unknown
  errorMessage?: string
  explorerUrl?: string
  forwarded?: boolean
  name: string
  state: 'pending' \| 'success' \| 'error' \| 'noop'
  txHash?: string
}
Properties
NameTypeDescription
batchedbooleanWhether this step was executed as part of an EIP-5792 batched wallet_sendCalls request.

- true: The step was included in a batched call bundle
- undefined: The step was executed individually (sequential flow)
batchIdstringThe wallet-assigned batch identifier from wallet_sendCalls.

Present only when batched is true. Can be used with wallet_getCallsStatus to query the status of the entire bundle.
dataunknownOptional data for the step
errorunknownOptional raw error object (can be Viem/Ethers/Chain error)
errorMessagestringOptional human-readable error message
explorerUrlstringOptional explorer URL for viewing this transaction on a block explorer
forwardedbooleanWhether this step was executed via Circle’s Forwarder (relay service). Only applicable for mint steps.

- true: The mint was handled by Circle’s Orbit relayer
- false: The user submitted the mint transaction directly
- undefined: Not applicable (non-mint steps)
namestringHuman-readable name of the step (e.g., “Approve”, “Burn”, “Mint”)
state'pending' | 'success' | 'error' | 'noop'The state of the step
txHashstringOptional transaction hash for this step (if applicable)
Usage Examples
// Send USDC to a recipient adapter (same chain)
const result = await kit.send({
  from: { adapter: sourceAdapter, chain: "Ethereum" },
  to: recipientAdapter,
  amount: "100.50",
  token: "USDC",
});

console.log("Send completed:", result.txHash);
// Send a custom token to an explicit address
const result = await kit.send({
  from: { adapter: sourceAdapter, chain: "Ethereum" },
  to: "0x742d35Cc4634C0532925a3b8D1d7",
  amount: "100.50",
  token: "0x6B175474E89094C44Da98b954EedeAC495271d0F", // DAI on Ethereum
});
console.log("Send completed:", result.txHash);
// Send USDT to an explicit address
const result = await kit.send({
  from: { adapter: sourceAdapter, chain: "Ethereum" },
  to: "0x742d35Cc4634C0532925a3b8D1d7",
  amount: "50.25",
  token: "USDT",
});

console.log("Send completed:", result.txHash);

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.
async swap(params: SwapParams<AdapterCapabilities>): SwapResult
Parameters
NameTypeDescription
paramsSwapParamsSwap parameters containing source, tokens, amount, and config

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 the NATIVE alias.
  • The from field 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 tokenIn field specifies the input token (see SupportedToken).
  • The tokenOut field specifies the output token (see SupportedToken).
  • The amountIn field is a human-readable decimal string (e.g., 10.5).
  • The config field allows customization of swap behavior.
interface SwapParams {
  amountIn: string
  config?: SwapConfig
  from: SwapAdapterContext<TFromAdapterCapabilities>
  tokenIn: infer<any>
  tokenOut: infer<any>
}
Properties
NameTypeDescription
amountInstringThe amount of the input token to swap.

Expressed as a human-readable decimal string in token units (e.g., '0.05' for 0.05 USDC or 0.05 ETH).
configSwapConfigOptional configuration for swap behavior.

If omitted, defaults will be used:
- allowanceStrategy: permit (fallback to approve)
- slippageBps: 300 (3%)
fromSwapAdapterContextThe source adapter context (wallet and chain) for the swap.
tokenIninferThe input token to swap from.

Supports stablecoins (USDC, USDT, EURC, USDe, DAI, PYUSD), wrapped tokens (WBTC, WETH, WSOL, WAVAX, WPOL), and native tokens (NATIVE or chain-specific symbols).
tokenOutinferThe output token to swap to.

Supports stablecoins (USDC, USDT, EURC, USDe, DAI, PYUSD), wrapped tokens (WBTC, WETH, WSOL, WAVAX, WPOL), and native tokens (NATIVE or chain-specific symbols).
Returns 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.
interface SwapResult {
  amountIn: string
  amountOut?: string
  chain: Blockchain
  config?: SwapResultConfig
  explorerUrl?: string
  fees?: any
  fromAddress: string
  toAddress: string
  tokenIn: infer<any>
  tokenOut: infer<any>
  txHash: string
}
Properties
NameTypeDescription
amountInstringThe input amount that was swapped.

Expressed as a human-readable decimal string in token units (e.g., '0.05' for 0.05 USDC or 0.05 ETH).
amountOutstringThe actual output amount received from the completed swap.

Expressed as a human-readable decimal string in output token units. Populated via a best-effort LI.FI status lookup after the on-chain transaction confirms. May be undefined if the lookup fails or the chain type is unsupported.
chainBlockchainThe chain where the swap was executed.

Returns the chain name (e.g., Blockchain.Ethereum) Use getChainByEnum(chain) to resolve back to a full ChainDefinition if needed.
configSwapResultConfigThe swap configuration that was used for this operation.
explorerUrlstringThe formatted explorer URL for viewing this transaction on a block explorer.

Only present when txHash is non-empty.
feesanyDetailed fee breakdown for the swap operation.

Includes both provider fees (charged by the DEX aggregator/protocol) and kit fees (if configured).
fromAddressstringThe address that initiated the swap.
toAddressstringThe address that received the swapped tokens.
tokenIninferThe input token that was swapped from.
tokenOutinferThe output token that was swapped to.
txHashstringThe transaction hash for the executed swap.

Available once the transaction has been submitted to the network.
Usage Example
const result = await kit.swap({
  from: { adapter, chain: "Ethereum" },
  tokenIn: "USDC",
  tokenOut: "USDT",
  amountIn: "100.50",
  config: {
    slippageBps: 300, // 3% slippage
    allowanceStrategy: "permit",
    kitKey: "KIT_KEY:id:secret",
  },
});

console.log("Swap completed:", result.txHash);

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.
async addDelegate(params: UpdateDelegateParams<AdapterCapabilities, UnifiedBalanceChainIdentifier>): UpdateDelegateResult
Parameters
NameTypeDescription
paramsUpdateDelegateParamsThe owner’s adapter context and the delegate address.

UpdateDelegateParams

Parameters for adding or removing a delegate on a Gateway account.
interface UpdateDelegateParams {
  delegateAddress: string;
  from: AdapterContext<TAdapterCapabilities, TChainIdentifier>;
  token?: SupportedTokenInput;
}
Properties
NameTypeDescription
delegateAddressstringThe address being added or removed as an authorized delegate.
fromAdapterContextThe owner’s adapter context identifying the account and chain to which the delegate will be authorized.
tokenSupportedTokenInputThe token for which delegation applies. Accepts any case (e.g. 'usdc', 'Usdc'); normalised to uppercase internally.
Returns UpdateDelegateResult

UpdateDelegateResult

Result returned after a successful add or remove delegate operation.
interface UpdateDelegateResult {
  account: string
  chain: Blockchain
  delegateAddress: string
  explorerUrl?: string
  state: 'added' \| 'removed'
  txHash: string
}
Properties
NameTypeDescription
accountstringThe Gateway account that was modified.
chainBlockchainThe chain on which the delegate was updated.
delegateAddressstringThe delegate address that was added or removed.
explorerUrlstringLink to view the transaction details on the appropriate blockchain explorer.
state'added' | 'removed'Whether the delegate was added or removed.
txHashstringUnique identifier returned by the blockchain once the transaction is mined.
Usage Example
const result = await kit.unifiedBalance.addDelegate({
  adapter,
  chain: "Ethereum",
  delegate: "0xDelegate…",
});

deposit(params)

Deposit USDC into the caller’s account on a specific chain.
async deposit(params: DepositParams<AdapterCapabilities, UnifiedBalanceChainIdentifier>): DepositResult
Parameters
NameTypeDescription
paramsDepositParamsDeposit details including the depositor context and amount.

DepositParams

Parameters for depositing tokens into the caller’s own Gateway account on a specific chain.
interface DepositParams {
  allowanceStrategy?: AllowanceStrategy;
  amount: string;
  from: AdapterContext<TAdapterCapabilities, TChainIdentifier>;
  token?: SupportedTokenInput;
}
Properties
NameTypeDescription
allowanceStrategyAllowanceStrategyThe token allowance strategy to authorize the deposit.
amountstringThe amount of tokens to deposit (human-readable decimal string).
fromAdapterContextThe adapter context identifying the depositor and chain.
tokenSupportedTokenInputThe token to deposit. Accepts any case (e.g. 'usdc', 'Usdc'); normalised to uppercase internally.
Returns DepositResult

DepositResult

Result returned after a successful deposit operation.
interface DepositResult {
  amount: string;
  chain: Blockchain;
  depositedBy: string;
  depositedTo: string;
  explorerUrl?: string;
  token: "USDC";
  txHash: string;
}
Properties
NameTypeDescription
amountstringThe deposited amount (human-readable decimal string).
chainBlockchainThe chain on which the deposit occurred.
depositedBystringThe address that signed and funded the deposit.
depositedTostringThe Gateway account address credited by the deposit.
explorerUrlstringLink to view the transaction details on the appropriate blockchain explorer.
token'USDC'The token that was deposited.
txHashstringUnique identifier returned by the blockchain once the transaction is mined.
Usage Example
const result = await kit.unifiedBalance.deposit({
  from: { adapter, chain: "Ethereum" },
  amount: "100",
  token: "USDC",
});

depositFor(params)

Deposit USDC into another account (not the caller’s).
async depositFor(params: DepositForParams<AdapterCapabilities, UnifiedBalanceChainIdentifier>): DepositResult
Parameters
NameTypeDescription
paramsDepositForParamsDeposit details including the depositor context, amount, and the account address to credit.

DepositForParams

Parameters for depositing tokens into another Gateway account.
interface DepositForParams {
  amount: string;
  depositAccount: string;
  from: AdapterContext<TAdapterCapabilities, TChainIdentifier>;
  token?: SupportedTokenInput;
}
Properties
NameTypeDescription
amountstringThe amount of tokens to deposit (human-readable decimal string).
depositAccountstringThe Gateway account address to credit with the deposit.

When provided the deposit is credited to this account rather than the caller’s own.
fromAdapterContextThe adapter context identifying the depositor and chain.
tokenSupportedTokenInputThe token to deposit. Accepts any case (e.g. 'usdc', 'Usdc'); normalised to uppercase internally.
Returns DepositResult

DepositResult

Result returned after a successful deposit operation.
interface DepositResult {
  amount: string;
  chain: Blockchain;
  depositedBy: string;
  depositedTo: string;
  explorerUrl?: string;
  token: "USDC";
  txHash: string;
}
Properties
NameTypeDescription
amountstringThe deposited amount (human-readable decimal string).
chainBlockchainThe chain on which the deposit occurred.
depositedBystringThe address that signed and funded the deposit.
depositedTostringThe Gateway account address credited by the deposit.
explorerUrlstringLink to view the transaction details on the appropriate blockchain explorer.
token'USDC'The token that was deposited.
txHashstringUnique identifier returned by the blockchain once the transaction is mined.
Usage Example
const result = await kit.unifiedBalance.depositFor({
  from: { adapter, chain: "Ethereum" },
  amount: "50",
  depositAccount: "0x742d35Cc6634C0532925a3b844D97D35e2B60E53",
});

estimateSpend(params)

Estimate the fees for a spend operation without executing it.
async estimateSpend(params: SpendParams): EstimateSpendResult
Parameters
NameTypeDescription
paramsSpendParamsThe same spend parameters used in AppKitUnifiedBalance.spend.

SpendParams

Parameters for spending (minting) USDC on a destination chain from one or more Gateway account sources.
type SpendParams =
  | SpendParamsWithFrom<
      TFromAdapterCapabilities,
      TToAdapterCapabilities,
      TChainIdentifier
    >
  | SpendParamsRetry<
      TFromAdapterCapabilities,
      TToAdapterCapabilities,
      TChainIdentifier
    >;
Returns EstimateSpendResult

EstimateSpendResult

Cost estimation for a spend (mint) operation.
interface EstimateSpendResult {
  fees: FeeEntry[];
}
Properties
NameTypeDescription
feesFeeEntry[]Itemised fee breakdown for the spend operation.
Usage Example
const estimate = await kit.unifiedBalance.estimateSpend({
  from: { adapter, allocations: [{ amount: "100", chain: "Ethereum" }] },
  to: { adapter, chain: "Base" },
  token: "USDC",
});

getBalances(params)

Fetch aggregated and per-chain balances for one or more accounts.
async getBalances(params: GetBalancesParams<AdapterCapabilities>): GetBalancesResult
Parameters
NameTypeDescription
paramsGetBalancesParamsBalance query parameters (adapter or account address).

GetBalancesParams

Parameters for the balances and pending-deposits API requests. Specify the token 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.
interface GetBalancesParams {
  includePending?: boolean;
  networkType?: NetworkType;
  sources: Sources<TAdapterCapabilities>;
  token?: SupportedTokenInput;
}
Properties
NameTypeDescription
includePendingbooleanWhen true, the result includes pending balances. When false or omitted, only confirmed balances are returned.
networkTypeNetworkTypeNetwork to use when no chains are specified on a source. When omitted, mainnet is used when chains cannot be derived.
sourcesSourcesOne or more sources identifying the accounts or adapters to query. Accepts a single object or an array.
tokenSupportedTokenInputThe token to query balances for. Accepts any case (e.g. 'usdc', 'Usdc'); normalised to uppercase internally.
Returns GetBalancesResult

GetBalancesResult

Result returned from the provider’s getBalances 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.
interface GetBalancesResult {
  breakdown: BalanceWithPendingBreakdown[];
  token: "USDC";
  totalConfirmedBalance: string;
  totalPendingBalance?: string;
}
Properties
NameTypeDescription
breakdownBalanceWithPendingBreakdown[]Per-account, per-chain breakdown.
token'USDC'Token that was queried.
totalConfirmedBalancestringTotal confirmed balance across all accounts and chains (human-readable decimal string).
totalPendingBalancestringTotal pending balance across all accounts and chains. Present only when includePending is true.
Usage Example
const balances = await kit.unifiedBalance.getBalances({
  token: "USDC",
  sources: { account: "0x1234…abcd" },
});

getDelegateStatus(params)

Check the finality-aware delegate status of an address.
async getDelegateStatus(params: GetDelegateStatusParams<AdapterCapabilities, UnifiedBalanceChainIdentifier>): DelegateStatus
Parameters
NameTypeDescription
paramsGetDelegateStatusParamsThe adapter context and delegate address to check.

GetDelegateStatusParams

Parameters for checking the delegate status of an address on a Gateway account.
interface GetDelegateStatusParams {
  delegateAddress: string;
  from: AdapterContext<TAdapterCapabilities, TChainIdentifier>;
  token?: SupportedTokenInput;
}
Properties
NameTypeDescription
delegateAddressstringThe address to check for delegate status.
fromAdapterContextThe adapter context identifying the account owner and chain.
tokenSupportedTokenInputThe token for which delegation is checked. Accepts any case (e.g. 'usdc', 'Usdc'); normalised to uppercase internally.
Returns DelegateStatus Usage Example
const status = await kit.unifiedBalance.getDelegateStatus({
  from: { adapter, chain: 'Ethereum' },
  delegateAddress: '0xDelegate…',
})
if (status === 'ready') { // safe to spend }

getSupportedChains(token)

Get all chains supported by the unified balance operations.
getSupportedChains(token: 'USDC', options: GetSupportedChainsOptions): ChainDefinition[]
Parameters
NameTypeDescription
token'USDC'Optional token filter (defaults to USDC).
optionsGetSupportedChainsOptionsOptional filtering (e.g. forwarder support).

GetSupportedChainsOptions

Options for filtering supported chains.
interface GetSupportedChainsOptions {
  forwarderSupported?: 'source' \| 'destination'
}
Properties
NameTypeDescription
forwarderSupported'source' | 'destination'Filter chains by forwarder support. When set, only chains whose gateway.forwarderSupported.source or gateway.forwarderSupported.destination matches the specified value are returned.

- undefined (default) — no forwarder filtering; all supported chains are returned.
- 'source' — only chains that support forwarding as a source.
- 'destination' — only chains that support forwarding as a destination.
Returns ChainDefinition[] Usage Example
const chains = kit.unifiedBalance.getSupportedChains();
const usdcChains = kit.unifiedBalance.getSupportedChains("USDC");

initiateRemoveFund(params)

Kick off a delayed fund removal from an account.
async initiateRemoveFund(params: InitiateRemoveFundParams<AdapterCapabilities, UnifiedBalanceChainIdentifier>): InitiateRemoveFundResult
Parameters
NameTypeDescription
paramsInitiateRemoveFundParamsThe account owner’s adapter context, amount, and token.

InitiateRemoveFundParams

Parameters for initiating a delayed fund removal from a Gateway account.
interface InitiateRemoveFundParams {
  amount: string;
  from: AdapterContext<TAdapterCapabilities, TChainIdentifier>;
  token?: SupportedTokenInput;
}
Properties
NameTypeDescription
amountstringThe amount to remove (human-readable decimal string).
fromAdapterContextThe account owner’s adapter context identifying the account, chain, and address.
tokenSupportedTokenInputThe token to remove. Accepts any case (e.g. 'usdc', 'Usdc'); normalised to uppercase internally.
Returns InitiateRemoveFundResult

InitiateRemoveFundResult

Result returned after successfully initiating a fund removal.
interface InitiateRemoveFundResult {
  account: string;
  amount: string;
  chain: Blockchain;
  explorerUrl?: string;
  token: "USDC";
  txHash: string;
  withdrawalBlock: number;
  withdrawingBalance: string;
}
Properties
NameTypeDescription
accountstringThe Gateway account from which this removal will occur.
amountstringThe amount requested for removal.
chainBlockchainThe chain on which this removal was initiated.
explorerUrlstringLink to view the transaction details on the appropriate blockchain explorer.
token'USDC'The token type (always USDC).
txHashstringUnique identifier returned by the blockchain once the transaction is mined.
withdrawalBlocknumberThe block number at which the removal can be completed.
withdrawingBalancestringThe balance currently in the withdrawing state for this account.
Usage Example
const result = await kit.unifiedBalance.initiateRemoveFund({
  adapter,
  chain: "Ethereum",
  amount: "50",
  token: "USDC",
});

off(action)

Unregister an event handler for a gateway lifecycle action.
off(action: string, handler: (payload: unknown) => void): void
Parameters
NameTypeDescription
actionstringThe action name or '*' for all actions.
handler(payload: unknown) => voidThe exact handler reference to remove.
Usage Example
const kit = new AppKit();
const handler = (payload: unknown) => console.log(payload);

kit.unifiedBalance.on("gateway.deposit.succeeded", handler);
kit.unifiedBalance.off("gateway.deposit.succeeded", handler);

on(action)

Register an event handler for a gateway lifecycle action. Action names correspond to UnifiedBalanceKit event names (e.g. 'gateway.spend.started'). Use '*' for a wildcard.
on(action: string, handler: (payload: unknown) => void): void
Parameters
NameTypeDescription
actionstringThe action name or '*' for all actions.
handler(payload: unknown) => voidCallback to invoke when the action occurs.
Usage Example
const kit = new AppKit();

kit.unifiedBalance.on("gateway.spend.started", (payload) => {
  console.log("Spend started:", payload);
});

kit.unifiedBalance.on("*", (payload) => {
  console.log("Event:", payload);
});

removeCustomFeePolicy()

Remove the custom fee policy.
removeCustomFeePolicy(): void
Usage Example
kit.unifiedBalance.removeCustomFeePolicy();

removeDelegate(params)

Revoke spending rights from a delegate on the owner’s account.
async removeDelegate(params: UpdateDelegateParams<AdapterCapabilities, UnifiedBalanceChainIdentifier>): UpdateDelegateResult
Parameters
NameTypeDescription
paramsUpdateDelegateParamsThe owner’s adapter context and the delegate address.

UpdateDelegateParams

Parameters for adding or removing a delegate on a Gateway account.
interface UpdateDelegateParams {
  delegateAddress: string;
  from: AdapterContext<TAdapterCapabilities, TChainIdentifier>;
  token?: SupportedTokenInput;
}
Properties
NameTypeDescription
delegateAddressstringThe address being added or removed as an authorized delegate.
fromAdapterContextThe owner’s adapter context identifying the account and chain to which the delegate will be authorized.
tokenSupportedTokenInputThe token for which delegation applies. Accepts any case (e.g. 'usdc', 'Usdc'); normalised to uppercase internally.
Returns UpdateDelegateResult

UpdateDelegateResult

Result returned after a successful add or remove delegate operation.
interface UpdateDelegateResult {
  account: string
  chain: Blockchain
  delegateAddress: string
  explorerUrl?: string
  state: 'added' \| 'removed'
  txHash: string
}
Properties
NameTypeDescription
accountstringThe Gateway account that was modified.
chainBlockchainThe chain on which the delegate was updated.
delegateAddressstringThe delegate address that was added or removed.
explorerUrlstringLink to view the transaction details on the appropriate blockchain explorer.
state'added' | 'removed'Whether the delegate was added or removed.
txHashstringUnique identifier returned by the blockchain once the transaction is mined.
Usage Example
const result = await kit.unifiedBalance.removeDelegate({
  adapter,
  chain: "Ethereum",
  delegate: "0xDelegate…",
});

removeFund(params)

Complete a fund removal once the activation period has passed.
async removeFund(params: RemoveFundParams<AdapterCapabilities, UnifiedBalanceChainIdentifier>): RemoveFundResult
Parameters
NameTypeDescription
paramsRemoveFundParamsThe account owner context matching the original initiation.

RemoveFundParams

Parameters for completing a fund removal after the activation period.
interface RemoveFundParams {
  from: AdapterContext<TAdapterCapabilities, TChainIdentifier>;
  token?: SupportedTokenInput;
}
Properties
NameTypeDescription
fromAdapterContextThe account owner’s adapter context. Must match the one used when initiating the fund removal.
tokenSupportedTokenInputThe token to remove. Accepts any case (e.g. 'usdc', 'Usdc'); normalised to uppercase internally.
Returns RemoveFundResult

RemoveFundResult

Result returned after successfully completing a fund removal.
interface RemoveFundResult {
  account: string;
  amount: string;
  chain: Blockchain;
  explorerUrl?: string;
  token: "USDC";
  txHash: string;
}
Properties
NameTypeDescription
accountstringThe Gateway account from which the tokens were removed.
amountstringThe final removed amount.
chainBlockchainThe chain on which the removal occurred.
explorerUrlstringLink to view the transaction details on the appropriate blockchain explorer.
token'USDC'The token type (always USDC).
txHashstringUnique identifier returned by the blockchain once the transaction is mined.
Usage Example
const result = await kit.unifiedBalance.removeFund({
  adapter,
  chain: "Ethereum",
  token: "USDC",
});

setCustomFeePolicy(policy)

Set a custom fee policy for spend operations. Once set, every subsequent spend() and estimateSpend() call will include the computed fee unless overridden by per-call config.
setCustomFeePolicy(policy: CustomFeePolicy): void
Parameters
NameTypeDescription
policyCustomFeePolicyThe fee computation and recipient resolution policy.
Usage Example
kit.unifiedBalance.setCustomFeePolicy({
  getFee: (ctx) => ({ value: "0.10", token: "USDC" }),
  getFeeRecipient: (chain) => "0xFeeRecipient…",
});

spend(params)

Spend (mint) USDC on a destination chain by pulling funds from one or more account sources.
async spend(params: SpendParams): SpendResult
Parameters
NameTypeDescription
paramsSpendParamsSpend details including source(s), destination, and token.

SpendParams

Parameters for spending (minting) USDC on a destination chain from one or more Gateway account sources.
type SpendParams =
  | SpendParamsWithFrom<
      TFromAdapterCapabilities,
      TToAdapterCapabilities,
      TChainIdentifier
    >
  | SpendParamsRetry<
      TFromAdapterCapabilities,
      TToAdapterCapabilities,
      TChainIdentifier
    >;
Returns SpendResult

SpendResult

Result returned after a successful spend (mint) operation.
interface SpendResult {
  allocations?: AllocationResult[];
  destinationChain: Blockchain;
  expirationBlock?: string;
  explorerUrl?: string;
  fees?: FeeEntry[];
  recipientAddress: string;
  steps?: SpendStep[];
  transferId?: string;
  txHash: string;
}
Properties
NameTypeDescription
allocationsAllocationResult[]Flattened list of allocations that were executed, each with its source Gateway account. Only present for non-retry spends.
destinationChainBlockchainThe destination chain on which the recipient received the USDC.
expirationBlockstringBlock height after which the transfer attestation expires. Returned by the Gateway transfer API.
explorerUrlstringLink to view the transaction details on the appropriate blockchain explorer.
feesFeeEntry[]Fee breakdown (provider, gasFee, optional kit, forwarder) for the executed spend. Same shape as estimateSpend fees. Omitted when using config.retry.
recipientAddressstringThe address that received the minted USDC.
stepsSpendStep[]Ordered list of steps executed during the spend operation.
transferIdstringGateway transfer identifier. Present when useForwarder is enabled and can be used to query transfer status via GET /v1/transfer/{id}.
txHashstringUnique identifier returned by the blockchain once the transaction is mined.
Usage Example
const result = await kit.unifiedBalance.spend({
  from: { adapter, allocations: [{ amount: "100", chain: "Ethereum" }] },
  to: { adapter, chain: "Base" },
  token: "USDC",
});

Supporting Types

BridgeConfig

Configuration options for customizing bridge behavior.
interface BridgeConfig {
  batchTransactions?: boolean
  customFee?: CustomFee
  maxFee?: string
  transferSpeed?: TransferSpeed \| 'FAST' \| 'SLOW'
}
Properties
NameTypeDescription
batchTransactionsbooleanEnable or disable EIP-5792 batched transaction execution.

When true (or undefined / omitted), the bridge will attempt to batch the approve and burn calls into a single wallet_sendCalls request if the connected wallet supports it. Set to false to explicitly opt out and always use the sequential approve -> burn flow.
customFeeCustomFeeThe custom fee to charge for the transfer.

Whatever value you provide here is added on top of the transfer amount. The user must have enough balance for amount + customFee, and the wallet signs for that total on the source chain. The custom fee is split automatically:

- 10% routes to Circle.
- 90% routes to your recipientAddress.

The original transfer amount proceeds through CCTPv2 unchanged, and the protocol fee (1–14 bps in FAST mode, 0% in STANDARD) is taken from that transfer amount.
maxFeestringThe maximum fee to pay for the burn operation.

Provide the amount as a base-10 numeric string representing the token amount in human-readable format. For example: to set a maximum fee of 1 USDC, pass "1". Decimal values are supported (e.g., "0.5" for half a USDC).
transferSpeedTransferSpeed | 'FAST' | 'SLOW'The transfer speed mode for CCTPv2 transfers.

Controls whether to use fast burn mode (FAST) or standard mode (SLOW). Fast burn may reduce transfer time but could have different fee implications.

TransferSpeed

Transfer speed options for crosschain operations. Defines the available speed modes for CCTPv2 transfers, affecting both transfer time and potential fee implications.
enum TransferSpeed {
  FAST = 'FAST'
  SLOW = 'SLOW'
}
Values 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 address field is required because each operation must explicitly specify which address to use.
  • User-controlled adapters: The address field is forbidden because the address is automatically resolved from the connected wallet or signer.
  • Legacy adapters: The address field remains optional for backward compatibility.
This ensures clear, debuggable code where the intended chain is always visible at the call site, and address requirements are enforced at compile time based on adapter capabilities.
type AdapterContext = {
  adapter: Adapter<TAdapterCapabilities>;
  chain: TChainIdentifier;
} & AddressField<ExtractAddressContext<TAdapterCapabilities>>;

ChainDefinition

Public chain definition type.
type ChainDefinition = EVMChainDefinition | NonEVMChainDefinition;

EVMChainDefinition

Represents chain definitions for Ethereum Virtual Machine (EVM) compatible blockchains.
interface EVMChainDefinition {
  cctp: null \| CCTPConfig
  chain: Blockchain
  chainId: number
  eurcAddress: null \| string
  explorerUrl: string
  gateway?: GatewayConfig
  isTestnet: boolean
  kitContracts?: Partial<Record<KitContractType, string>>
  name: string
  nativeCurrency: Currency
  rpcEndpoints: any
  title?: string
  type: 'evm'
  usdcAddress: null \| string
  usdtAddress: null \| string
}
Properties
NameTypeDescription
cctpnull | CCTPConfigOptional CCTP configuration.
chainBlockchainThe blockchain identifier from the Blockchain enum.
chainIdnumberThe unique identifier for the blockchain.
eurcAddressnull | stringThe contract address for EURC.
explorerUrlstringTemplate URL for the blockchain explorer to view transactions.
gatewayGatewayConfigOptional Gateway contract configuration for Gateway protocol support.
isTestnetbooleanIndicates whether this is a testnet or mainnet.
kitContractsPartial<Record<KitContractType, string>>Optional kit-specific contract addresses for enhanced chain functionality.
namestringThe display name of the blockchain.
nativeCurrencyCurrencyInformation about the native currency of the blockchain.
rpcEndpointsanyDefault RPC endpoints for connecting to the blockchain network.
titlestringOptional title or alternative name for the blockchain.
type'evm'Discriminator for EVM chains.
usdcAddressnull | stringThe contract address for USDC.
usdtAddressnull | stringThe contract address for USDT.

CCTPConfig

Configuration for the Cross-Chain Transfer Protocol (CCTP).
interface CCTPConfig {
  contracts: Partial<object>;
  domain: number;
  forwarderSupported: object;
}
Properties
NameTypeDescription
contractsPartial<object>The contracts required for CCTP.
domainnumberThe CCTP domain identifier.
forwarderSupportedobjectIndicates whether the chain supports forwarder for source and destination.

VersionConfig

Version configuration for CCTP contracts. Defines whether the chain uses split or merged CCTP contract architecture. Split configuration uses separate TokenMessenger and MessageTransmitter contracts, while merged configuration uses a single unified contract.
type VersionConfig = CCTPSplitConfig | CCTPMergedConfig;

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.
enum Blockchain {
  Algorand = 'Algorand'
  Algorand_Testnet = 'Algorand_Testnet'
  Aptos = 'Aptos'
  Aptos_Testnet = 'Aptos_Testnet'
  Arbitrum = 'Arbitrum'
  Arbitrum_Sepolia = 'Arbitrum_Sepolia'
  Arc_Testnet = 'Arc_Testnet'
  Avalanche = 'Avalanche'
  Avalanche_Fuji = 'Avalanche_Fuji'
  Base = 'Base'
  Base_Sepolia = 'Base_Sepolia'
  Celo = 'Celo'
  Celo_Alfajores_Testnet = 'Celo_Alfajores_Testnet'
  Codex = 'Codex'
  Codex_Testnet = 'Codex_Testnet'
  Edge = 'Edge'
  Edge_Testnet = 'Edge_Testnet'
  Ethereum = 'Ethereum'
  Ethereum_Sepolia = 'Ethereum_Sepolia'
  Hedera = 'Hedera'
  Hedera_Testnet = 'Hedera_Testnet'
  HyperEVM = 'HyperEVM'
  HyperEVM_Testnet = 'HyperEVM_Testnet'
  Ink = 'Ink'
  Ink_Testnet = 'Ink_Testnet'
  Linea = 'Linea'
  Linea_Sepolia = 'Linea_Sepolia'
  Monad = 'Monad'
  Monad_Testnet = 'Monad_Testnet'
  Morph = 'Morph'
  Morph_Testnet = 'Morph_Testnet'
  NEAR = 'NEAR'
  NEAR_Testnet = 'NEAR_Testnet'
  Noble = 'Noble'
  Noble_Testnet = 'Noble_Testnet'
  Optimism = 'Optimism'
  Optimism_Sepolia = 'Optimism_Sepolia'
  Plume = 'Plume'
  Plume_Testnet = 'Plume_Testnet'
  Polkadot_Asset_Hub = 'Polkadot_Asset_Hub'
  Polkadot_Westmint = 'Polkadot_Westmint'
  Polygon = 'Polygon'
  Polygon_Amoy_Testnet = 'Polygon_Amoy_Testnet'
  Sei = 'Sei'
  Sei_Testnet = 'Sei_Testnet'
  Solana = 'Solana'
  Solana_Devnet = 'Solana_Devnet'
  Sonic = 'Sonic'
  Sonic_Testnet = 'Sonic_Testnet'
  Stellar = 'Stellar'
  Stellar_Testnet = 'Stellar_Testnet'
  Sui = 'Sui'
  Sui_Testnet = 'Sui_Testnet'
  Unichain = 'Unichain'
  Unichain_Sepolia = 'Unichain_Sepolia'
  World_Chain = 'World_Chain'
  World_Chain_Sepolia = 'World_Chain_Sepolia'
  XDC = 'XDC'
  XDC_Apothem = 'XDC_Apothem'
  ZKSync_Era = 'ZKSync_Era'
  ZKSync_Sepolia = 'ZKSync_Sepolia'
}
Values 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, Ink, Ink_Testnet, Linea, Linea_Sepolia, Monad, Monad_Testnet, Morph, Morph_Testnet, NEAR, NEAR_Testnet, Noble, Noble_Testnet, Optimism, Optimism_Sepolia, 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.
type KitContractType = "bridge" | "adapter";

Currency

Represents basic information about a currency or token.
interface Currency {
  decimals: number;
  name: string;
  symbol: string;
}

NonEVMChainDefinition

Represents chain definitions for non-EVM blockchains.
interface NonEVMChainDefinition {
  cctp: null \| CCTPConfig
  chain: Blockchain
  eurcAddress: null \| string
  explorerUrl: string
  gateway?: GatewayConfig
  isTestnet: boolean
  kitContracts?: Partial<Record<KitContractType, string>>
  name: string
  nativeCurrency: Currency
  rpcEndpoints: any
  title?: string
  type: 'algorand' \| 'avalanche' \| 'solana' \| 'aptos' \| 'near' \| 'stellar' \| 'sui' \| 'hedera' \| 'noble' \| 'polkadot'
  usdcAddress: null \| string
  usdtAddress: null \| string
}
Properties
NameTypeDescription
cctpnull | CCTPConfigOptional CCTP configuration.
chainBlockchainThe blockchain identifier from the Blockchain enum.
eurcAddressnull | stringThe contract address for EURC.
explorerUrlstringTemplate URL for the blockchain explorer to view transactions.
gatewayGatewayConfigOptional Gateway contract configuration for Gateway protocol support.
isTestnetbooleanIndicates whether this is a testnet or mainnet.
kitContractsPartial<Record<KitContractType, string>>Optional kit-specific contract addresses for enhanced chain functionality.
namestringThe display name of the blockchain.
nativeCurrencyCurrencyInformation about the native currency of the blockchain.
rpcEndpointsanyDefault RPC endpoints for connecting to the blockchain network.
titlestringOptional title or alternative name for the blockchain.
type'algorand' | 'avalanche' | 'solana' | 'aptos' | 'near' | 'stellar' | 'sui' | 'hedera' | 'noble' | 'polkadot'Discriminator for non-EVM chains.
usdcAddressnull | stringThe contract address for USDC.
usdtAddressnull | stringThe contract address for USDT.

SwapConfig

Configuration options for swap operations. Controls swap behavior including allowance strategy, slippage tolerance, minimum output amounts, custom fees, and kit identification.
interface SwapConfig {
  allowanceStrategy?: AllowanceStrategy;
  customFee?: object;
  kitKey?: string;
  slippageBps?: number;
  stopLimit?: string;
}
Properties
NameTypeDescription
allowanceStrategyAllowanceStrategyStrategy for granting token allowances to the swap contract.

Defaults to permit with fallback to approve.
customFeeobjectCustom fee configuration for this swap (percentage-based approach).

Allows specifying a percentage fee and recipient address at the transaction level. This is mutually exclusive with kit-level callback fee policy. If both are set, transaction-level takes precedence.

For complex fee logic (VIP tiers, database lookups), use kit-level callback approach via setCustomFeePolicy() instead.
kitKeystringIdentifier for the kit instance initiating this swap.

Used for tracking and analytics purposes.
slippageBpsnumberMaximum acceptable slippage in basis points (BPS).

1 BPS = 0.01%, so 300 BPS = 3% slippage. Defaults to 300 BPS (3%).
stopLimitstringMinimum acceptable output amount in human-readable format (stop-limit).

If the estimated output falls below this value, the swap will fail. Expressed as a decimal string (e.g., 0.4 for 0.4 USDT). The value is automatically converted to base units using the tokenOut decimals.

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
The default strategy is permit with fallback to approve if permit is not supported.
type AllowanceStrategy = "permit" | "approve";

FeeOperationType

Operation types that support the getFee/getFeeRecipient hooks.
type FeeOperationType = "bridge" | "swap";

AppKitActions

All actions available in AppKit.
type AppKitActions = AppKitBridgeActions & AppKitUnifiedBalanceActions;

AppKitBridgeActions

Prefixed bridge actions for AppKit. All BridgeKit events are prefixed with bridge. to namespace them within the AppKit event system.
type AppKitBridgeActions = PrefixActions<"bridge", DefaultBridgeKitActions>;

AppKitUnifiedBalanceActions

Prefixed unified balance actions for AppKit. All UnifiedBalanceKit (Gateway) events are prefixed with unifiedBalance. to namespace them within the AppKit event system.
type AppKitUnifiedBalanceActions = PrefixActions<
  "unifiedBalance",
  GatewayV1Actions
>;

DeveloperFeeHooks

interface DeveloperFeeHooks {
  getFee: (params: BridgeParams<AdapterCapabilities, AdapterCapabilities>) => bigint \| bigint
  getFeeRecipient: (chain: ChainDefinition) => string \| string
}
Properties
NameTypeDescription
getFee(params: BridgeParams<AdapterCapabilities, AdapterCapabilities>) => bigint | bigintReturns the developer fee in USDC’s smallest units (e.g. 6 decimals).
getFeeRecipient(chain: ChainDefinition) => string | stringReturns the fee recipient for the given chain.

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
type UnifiedBalanceChainIdentifier =
  | ChainDefinition
  | UnifiedBalanceChain
  | any;

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.
enum UnifiedBalanceChain {
  Arbitrum = 'Arbitrum'
  Arbitrum_Sepolia = 'Arbitrum_Sepolia'
  Arc_Testnet = 'Arc_Testnet'
  Avalanche = 'Avalanche'
  Avalanche_Fuji = 'Avalanche_Fuji'
  Base = 'Base'
  Base_Sepolia = 'Base_Sepolia'
  Ethereum = 'Ethereum'
  Ethereum_Sepolia = 'Ethereum_Sepolia'
  HyperEVM = 'HyperEVM'
  HyperEVM_Testnet = 'HyperEVM_Testnet'
  Optimism = 'Optimism'
  Optimism_Sepolia = 'Optimism_Sepolia'
  Polygon = 'Polygon'
  Polygon_Amoy_Testnet = 'Polygon_Amoy_Testnet'
  Sei = 'Sei'
  Sei_Testnet = 'Sei_Testnet'
  Solana = 'Solana'
  Solana_Devnet = 'Solana_Devnet'
  Sonic = 'Sonic'
  Sonic_Testnet = 'Sonic_Testnet'
  Unichain = 'Unichain'
  Unichain_Sepolia = 'Unichain_Sepolia'
  World_Chain = 'World_Chain'
  World_Chain_Sepolia = 'World_Chain_Sepolia'
}
Values 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

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.
type DelegateStatus = "none" | "pending" | "ready";

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.
interface CCTPSplitConfig {
  confirmations: number;
  messageTransmitter: string;
  tokenMessenger: string;
  type: "split";
}

CCTPMergedConfig

Merged CCTP contract configuration. Used by chains that deploy a single unified CCTP contract. This simplified architecture is used by newer chain integrations.
interface CCTPMergedConfig {
  confirmations: number;
  contract: string;
  type: "merged";
}

BaseChainDefinition

Base information that all chain definitions must include.
interface BaseChainDefinition {
  cctp: null \| CCTPConfig
  chain: Blockchain
  eurcAddress: null \| string
  explorerUrl: string
  gateway?: GatewayConfig
  isTestnet: boolean
  kitContracts?: Partial<Record<KitContractType, string>>
  name: string
  nativeCurrency: Currency
  rpcEndpoints: any
  title?: string
  usdcAddress: null \| string
  usdtAddress: null \| string
}
Properties
NameTypeDescription
cctpnull | CCTPConfigOptional CCTP configuration.
chainBlockchainThe blockchain identifier from the Blockchain enum.
eurcAddressnull | stringThe contract address for EURC.
explorerUrlstringTemplate URL for the blockchain explorer to view transactions.
gatewayGatewayConfigOptional Gateway contract configuration for Gateway protocol support.
isTestnetbooleanIndicates whether this is a testnet or mainnet.
kitContractsPartial<Record<KitContractType, string>>Optional kit-specific contract addresses for enhanced chain functionality.
namestringThe display name of the blockchain.
nativeCurrencyCurrencyInformation about the native currency of the blockchain.
rpcEndpointsanyDefault RPC endpoints for connecting to the blockchain network.
titlestringOptional title or alternative name for the blockchain.
usdcAddressnull | stringThe contract address for USDC.
usdtAddressnull | stringThe contract address for USDT.

TokenInfo

Represents the metadata associated with a token.
interface TokenInfo {
  decimals: number;
  name: string;
  symbol: string;
}

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 with bridge. to namespace them within AppKit:
EventDescription
bridge.approveToken approval transaction completed
bridge.burnSource chain burn transaction completed
bridge.attestationCCTP attestation received
bridge.mintDestination chain mint transaction completed
*Wildcard listener for all events
Usage Example
import { AppKit } from "@circle-fin/app-kit";

const kit = new AppKit();

// Listen to specific bridge action
kit.on("bridge.approve", (payload) => {
  console.log("Approval transaction:", payload.values.txHash);
});

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

// Listen to all actions
kit.on("*", (payload) => {
  console.log("Action:", payload);
});