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

66 lines 2.39 kB
import type { WalletConnectConnector as WalletConnectConnectorType } from "../connectors/wallet-connect"; import type { QRModalOptions } from "../connectors/wallet-connect/qrModalOptions"; import { Connector } from "../interfaces/connector"; import { AbstractClientWallet, WalletOptions } from "./base"; import type { ImTokenConnector as ImTokenConnectorType } from "../connectors/imtoken"; type ImTokenAdditionalOptions = { qrcode?: boolean; projectId?: string; qrModalOptions?: QRModalOptions; }; export type ImTokenWalletOptions = WalletOptions<ImTokenAdditionalOptions>; type ConnectWithQrCodeArgs = { chainId?: number; onQrCodeUri: (uri: string) => void; onConnected: (accountAddress: string) => void; }; export declare class ImTokenWallet extends AbstractClientWallet<ImTokenAdditionalOptions> { connector?: Connector; walletConnectConnector?: WalletConnectConnectorType; imtokenConnector?: ImTokenConnectorType; isInjected: boolean; static meta: { name: string; iconURL: string; urls: { ios: string; android: string; }; }; static id: string; get walletName(): "imToken"; constructor(options: ImTokenWalletOptions); protected getConnector(): Promise<Connector>; /** * Connect to the wallet using a QR code. * You can use this method to display a QR code. The user can scan this QR code using the Trust Wallet mobile app to connect to your dapp. * * @example * ```typescript * wallet.connectWithQrCode({ * chainId: 1, * onQrCodeUri(qrCodeUri) { * // render the QR code with `qrCodeUri` * }, * onConnected(accountAddress) { * // update UI to show connected state * }, * }) * ``` * * @param options - * The options object contains the following properties/method: * * ### chainId (optional) * If provided, wallet will prompt the user to switch to the network with the given `chainId` after connecting. * * ### onQrCodeUri * A callback to get the QR code URI to display to the user. * * ### onConnected * A callback that is called when the user has connected their wallet using the QR code. */ connectWithQrCode(options: ConnectWithQrCodeArgs): Promise<void>; } export {}; //# sourceMappingURL=imtoken.d.ts.map