@0xfutbol/id
Version:
React component library with shared providers for 0xFutbol ID
61 lines (60 loc) • 2.2 kB
TypeScript
import { ChainName } from "@0xfutbol/constants";
import { BigNumber, Contract, Signer } from "ethers";
import * as React from "react";
export declare const WALLET_OPTIONS: ({
key: string;
label: string;
description: string;
icon: import("react/jsx-runtime").JSX.Element;
provider: string;
component: () => import("react/jsx-runtime").JSX.Element;
wallet: () => import("thirdweb/wallets").Wallet<"inApp">;
} | {
key: string;
label: string;
description: string;
icon: import("react/jsx-runtime").JSX.Element;
provider: string;
wallet: () => undefined;
component?: undefined;
} | {
key: string;
label: string;
description: string;
icon: import("react/jsx-runtime").JSX.Element;
provider: string;
component: () => import("react/jsx-runtime").JSX.Element;
wallet: () => import("thirdweb/wallets").Wallet<"io.metamask">;
} | {
key: string;
label: string;
description: string;
icon: import("react/jsx-runtime").JSX.Element;
provider: string;
wallet: () => import("thirdweb/wallets").Wallet<"walletConnect">;
component?: undefined;
})[];
type Web3ContextProviderProps = {
chains: Array<ChainName>;
children: React.ReactNode;
};
export type Web3ContextState = {
address?: string;
defaultChain?: ChainName;
signer?: Record<ChainName, Signer>;
status: "disconnected" | "connecting" | "connected" | "unknown";
userDetails?: Array<{
provider: string;
} & Record<string, any>>;
walletProvider: "matchain_id" | "thirdweb" | "unknown";
web3Ready: boolean;
connect: (walletKey: string) => Promise<void>;
disconnect: () => Promise<void>;
nativeBalanceOf: (address: string, chainId: number) => Promise<BigNumber>;
newContract: (chain: ChainName, contractAddress: string, contractAbi: any) => Contract;
switchChain: (chain: ChainName) => Promise<void>;
};
export declare const Web3Context: React.Context<Web3ContextState | undefined>;
export declare function Web3ContextProvider({ chains, children }: Web3ContextProviderProps): import("react/jsx-runtime").JSX.Element;
export declare const useWeb3Context: () => Web3ContextState;
export {};