Skip to main content
App Kit supports trustless withdrawals from a Unified Balance, keeping your funds under your control. Withdrawals require two steps: initiate the removal, then complete it. On EVM networks, a 7-day waiting period applies between steps. On Solana, you can complete the removal immediately after initiation.
removeFund is designed as a trustless escape hatch for fallback or recovery scenarios only. In normal situations, use spend.

Prerequisites

Before you begin, ensure that you’ve: These are required so any example below runs with a valid kit and adapter.

Initiate and complete a removal

1

Initiate the removal

Call initiateRemoveFund to record the request to remove funds and start the 7-day waiting period.This example initiates a removal of 1 USDC on Base Sepolia:
TypeScript
import { AppKit } from "@circle-fin/app-kit";
import { createViemAdapterFromPrivateKey } from "@circle-fin/adapter-viem-v2";

const kit = new AppKit();

const adapter = createViemAdapterFromPrivateKey({
  privateKey: process.env.EVM_PRIVATE_KEY as string,
});

const initiateResult = await kit.unifiedBalance.initiateRemoveFund({
  from: {
    adapter,
    chain: "Base_Sepolia",
  },
  amount: "1.00",
});

console.log("Remove fund initiated:", initiateResult);
initiateRemoveFund returns a result object that includes the transaction details for the pending removal. In step 2, pass the same adapter and chain values to removeFund to complete it (you can reuse the same variables as in this example).
2

Complete the removal

After the waiting period, call removeFund to return funds to the wallet for that adapter on that blockchain:
TypeScript
import { AppKit } from "@circle-fin/app-kit";
import { createViemAdapterFromPrivateKey } from "@circle-fin/adapter-viem-v2";

const kit = new AppKit();

const adapter = createViemAdapterFromPrivateKey({
  privateKey: process.env.EVM_PRIVATE_KEY as string,
});

const removeResult = await kit.unifiedBalance.removeFund({
  from: {
    adapter,
    chain: "Base_Sepolia",
  },
});

console.log("Remove fund complete:", removeResult);
What to know about removals on EVM:
  • Calling removeFund before the waiting period has elapsed will fail.
  • Funds go to the wallet associated with the adapter on the specified blockchain.
  • Only one pending removeFund request is allowed per blockchain and address.