4. Delegate Management
Add, list, and remove delegates. Delegates are addresses that can propose transactions on behalf of Safe owners without being owners themselves.
What you'll learn
Prerequisites
npm install @safe-global/api-kit viemConfiguration
import SafeApiKitModule from "@safe-global/api-kit";
import { createWalletClient, http } from "viem";
import { sepolia } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
// ESM interop-safe constructor resolution (required in some runtimes)
const SafeApiKit =
typeof SafeApiKitModule === "function"
? SafeApiKitModule
: (SafeApiKitModule as unknown as { default: typeof SafeApiKitModule }).default;
const CHAIN_ID = 11155111n; // Sepolia
const TX_SERVICE_URL = `https://app.multisig.ledger.com/api/safe-transaction-service/${CHAIN_ID}`;
const RPC_URL = "https://ethereum-sepolia-rpc.publicnode.com";
const SAFE_ADDRESS = "0xYourSafeAddress";
const OWNER_PRIVATE_KEY = "0xYourPrivateKey" as `0x${string}`; // Testnet only!
const apiKit = new SafeApiKit({
chainId: CHAIN_ID,
txServiceUrl: TX_SERVICE_URL,
});Step-by-step
Key concepts
Tips and pitfalls
Next steps
5. ERC20 Token TransfersLast updated