Options
All
  • Public
  • Public/Protected
  • All
Menu

A8Connect object class. The Ancient8 authentication will be handled and the session will be persisted inside this object.

Hierarchy

  • A8Connect

Index

Constructors

  • new A8Connect(rootSelectorId: string): A8Connect
  • Constructor to initialize the A8Connect Container

    Parameters

    • rootSelectorId: string

    Returns A8Connect

Properties

availableWallets: string[] = SupportedWallets

Current available wallets that A8Connect supports.

currentSession: A8ConnectSession = null

Current user session is initially set as null. After connecting wallet/login action, the currentSession will be available.

options: A8ConnectInitOptions = null

Init options for UID container.

rootNode: Root = null

Root node

rootSelectorId: string

Root node selector id

Methods

  • closeModal(): void
  • The function to close modal.

    Returns void

  • destroy(): void
  • The function to destroy root node.

    Returns void

  • fetchSession(forceConnectWallet?: boolean): Promise<void>
  • The function to restore session if possible, can be fail-safe. Normally the function won't connect if user has disconnected the wallet from DApp. Enable forceConnectWallet to bypass and try to connect regardless the wallet is connected or not.

    Parameters

    • forceConnectWallet: boolean = false

    Returns Promise<void>

  • The function to init the A8Connect session. The session will be updated whenever connecting wallet/login actions occur.

    Parameters

    Returns Promise<void>

  • initializeRegistry(): void
  • Initialize registry and session.

    Returns void

  • initializeRootNode(): void
  • The function to initialize root node.

    Returns void

  • initializeRootSelector(): void
  • Initialize root selector

    Returns void

  • initializeSession(): void
  • Construct session

    Returns void

  • isWalletStateValid(): Promise<boolean>
  • The function to check whether the wallet state is valid

    Returns Promise<boolean>

  • The function to be triggered after the authentication to grab the current session user.

    Parameters

    Returns void

  • The function to be triggered to grab the current connected wallet.

    Parameters

    Returns void

  • onDisconnected(): void
  • The function to be triggered whenever use disconnected wallet.

    Returns void

  • onLoggedOut(): void
  • The function to be triggered whenever use logged out from the current UID session.

    Returns void

  • openModal(): void
  • The function to open the UID modal

    Returns void

  • setCredential(jwt: string): void
  • The function to replace credential. Call this function to remove the old credential and replace with a new one. Set parameter to null to delete current credential.

    Parameters

    • jwt: string

    Returns void

Generated using TypeDoc