Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DefaultClient

The standard implementation of a DfuseClient.

The DefaultClient role is to perform the API key management functionalities of the client. It retrieves an API token using the API key and ensures it stays valid throughout the lifecycle of the client, refreshing the token when necessary.

It also responsible of keep and up-to-date list of streams and managing the re-connection to those stream when the websocket disconnects.

It is supported to override the client to provide some other methods on it (other EOS endpoints).

Hierarchy

  • DefaultClient

Implements

Index

Constructors

constructor

Properties

Protected apiKey

apiKey: string | undefined

Protected apiTokenManager

apiTokenManager: ApiTokenManager

Protected debug

debug: IDebugger = debugFactory("dfuse:client")

Readonly endpoints

Protected graphqlStreamClient

graphqlStreamClient: GraphqlStreamClient

Protected httpClient

httpClient: HttpClient

Protected id

id: number

Protected requestIdGenerator

requestIdGenerator: RequestIdGenerator

Protected streamClient

streamClient: StreamClient

Methods

apiRequest

authIssue

fetchBlockIdByTime

fetchTransaction

getTokenInfo

graphql

Protected registerStream

release

  • release(): void

searchTransactions

  • searchTransactions(q: string, options?: { blockCount?: undefined | number; cursor?: undefined | string; limit?: undefined | number; sort?: SearchSortType; startBlock?: undefined | number; withReversible?: undefined | false | true }): Promise<SearchTransactionsResponse>
  • Parameters

    • q: string
    • Default value options: { blockCount?: undefined | number; cursor?: undefined | string; limit?: undefined | number; sort?: SearchSortType; startBlock?: undefined | number; withReversible?: undefined | false | true } = {}
      • Optional blockCount?: undefined | number
      • Optional cursor?: undefined | string
      • Optional limit?: undefined | number
      • Optional sort?: SearchSortType
      • Optional startBlock?: undefined | number
      • Optional withReversible?: undefined | false | true

    Returns Promise<SearchTransactionsResponse>

stateAbi

  • stateAbi(account: string, options?: { blockNum?: undefined | number; json?: undefined | false | true }): Promise<StateAbiResponse>
  • Parameters

    • account: string
    • Default value options: { blockNum?: undefined | number; json?: undefined | false | true } = {}
      • Optional blockNum?: undefined | number
      • Optional json?: undefined | false | true

    Returns Promise<StateAbiResponse>

stateAbiBinToJson

  • stateAbiBinToJson<T>(account: string, table: string, hexRows: string[], options?: { blockNum?: undefined | number }): Promise<StateAbiToJsonResponse<T>>
  • Type parameters

    • T = unknown

    Parameters

    • account: string
    • table: string
    • hexRows: string[]
    • Default value options: { blockNum?: undefined | number } = {}
      • Optional blockNum?: undefined | number

    Returns Promise<StateAbiToJsonResponse<T>>

stateKeyAccounts

statePermissionLinks

stateTable

  • stateTable<T>(account: string, scope: string, table: string, options?: { blockNum?: undefined | number; json?: undefined | false | true; keyType?: StateKeyType; withAbi?: undefined | false | true; withBlockNum?: undefined | false | true }): Promise<StateResponse<T>>
  • Type parameters

    • T = unknown

    Parameters

    • account: string
    • scope: string
    • table: string
    • Default value options: { blockNum?: undefined | number; json?: undefined | false | true; keyType?: StateKeyType; withAbi?: undefined | false | true; withBlockNum?: undefined | false | true } = {}
      • Optional blockNum?: undefined | number
      • Optional json?: undefined | false | true
      • Optional keyType?: StateKeyType
      • Optional withAbi?: undefined | false | true
      • Optional withBlockNum?: undefined | false | true

    Returns Promise<StateResponse<T>>

stateTableRow

  • stateTableRow<T>(account: string, scope: string, table: string, primaryKey: string, options?: { blockNum?: undefined | number; json?: undefined | false | true; keyType?: StateKeyType; withAbi?: undefined | false | true; withBlockNum?: undefined | false | true }): Promise<StateTableRowResponse<T>>
  • Type parameters

    • T = unknown

    Parameters

    • account: string
    • scope: string
    • table: string
    • primaryKey: string
    • Default value options: { blockNum?: undefined | number; json?: undefined | false | true; keyType?: StateKeyType; withAbi?: undefined | false | true; withBlockNum?: undefined | false | true } = {}
      • Optional blockNum?: undefined | number
      • Optional json?: undefined | false | true
      • Optional keyType?: StateKeyType
      • Optional withAbi?: undefined | false | true
      • Optional withBlockNum?: undefined | false | true

    Returns Promise<StateTableRowResponse<T>>

stateTableScopes

  • stateTableScopes(account: string, table: string, options?: { blockNum?: undefined | number }): Promise<StateTableScopesResponse>

stateTablesForAccounts

  • stateTablesForAccounts<T>(accounts: string[], scope: string, table: string, options?: { blockNum?: undefined | number; json?: undefined | false | true; keyType?: StateKeyType; withAbi?: undefined | false | true; withBlockNum?: undefined | false | true }): Promise<MultiStateResponse<T>>
  • Type parameters

    • T = unknown

    Parameters

    • accounts: string[]
    • scope: string
    • table: string
    • Default value options: { blockNum?: undefined | number; json?: undefined | false | true; keyType?: StateKeyType; withAbi?: undefined | false | true; withBlockNum?: undefined | false | true } = {}
      • Optional blockNum?: undefined | number
      • Optional json?: undefined | false | true
      • Optional keyType?: StateKeyType
      • Optional withAbi?: undefined | false | true
      • Optional withBlockNum?: undefined | false | true

    Returns Promise<MultiStateResponse<T>>

stateTablesForScopes

  • stateTablesForScopes<T>(account: string, scopes: string[], table: string, options?: { blockNum?: undefined | number; json?: undefined | false | true; keyType?: StateKeyType; withAbi?: undefined | false | true; withBlockNum?: undefined | false | true }): Promise<MultiStateResponse<T>>
  • Type parameters

    • T = unknown

    Parameters

    • account: string
    • scopes: string[]
    • table: string
    • Default value options: { blockNum?: undefined | number; json?: undefined | false | true; keyType?: StateKeyType; withAbi?: undefined | false | true; withBlockNum?: undefined | false | true } = {}
      • Optional blockNum?: undefined | number
      • Optional json?: undefined | false | true
      • Optional keyType?: StateKeyType
      • Optional withAbi?: undefined | false | true
      • Optional withBlockNum?: undefined | false | true

    Returns Promise<MultiStateResponse<T>>

streamActionTraces

streamHeadInfo

streamTableRows

streamTransaction

websocketStream

Generated using TypeDoc