@fewcha/web3-react
Version:
Check the documentation at https://docs.fewcha.app/
44 lines (43 loc) • 1.41 kB
TypeScript
import React, { PropsWithChildren } from "react";
import { PublicAccount } from "@fewcha/web3/dist/types";
import Web3 from "@fewcha/web3";
export declare const Web3Context: React.Context<Web3ContextValue>;
declare type PopupProps = {};
declare type PopupType = (props: {
Component: React.FC<PopupProps>;
callback?: (key: string) => void;
}) => string;
export declare const useWeb3: () => {
account: PublicAccount;
balance: string;
disconnect: () => void;
currentWallet: "fewcha" | "martian";
isConnected: boolean;
network: string;
fewcha: Web3;
martian: Web3;
};
declare type Web3ContextValue = {
account: PublicAccount;
balance: string;
isConnected: boolean;
disconnect: () => void;
network: string;
addPopup: PopupType;
removePopup: (key: string) => void;
removeAll: () => void;
fewcha: Web3;
martian: Web3;
currentWallet: "fewcha" | "martian";
setCurrentWallet: (wallet: "fewcha" | "martian") => void;
chooseWeb3: (walletCodename: "fewcha" | "martian", callback: () => void) => Promise<void>;
};
declare const Web3ReactProvider: React.FC<PropsWithChildren<{}>>;
export default Web3ReactProvider;
declare type ConnectWalletProps = {
theme?: "light" | "dark";
type?: "list" | "grid";
label?: React.ReactElement;
padding?: "15px 30px";
};
export declare const ConnectWallet: React.FC<ConnectWalletProps>;