UNPKG

@leapwallet/embedded-wallet-sdk-react

Version:

A react library for integrating metamask snaps on a cosmos dApp

46 lines (45 loc) 1.47 kB
import React from "react"; import { WalletType } from "graz"; import { Prettify } from "../../../core/src/utils"; export type WalletContextTypeExternal = { /** * Trigger the wallet connect flow of the dApp */ connectWallet: () => void; /** * Trigger the wallet disconnect flow of the dApp */ disconnectWallet: () => void; /** * The connected wallet {@link WalletType} */ connectedWalletType: WalletType | undefined; /** * Primary chain ID * * @default 'cosmoshub-4' */ primaryChainId?: string; /** * Chain IDs to be used for fetching balances */ chains?: string[]; }; export type WalletContextTypeInternal = { userAddress: string | undefined; isMainnet: boolean; isLedgerWallet: boolean; }; export type WalletContextType = Prettify<WalletContextTypeExternal & WalletContextTypeInternal & { primaryChainId: string; walletName: string | undefined; }>; export type WalletContextProviderProps = Prettify<React.PropsWithChildren<WalletContextTypeExternal>>; /** * WalletContextProvider is a internally used context provider, * which provides various modules with wallet related information */ export declare const WalletContextProvider: React.FC<WalletContextProviderProps>; export { WalletType }; export declare const useWalletClientContext: () => WalletContextType; export declare const useWalletClientContextUnsafe: () => WalletContextType | null;