@pushchain/ui-kit
Version:
Push Chain is a true universal L1 that is 100% EVM compatible. It allows developers to deploy once and make their apps instantly compatible with users from all other L1s (Ethereum, Solana, etc) with zero on-chain code change.
45 lines (44 loc) • 2.4 kB
TypeScript
import React, { FC } from 'react';
import { PushChain, type SignAuthorizationParams, type SignedAuthorization } from '@pushchain/core';
import { ProgressEvent } from '@pushchain/core/src/lib/progress-hook/progress-hook.types';
import { ChainType, ConnectionStatus, IWalletProvider, ModalAppDetails, PushWalletProviderProps, UniversalAccount, WalletAppDetails, ThemeMode, ITypedData } from '../types';
import { ThemeOverrides } from '../styles/token';
export type WalletContextType = {
universalAccount: UniversalAccount | null;
connectionStatus: ConnectionStatus;
isWalletMinimised: boolean;
setMinimiseWallet: (isWalletMinimised: boolean) => void;
handleConnectToPushWallet: () => void;
handleUserLogOutEvent: () => void;
handleSignMessage: (data: Uint8Array) => Promise<Uint8Array>;
handleSignAndSendTransaction: (data: Uint8Array) => Promise<Uint8Array>;
handleSignTypedData: (data: ITypedData) => Promise<Uint8Array>;
handleSignAuthorization?: (params: SignAuthorizationParams) => Promise<SignedAuthorization>;
handleExternalWalletConnection: (data: {
chain: ChainType;
provider: IWalletProvider['name'];
}) => Promise<void>;
config: PushWalletProviderProps['config'];
app?: PushWalletProviderProps['app'];
modalAppData: ModalAppDetails | undefined;
updateModalAppData: (newData: Partial<ModalAppDetails>) => void;
walletAppData: WalletAppDetails | undefined;
updateWalletAppData: (newData: Partial<WalletAppDetails>) => void;
themeMode: ThemeMode;
themeOverrides: ThemeOverrides;
progress: ProgressEvent | null;
setProgress: React.Dispatch<React.SetStateAction<ProgressEvent | null>>;
isReadOnly: boolean;
setIsReadOnly: React.Dispatch<React.SetStateAction<boolean>>;
requestPushWalletConnection: () => Promise<{
chain: ChainType;
provider: IWalletProvider['name'];
}>;
checkAndShowUpgradeIfNeeded: (pushChainClient: PushChain) => Promise<boolean>;
activeTriggerId: string | undefined;
setActiveTriggerId: React.Dispatch<React.SetStateAction<string | undefined>>;
toggleButtonRefs: React.MutableRefObject<Record<string, HTMLDivElement | null>>;
connectionType: 'social' | 'external';
};
export declare const WalletContext: React.Context<WalletContextType | null>;
export declare const WalletContextProvider: FC<PushWalletProviderProps>;