Send All
Drain the user's entire token balance to a recipient. When sending and paying fees in the same token, Zedkr automatically computes balance − fee so the wallet goes to exactly zero.
typescript
import { Zedkr } from "zedkr";
const client = await Zedkr.create({ provider });
const result = await client.transferAll(signer, "0xRecipient", "0xUSDT", 6);
console.log(`Sent ${result.sentAmount} USDT`);Tip
Zero wallet - if fee token = send token (e.g. USDT to USDT), the user's balance lands at exactly 0. No dust left behind.
How the amount is calculated
1Reads the user's full on-chain balance
2Fetches the fee quote from the relayer
3If same token: sentAmount = balance − fee
4If different token: sends full balance, fee pulled separately