Function useCanMessage

This hook exposes both the client and static instances of the canMessage method.

  • Parameters

    • OptionalonError: ((error: Error) => void)
        • (error): void
        • Parameters

          • error: Error

          Returns void

    Returns {
        canMessage: (<T>(peerAddress: T) => Promise<CanMessageReturns<T>>);
        canMessageStatic: (<T>(peerAddress: T, options?: Partial<NetworkOptions>) => Promise<CanMessageReturns<T>>);
        error: null | Error;
        isLoading: boolean;
    }

    • canMessage: (<T>(peerAddress: T) => Promise<CanMessageReturns<T>>)
        • <T>(peerAddress): Promise<CanMessageReturns<T>>
        • Type Parameters

          • T extends string | string[]

          Parameters

          • peerAddress: T

          Returns Promise<CanMessageReturns<T>>

    • canMessageStatic: (<T>(peerAddress: T, options?: Partial<NetworkOptions>) => Promise<CanMessageReturns<T>>)
        • <T>(peerAddress, options?): Promise<CanMessageReturns<T>>
        • Type Parameters

          • T extends string | string[]

          Parameters

          • peerAddress: T
          • Optionaloptions: Partial<NetworkOptions>

          Returns Promise<CanMessageReturns<T>>

    • error: null | Error
    • isLoading: boolean