starknetkit
Version:
<!-- logo --> <p align="center"> <img width='300' src="https://starknetkit-website-git-blo-1541-argentlabs.vercel.app/starknetKit-logo.svg"> </p>
49 lines (47 loc) • 3.09 kB
TypeScript
import { DisconnectOptions } from '@starknet-io/get-starknet';
import { StarknetWindowObject } from '@starknet-io/types-js';
import { ConnectOptions, ConnectOptionsWithConnectors, ModalResult } from './types/modal';
import { Connector, StarknetkitConnector, ConnectorData } from './connectors';
import { defaultConnectors } from './helpers/defaultConnectors';
/**
*
* @param [modalMode="canAsk"] - Choose connection behavior:
* - "canAsk" - Connect silently if possible, if not prompt a user with the modal
* - "alwaysAsk" - Always prompt a user with the modal
* - "neverAsk" - Connect silently if possible, if not fail gracefully
* @param [storeVersion=Current browser] - Name of the targeted store extension (chrome, firefox, or edge); It will select current browser by default
* @param [modalTheme] - Theme color
* @param [dappName] - Name of your dapp, displayed in the modal
* @param [resultType="wallet"] - It will by default return selected wallet's connector by default, otherwise null
* @param [connectors] - Array of wallet connectors to show in the modal
* @param [skipEmit] - Needed for internal handling of useStarknetkitConnectModal hook
* @param [webWalletUrl="https://web.ready.co"] - Link to Ready's web wallet - Mainnet env by default, if as a dApp for integration and testing purposes, you need access to an internal testnet environment, please contact Ready
* @param [argentMobileOptions] - Ready Mobile connector options - used only when `connectors` is not explicitly passed
* @param [argentMobileOptions.dappName] - Name of the dapp
* @param [argentMobileOptions.projectId] - WalletConnect project id
* @param [argentMobileOptions.chainId] - Starknet chain ID (SN_MAIN or SN_SEPOLIA)
* @param [argentMobileOptions.description] - Dapp description
* @param [argentMobileOptions.url] - Dapp url
* @param [argentMobileOptions.icons] - Icon to show in the modal
* @param [argentMobileOptions.rpcUrl] - Custom RPC url
*
* @returns {
* wallet: Selected wallet or null,
* connectorData: Selected account and chain ID, or null
* connector: Selected connector
* }
*/
export declare const connect: ({ modalMode, storeVersion, modalTheme, dappName, resultType, skipEmit, ...restOptions }: ConnectOptionsWithConnectors | ConnectOptions) => Promise<ModalResult>;
/**
* @returns Selected wallet if user was previously successfully connected, otherwise null
*/
export declare const getSelectedConnectorWallet: () => StarknetWindowObject | null;
/**
*
* @param [options] - Options
* @param [options.clearLastWallet] - Clear last connected wallet
*/
export declare const disconnect: (options?: DisconnectOptions) => Promise<void>;
export type { Connector, ConnectorData, DisconnectOptions, StarknetWindowObject, StarknetkitConnector, defaultConnectors as starknetkitDefaultConnectors, ConnectOptions, ConnectOptionsWithConnectors, };
export type * from './types/modal';
export { useStarknetkitConnectModal } from './hooks/useStarknetkitConnectModal';