Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TradeManager

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Readonly cache

cache: Map<string, Trade> = ...

The cache of the manager.

Readonly client

client: Client

Protected Optional Readonly extras

extras: []

Protected Readonly hold

hold: typeof Trade

Readonly stellar

stellar: StellarClient

Methods

add

  • add(data: TradeRecord, cache?: boolean): Trade

Optional fetch

  • fetch(key: string, cache?: boolean, checkCache?: boolean): Promise<undefined | Trade>
  • Fetches the data from Pi Network APIs (or return the cached element, if cache is true).

    Parameters

    • key: string

      The data's key (id, etc.).

    • Optional cache: boolean

      If the data should be cached (or cached data patched), true by default.

    • Optional checkCache: boolean

      If the cached data should be returned (if it exists) rather than fetching the data, true by default.

    Returns Promise<undefined | Trade>

    The the fetched (or cached) data, or undefined if not found.

resolve

  • resolve(key: string): undefined | Trade

Generated using TypeDoc