import type { Wallet } from "./interfaces/wallet.js"; import type { CreateWalletArgs, WalletId } from "./wallet-types.js"; /** * Creates a wallet based on the provided ID and arguments. * * - Supports 500+ wallets * - Handles both injected browser wallets and WalletConnect sessions * * [View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets) * * @param args - The arguments for creating the wallet. * @param args.id - The ID of the wallet to create, this will be autocompleted by your IDE. * [View all available wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets) * @param args.createOptions - The options for creating the wallet. * The arguments are different for each wallet type. * Refer to the [WalletCreationOptions](https://portal.thirdweb.com/references/typescript/v5/WalletCreationOptions) type for more details. * @returns - The created wallet. * @example * * ## Connecting the wallet * * Once created, you can connect the wallet to your app by calling the `connect` method. * * The `connect` method returns a promise that resolves to the connected account. * * Each wallet type can have different connect options. [View the different connect options](https://portal.thirdweb.com/references/typescript/v5/WalletConnectionOption) * * ## Connecting to an injected wallet * * ```ts * import { createWallet } from "thirdweb/wallets"; * * const metamaskWallet = createWallet("io.metamask"); * * const account = await metamaskWallet.connect({ * client, * }); * ``` * * You can check if a wallet is installed by calling the [injectedProvider](https://portal.thirdweb.com/references/typescript/v5/injectedProvider) method. * * ## Connecting via WalletConnect modal * * ```ts * import { createWallet } from "thirdweb/wallets"; * * const metamaskWallet = createWallet("io.metamask"); * * await metamask.connect({ * client, * walletConnect: { * projectId: "YOUR_PROJECT_ID", * showQrModal: true, * appMetadata: { * name: "My App", * url: "https://my-app.com", * description: "my app description", * logoUrl: "https://path/to/my-app/logo.svg", * }, * }, * }); * ``` * [View ConnectWallet connection options](https://portal.thirdweb.com/references/typescript/v5/WCConnectOptions) * * ## Connecting with coinbase wallet * * ```ts * import { createWallet } from "thirdweb/wallets"; * * const cbWallet = createWallet("com.coinbase.wallet", { * appMetadata: { * name: "My App", * url: "https://my-app.com", * description: "my app description", * logoUrl: "https://path/to/my-app/logo.svg", * }, * walletConfig: { * // options: 'all' | 'smartWalletOnly' | 'eoaOnly' * options: 'all', * }, * }); * * const account = await cbWallet.connect({ * client, * }); * ``` * * [View Coinbase wallet creation options](https://portal.thirdweb.com/references/typescript/v5/CoinbaseWalletCreationOptions) * * ## Connecting with Base Account SDK * * ```ts * import { createWallet } from "thirdweb/wallets"; * import { base, baseSepolia } from "thirdweb/chains"; * * // For mainnet * const baseWallet = createWallet("org.base.account", { * appMetadata: { * name: "My App", * url: "https://my-app.com", * description: "my app description", * logoUrl: "https://path/to/my-app/logo.svg", * }, * chains: [base], // specify supported chains (use baseSepolia for testnet) * }); * * const account = await baseWallet.connect({ * client, * }); * ``` * * [View Base Account wallet creation options](https://portal.thirdweb.com/references/typescript/v5/BaseAccountWalletCreationOptions) * * ## Connecting with a smart wallet * * ```ts * import { createWallet } from "thirdweb/wallets"; * * const wallet = createWallet("smart", { * chain: sepolia, * sponsorGas: true, * }); * * const account = await wallet.connect({ * client, * personalAccount, // pass the admin account * }); * ``` * * @wallet */ export declare function createWallet(...args: CreateWalletArgs): Wallet; /** * Creates a wallet that allows connecting to any wallet that supports the WalletConnect protocol. * @returns The created smart wallet. * @example * ```ts * import { walletConnect } from "thirdweb/wallets"; * * const wallet = walletConnect(); * * const account = await wallet.connect({ * client * }); * ``` * @wallet */ export declare function walletConnect(): Wallet<"walletConnect">; //# sourceMappingURL=create-wallet.d.ts.map