use-midnight
Version:
A React hook to use Midnight in the browser
19 lines (18 loc) • 691 B
TypeScript
import React from "react";
import type { JSX } from "react";
import type { DAppConnectorWalletAPI, ServiceUriConfig } from "@midnight-ntwrk/dapp-connector-api";
export type Midnight = {
apiVersion: string;
isLaceInstalled: boolean;
isEnabled: boolean;
userAddress: undefined | string;
serviceUriConfig?: ServiceUriConfig;
walletApi?: DAppConnectorWalletAPI;
enable?: () => Promise<DAppConnectorWalletAPI>;
};
export type MidnightButtonProps = {
styles?: React.CSSProperties;
subscribe?: (mn: Midnight) => void;
};
export declare const useMidnight: () => Promise<Midnight>;
export declare const MidnightButton: (props: MidnightButtonProps) => JSX.Element;