Skip to main content

deploySafe

Deploy a Safe smart wallet for a user using ERC-4337 account abstraction. Automatically checks if already deployed and updates user profile.

Signature

deploySafe(userAddress: string, chainId: SupportedChainId): Promise<DeploySafeResponse>

Parameters

ParameterTypeRequiredDescription
userAddressstringUser's EOA address
chainIdSupportedChainIdTarget chain (8453, 42161, or 9745)

Returns

Deployment response with Safe address and transaction hash

Return Type

interface DeploySafeResponse {
success: boolean;
safeAddress: Address;
txHash: string;
status: "deployed" | "failed";
}

Example

const result = await sdk.deploySafe("0xUser...", 42161);
if (result.success) {
console.log("Safe deployed at:", result.safeAddress);
console.log("Transaction:", result.txHash);
}