Type alias ConnectUIProps<I>

ConnectUIProps<I>: {
    connected: (() => void);
    goBack: (() => void);
    hide: (() => void);
    isOpen: boolean;
    modalSize: "compact" | "wide";
    onLocallyConnected?: ((walleInstance) => void);
    selectionData: any;
    setSelectionData: ((data) => void);
    show: (() => void);
    supportedWallets: WalletConfig[];
    theme: "dark" | "light";
    walletConfig: WalletConfig<I>;
}

Type Parameters

Type declaration

  • connected: (() => void)
      • (): void
      • when the wallet is connected, call this function to indicate that the wallet is connected and it is safe to close the Modal

        Returns void

  • goBack: (() => void)
      • (): void
      • go back to the wallet selector screen in connect wallet modal

        Returns void

  • hide: (() => void)
      • (): void
      • temporarily hide the ConnectModal This is useful when you want to open another modal and do not want to show the ConnectModal in the background

        Returns void

  • isOpen: boolean

    indicates whether the connect wallet modal is open or not

  • modalSize: "compact" | "wide"

    Size of the modal

    This is always compact on React Native

  • Optional onLocallyConnected?: ((walleInstance) => void)
      • (walleInstance): void
      • Called when the wallet is connected but it's part of another wallet's connection flow.

        Parameters

        Returns void

  • selectionData: any

    selectionData passed from selectUI's onSelect function

  • setSelectionData: ((data) => void)
      • (data): void
      • set selectionData

        Parameters

        • data: any

        Returns void

  • show: (() => void)
      • (): void
      • show the hidden connect wallet modal again

        Returns void

  • supportedWallets: WalletConfig[]

    List of all supported wallets including your wallet.

  • theme: "dark" | "light"

    theme of the connect wallet modal

  • walletConfig: WalletConfig<I>

    WalletConfig object of your wallet

    you can use this to connect to your wallet

    1. Using useConnect hook

     const connect = useConnect();

    // call this function to connect to your wallet
    async function handleConnect() {
    await connect(walletConfig, options);
    }

    OR

    2. Manually creating wallet instance and connecting

    const createWalletInstance = useCreateWalletInstance();
    const setConnectedWallet = useSetConnectedWallet();
    const setConnectionStatus = useSetConnectionStatus();

    // call this function to connect to your wallet
    async function handleConnect() {
    // create instance
    const walletInstance = createWalletInstance(walletConfig);
    // connect wallet
    setConnectionStatus('connecting);
    try {
    await walletInstance.connect(options);
    // set connected wallet
    setConnectedWallet(walletInstance);
    } catch {
    setConnectionStatus('disconnected');
    }
    }

Generated using TypeDoc