Function NaviWidgetProvider

NaviWidgetProvider component that provides context and manages the state and events for the Navi widget.

  • Parameters

    • props: {
          children: ReactNode;
          client: SwapPanelClient;
          defaultTheme?: Theme;
          onClickConnect?: () => void;
          onHide?: () => void;
          onReady?: (cb: () => void) => void;
          onShow?: () => void;
          onSignTransaction: (
              tx: Transaction,
          ) => Promise<{ bytes: string; signature: string }>;
          onSwapSuccess?: (event: SwapSuccessEvent) => void;
          operator?: string;
      }

      The properties object.

      • children: ReactNode

        The child components to be rendered within the provider.

      • client: SwapPanelClient

        The client instance for interacting with the swap panel.

      • OptionaldefaultTheme?: Theme

        The default theme for the widget, either "dark" or "light".

      • OptionalonClickConnect?: () => void

        Callback function to handle the connect button click event.

      • OptionalonHide?: () => void

        Callback function to handle the widget hide event.

      • OptionalonReady?: (cb: () => void) => void

        Callback function to handle the widget ready event.

      • OptionalonShow?: () => void

        Callback function to handle the widget show event.

      • onSignTransaction: (tx: Transaction) => Promise<{ bytes: string; signature: string }>

        Callback function to handle transaction signing.

      • OptionalonSwapSuccess?: (event: SwapSuccessEvent) => void

        Callback function to handle the swap success event.

      • Optionaloperator?: string

        The operator's address.

    Returns Element

    The NaviWidgetProvider component that wraps its children with the NaviWidgetContext provider.