Current account data.

Hierarchy (View Summary)

  • DataEntity<
        {
            balance: BalanceData;
            expiresAt?: Date;
            network: null
            | SupernetType;
            networkStatus: "connected" | "disconnected" | "connecting";
            token: null | string;
            username?: string;
            walletAddress?: string;
        },
    >
    • CurrentAccount

Constructors

  • Parameters

    • Optionaldata: {
          balance: BalanceData;
          expiresAt?: Date;
          network: null | SupernetType;
          networkStatus: "connected" | "disconnected" | "connecting";
          token: null | string;
          username?: string;
          walletAddress?: string;
      }

    Returns CurrentAccount

Properties

data: {
    balance: BalanceData;
    expiresAt?: Date;
    network: null | SupernetType;
    networkStatus: "connected" | "disconnected" | "connecting";
    token: null | string;
    username?: string;
    walletAddress?: string;
}
listeners: { updated?: (data: string[]) => void[] } = {}

Accessors

  • get networkStatus(): "connected" | "disconnected" | "connecting"
  • Returns "connected" | "disconnected" | "connecting"

Methods

  • Dispatch an event to all listeners

    Type Parameters

    • T extends "updated"

    Parameters

    • event: T
    • data: { updated: string[] }[T]

    Returns void

  • Remove an event listener

    Type Parameters

    • T extends "updated"

    Parameters

    • event: T
    • listener: (data: { updated: string[] }[T]) => void

    Returns void

  • Add an event listener, returns a function that can be called to remove the listener

    Type Parameters

    • T extends "updated"

    Parameters

    • event: T
    • listener: (data: { updated: string[] }[T]) => void

    Returns () => void

  • Add an event listener that will be called only once

    Type Parameters

    • T extends "updated"

    Parameters

    • event: T
    • listener: (data: { updated: string[] }[T]) => void

    Returns () => void

  • Get a copy of the entity's data

    Returns {
        balance: BalanceData;
        expiresAt?: Date;
        network: null | SupernetType;
        networkStatus: "connected" | "disconnected" | "connecting";
        token: null | string;
        username?: string;
        walletAddress?: string;
    }