Skip to main content

depositFunds

Transfer tokens from user's EOA to their Smart Wallet. Waits for transaction confirmation.

Supported assets:

  • USDC (default): 6 decimals — e.g., "100000000" = 100 USDC
  • WETH: 18 decimals — e.g., "1000000000000000000" = 1 WETH
Important for WETH deposits

You must deposit WETH (Wrapped ETH), not native ETH. If the user has ETH, they must wrap it to WETH first before depositing.

Signature

depositFunds(userAddress: string, chainId: SupportedChainId, amount: string, asset?: "USDC" | "WETH"): Promise<DepositResponse>

Parameters

ParameterTypeRequiredDescription
userAddressstringUser's EOA address (owner of the Safe)
chainIdSupportedChainIdChain to deposit on
amountstringAmount in least decimal units (6 decimals for USDC, 18 decimals for WETH)
asset"USDC" | "WETH"Asset to deposit (default: "USDC")

Returns

Deposit response with transaction hash and confirmation

Return Type

interface DepositResponse {
success: boolean;
txHash: string;
smartWallet: string;
amount: string;
}

Example

Deposit USDC (default)

// Deposit 100 USDC (6 decimals) to Safe on Base
const result = await sdk.depositFunds(
"0xUser...",
8453,
"100000000" // 100 USDC = 100 * 10^6
);
console.log("Deposit confirmed:", result.txHash);
console.log("Smart Wallet:", result.smartWallet);

Deposit WETH

// Deposit 0.5 WETH (18 decimals) to Safe on Base
// IMPORTANT: User must have WETH, not ETH. Wrap ETH to WETH first if needed.
const result = await sdk.depositFunds(
"0xUser...",
8453,
"500000000000000000", // 0.5 WETH = 0.5 * 10^18
"WETH"
);
console.log("WETH deposit confirmed:", result.txHash);