@0xfutbol/id
Version:
React component library with shared providers for 0xFutbol ID
34 lines (33 loc) • 1.39 kB
TypeScript
import { ChainName } from "@0xfutbol/constants";
import { BigNumber, Contract, Signer } from "ethers";
import * as React from "react";
import { Web3ContextState } from "@/providers/Web3Context";
import { AuthStatus } from "@/providers/types";
type OxFutbolIdProviderProps = {
backendUrl: string;
chains: Array<ChainName>;
children: React.ReactNode;
};
type OxFutbolIdState = {
address?: string;
defaultChain?: ChainName;
signer?: Record<ChainName, Signer>;
status: string;
userDetails?: Web3ContextState["userDetails"];
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>;
authStatus: AuthStatus;
isClaimPending: boolean;
isWaitingForSignature: boolean;
username?: string;
userClaims?: Record<string, any>;
claim: (username: string) => Promise<void>;
};
export declare const OxFutbolIdContext: React.Context<OxFutbolIdState | undefined>;
export declare function OxFutbolIdProvider({ backendUrl, chains, children }: OxFutbolIdProviderProps): import("react/jsx-runtime").JSX.Element;
export {};