UNPKG

@thirdweb-dev/wallets

Version:

<p align="center"> <br /> <a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/legacy_packages/sdk/logo.svg?raw=true" width="200" alt=""/></a> <br /> </p> <h1 align="center">thirdweb Wallet SDK</h1> <p align="center"> <a h

133 lines 4.31 kB
import type { CoinbaseWalletConnector } from "../connectors/coinbase-wallet"; import { Connector } from "../interfaces/connector"; import { AbstractClientWallet, WalletOptions } from "./base"; export type CoinbaseWalletOptions = WalletOptions<{ headlessMode?: boolean; theme?: "dark" | "light"; }>; /** * Wallet Interface to connect [Coinbase Wallet](https://www.coinbase.com/wallet) extension or mobile app. * * @example * ```ts * import { CoinbaseWallet } from "@thirdweb-dev/wallets"; * * const wallet = new CoinbaseWallet(); * * await wallet.connect(); * ``` * * @wallet */ export declare class CoinbaseWallet extends AbstractClientWallet { /** * @internal */ connector?: Connector; /** * @internal */ coinbaseConnector?: CoinbaseWalletConnector; /** * @internal */ static meta: { iconURL: string; name: string; urls: { chrome: string; android: string; ios: string; }; }; /** * @internal */ static id: string; /** * @internal */ get walletName(): "Coinbase Wallet"; /** * @internal */ headlessMode: boolean; /** * @internal */ theme: "dark" | "light"; /** * * @param options - * The `options` object contains the following properties: * * ### clientId (recommended) * * Provide `clientId` to use the thirdweb RPCs for given `chains` * * You can create a client ID for your application from [thirdweb dashboard](https://thirdweb.com/create-api-key). * * * ### chains (optional) * * Provide an array of chains you want to support. * * Must be an array of `Chain` objects, from the [`@thirdweb-dev/chains`](https://www.npmjs.com/package/\@thirdweb-dev/chains) package. * * Defaults to our [default chains](/react/react.thirdwebprovider#default-chains). * * * ### dappMetadata (optional) * * Information about your app that the wallet will display when your app tries to connect to it. * * Must be an object containing `name`, `url` and optionally `description` and `logoUrl` properties. * * ```javascript * import { CoinbaseWallet } from "@thirdweb-dev/wallets"; * * const walletWithOptions = new CoinbaseWallet({ * dappMetadata: { * name: "thirdweb powered dApp", * url: "https://thirdweb.com", * description: "thirdweb powered dApp", // optional * logoUrl: "https://thirdweb.com/favicon.ico", // optional * }, * }); * ``` * * ### headlessMode (optional) * This is only relevant applies when coinbase extension wallet is NOT installed on user's browser. * * By default `headlessMode` is set to `false` - which means that when user does not have coinbase wallet extension installed, a QR Code scan modal will open when calling the `connect` method to allow the user to connect to their coinbase mobile app by scanning the QR code. * * If headlessMode is set to `true` and coinbase wallet extension is not installed, the wallet will NOT open a QR Code scan modal - This is useful if you want to create a custom QR Code modal. * * you can use the `getQrUrl` method to get the QR Code url and create your own QR Code Modal * * Must be a `boolean`. */ constructor(options?: CoinbaseWalletOptions); protected getConnector(): Promise<Connector>; /** * Get the QR Code url to render a custom QR Code Modal for connecting to Coinbase Wallet. * * This method is only relevant when coinbase extension wallet is NOT installed on user's browser and `headlessMode` is set to `true`. * * @example * ```ts * const wallet = new CoinbaseWallet({ headlessMode: true }); * * const qrUrl = await wallet.getQrUrl(); * // render a QR Code Modal with the qrUrl * * const walletAddress = await wallet.connect(); // this is resolved when user scans the QR Code and wallet is connected * * console.log('connected to', walletAddress); * ``` * * @returns */ getQrUrl(): Promise<string | null>; } //# sourceMappingURL=coinbase-wallet.d.ts.map