@coinbase/cdp-sdk
Version:
SDK for interacting with the Coinbase Developer Platform Wallet API
23 lines • 1.13 kB
TypeScript
/**
* Shared helpers for recovering CDP smart accounts.
*/
import type { CdpClient } from "../client/cdp.js";
/**
* Returns `true` when the CDP API rejected a smart account creation because the
* owner EOA already has a smart wallet registered under a different name.
*
* @param error - The caught error value to inspect.
* @returns `true` if the error indicates an owner already has a smart wallet.
*/
export declare function isOwnerAlreadyHasSmartWalletError(error: unknown): boolean;
/**
* Paginates through all smart accounts in the CDP project to find one owned by
* the given address. Used as a recovery path when `getOrCreateSmartAccount`
* fails because the owner already has a smart wallet under a different name.
*
* @param cdpClient - The CDP client to use for listing accounts.
* @param ownerAddress - Owner EOA address to match (case-insensitive).
* @returns The first matching smart account address, or `undefined` if none found.
*/
export declare function findSmartAccountByOwner(cdpClient: CdpClient, ownerAddress: string): Promise<string | undefined>;
//# sourceMappingURL=smart-account.d.ts.map