Constructors

Methods

  • Attempts to connect to IMX silently without user interaction.

    Returns Promise<null | IMXProvider>

    A promise that resolves to an IMX provider if successful, or null if no cached session exists

    The method login with an argument of { useCachedSession: true } should be used in conjunction with connectImx instead

  • Connects to IMX, prompting user interaction if necessary.

    Returns Promise<IMXProvider>

    A promise that resolves to an IMX provider

  • Connects to EVM and optionally announces the provider.

    Parameters

    Returns Promise<Provider>

    The EVM provider instance

  • Initiates the login process.

    Parameters

    Returns Promise<null | UserProfile>

    A promise that resolves to the user profile if logged in, null otherwise

    If retrieving the cached user session fails (except for "Unknown or invalid refresh token" errors) and useCachedSession is true

  • Handles the login callback.

    Returns Promise<void>

    A promise that resolves when the callback is processed

  • Initiates a PKCE flow login.

    Parameters

    • OptionaldirectLoginOptions: DirectLoginOptions

      If provided, directly redirects to the specified login method

    • OptionalimPassportTraceId: string

      The trace ID for the PKCE flow

    Returns Promise<string>

    The authorization URL for the PKCE flow

  • Handles the PKCE flow login callback.

    Parameters

    • authorizationCode: string

      The authorization code received from the OAuth provider

    • state: string

      The state parameter for CSRF protection

    Returns Promise<UserProfile>

    A promise that resolves to the user profile

  • Logs out the current user.

    Returns Promise<void>

    A promise that resolves when the logout is complete

  • Returns the logout URL for the current user.

    Returns Promise<null | string>

    The logout URL

  • Handles the silent logout callback.

    Parameters

    • url: string

      The callback URL to process

    Returns Promise<void>

    A promise that resolves when the silent logout is complete

  • Retrieves the current user's information.

    Returns Promise<undefined | UserProfile>

    A promise that resolves to the user profile if logged in, undefined otherwise

  • Retrieves the current user's ID token.

    Returns Promise<undefined | string>

    A promise that resolves to the ID token if available, undefined otherwise

  • Retrieves the current user's access token.

    Returns Promise<undefined | string>

    A promise that resolves to the access token if available, undefined otherwise

  • Retrieves the addresses linked to the current user's account.

    Returns Promise<string[]>

    A promise that resolves to an array of linked addresses

  • Links an external wallet to the current user's account.

    Parameters

    Returns Promise<LinkedWallet>

    A promise that resolves to the linked wallet information

    When:

    • User is not logged in (NOT_LOGGED_IN_ERROR)
    • User is not registered (USER_NOT_REGISTERED_ERROR)
    • Wallet is already linked (LINK_WALLET_ALREADY_LINKED_ERROR)
    • Maximum number of wallets reached (LINK_WALLET_MAX_WALLETS_LINKED_ERROR)
    • Duplicate nonce used (LINK_WALLET_DUPLICATE_NONCE_ERROR)
    • Validation fails (LINK_WALLET_VALIDATION_ERROR)
    • Other generic errors (LINK_WALLET_GENERIC_ERROR)