@0xfutbol/id
Version:
React component library with shared providers for 0xFutbol ID
32 lines (31 loc) • 1.39 kB
TypeScript
import { ChainName } from "@0xfutbol/constants";
import React, { ReactNode } from "react";
import { BigNumber, Signer } from "ethers";
type MatchIdContextProviderProps = {
chains: Array<ChainName>;
children: ReactNode;
};
export declare const MatchIdContext: React.Context<{
address: string | undefined;
chainId: number;
signer: Record<"base" | "boba" | "matchain" | "polygon" | "skaleNebula" | "xdc", Signer> | undefined;
status: "connected" | "unknown" | "disconnected";
web3Ready: boolean;
connect: () => Promise<void>;
disconnect: () => Promise<void>;
nativeBalanceOf: (address: string, chainId: number) => Promise<BigNumber>;
switchChain: (chain: ChainName) => Promise<void>;
} | undefined>;
export declare function MatchIdContextProvider({ chains, children }: MatchIdContextProviderProps): import("react/jsx-runtime").JSX.Element;
export declare const useMatchIdContext: () => {
address: string | undefined;
chainId: number;
signer: Record<"base" | "boba" | "matchain" | "polygon" | "skaleNebula" | "xdc", Signer> | undefined;
status: "connected" | "unknown" | "disconnected";
web3Ready: boolean;
connect: () => Promise<void>;
disconnect: () => Promise<void>;
nativeBalanceOf: (address: string, chainId: number) => Promise<BigNumber>;
switchChain: (chain: ChainName) => Promise<void>;
};
export {};