Options
All
  • Public
  • Public/Protected
  • All
Menu

@dfuse/client

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

Abi

Abi: { abi_extensions: AbiExtension[]; actions: AbiAction[]; error_messages: AbiErrorMessage[]; ricardian_clauses: AbiRicardianClause[]; structs: AbiStruct[]; tables: AbiTable[]; types: AbiType[]; variants?: AbiVariant[]; version: string }

The actual ABI JSON representation as returned by EOSIO platform. Extracted from EOSIO/eosjs library.

see

https://github.com/EOSIO/eosjs/blob/develop/src/eosjs-rpc-interfaces.ts#L4

Type declaration

AbiAction

AbiAction: { name: string; ricardian_contract: string; type: string }

Type declaration

  • name: string
  • ricardian_contract: string
  • type: string

AbiErrorMessage

AbiErrorMessage: { error_code: string; error_msg: string }

Type declaration

  • error_code: string
  • error_msg: string

AbiExtension

AbiExtension: { tag: number; value: string }

Type declaration

  • tag: number
  • value: string

AbiRicardianClause

AbiRicardianClause: { body: string; id: string }

Type declaration

  • body: string
  • id: string

AbiStruct

AbiStruct: { base: string; fields: AbiStructField[]; name: string }

Type declaration

AbiStructField

AbiStructField: { name: string; type: string }

Type declaration

  • name: string
  • type: string

AbiTable

AbiTable: { index_type: string; key_names?: string[]; key_types?: string[]; name: string; type: string }

Type declaration

  • index_type: string
  • Optional key_names?: string[]
  • Optional key_types?: string[]
  • name: string
  • type: string

AbiType

AbiType: { new_type_name: string; type: string }

Type declaration

  • new_type_name: string
  • type: string

AbiVariant

AbiVariant: { name: string; types: string[] }

Type declaration

  • name: string
  • types: string[]

AccountRamDelta

AccountRamDelta: { account: string; delta: Int64 }

Type declaration

  • account: string
  • delta: Int64

Action

Action<T>: { account: string; authorization?: Authorization[]; data: T; hex_data?: undefined | string; name: string }

Type parameters

  • T

Type declaration

  • account: string
  • Optional authorization?: Authorization[]
  • data: T
  • Optional hex_data?: undefined | string
  • name: string

ActionReceipt

ActionReceipt: { abi_sequence: number; act_digest: string; auth_sequence: [string, number][]; code_sequence: number; global_sequence: Uint64; receiver: string; recv_sequence: Uint64 }

Type declaration

  • abi_sequence: number
  • act_digest: string
  • auth_sequence: [string, number][]
  • code_sequence: number
  • global_sequence: Uint64
  • receiver: string
  • recv_sequence: Uint64

ActionTrace

ActionTrace<T>: { account_ram_deltas?: AccountRamDelta[]; act: Action<T>; block_num: number; block_time: string; console: string; context_free: boolean; elapsed: number; except?: any; inline_traces?: ActionTrace<any>[]; producer_block_id?: undefined | string; receipt: ActionReceipt; trx_id: string }

Type parameters

  • T

Type declaration

  • Optional account_ram_deltas?: AccountRamDelta[]
  • act: Action<T>
  • block_num: number
  • block_time: string
  • console: string
  • context_free: boolean
  • elapsed: number
  • Optional except?: any
  • Optional inline_traces?: ActionTrace<any>[]
  • Optional producer_block_id?: undefined | string
  • receipt: ActionReceipt
  • trx_id: string

ActionTraceData

ActionTraceData<T>: { block_id: string; block_num: number; block_time: string; dbops?: ActionTraceDbOp[]; depth: number; dtrxops?: DTrxOp[]; idx: number; ramops?: RamOp[]; tableops?: TableOp[]; trace: ActionTrace<T>; trx_id: string }

Type parameters

  • T = Record<string, any>

Type declaration

  • block_id: string
  • block_num: number
  • block_time: string
  • Optional dbops?: ActionTraceDbOp[]
  • depth: number
  • Optional dtrxops?: DTrxOp[]
  • idx: number
  • Optional ramops?: RamOp[]
  • Optional tableops?: TableOp[]
  • trace: ActionTrace<T>
  • trx_id: string

ActionTraceDbOp

ActionTraceDbOp: { action_idx: number; new?: undefined | string; npayer?: undefined | string; old?: undefined | string; op: "INS" | "UPD" | "REM"; opayer?: undefined | string; path: string }

The dbops array out of an ActionTraceData message is completely different than other DbOp found in dfuse API (like on TableDeltaData or TransactionLifecycle).

One for opayer or npayer will always be present depending on the operation, same thing for the old and new fields:

  • When op == "INS", npayer and new are present
  • When op == "UPD", opayer, old, npayer and new are present
  • When op == "REM", opayer and old are present

The old and new fields are the hexadecimal string encoded representing the row in binary format.

Check the Decode Hex Data using eosjs example for a way to transform the hexadecimal string into a JSON structure representing the row.

see

https://github.com/dfuse-io/example-eosjs-decode-hex

Type declaration

  • action_idx: number
  • Optional new?: undefined | string

    The hexadecimal string encoded representing the new version of the row in binary format. Present when op == "INS" | "UPD".

  • Optional npayer?: undefined | string

    The account which is the new payer of the row. Present when op == "UPD" | "REM".

  • Optional old?: undefined | string

    The hexadecimal string encoded representing the old version of the row in binary format. Present when op == "UPD" | "REM".

  • op: "INS" | "UPD" | "REM"
  • Optional opayer?: undefined | string

    The account which was the old payer of the row. Present when op == "UPD" | "REM".

  • path: string

    The full path of the database row, it's a string with four elements of the row path separated with the / character being respectively from left to right: account, scope, table, row primary key (name encoded).

    "eosio.token/trustdicewin/accounts/........ehbo5"
    
    {
      account: "eosio.token",
      scope: "trustdicewin",
      table: "accounts",
      key: "........ehbo5", // Name encoded value representing `EOS` SymbolCode
    }

ActionTraceInboundMessage

ActionTraceInboundMessage<T>: InboundMessage<ActionTraceData<T>>

Type parameters

  • T = Record<string, any>

ApiTokenInfo

ApiTokenInfo: { expires_at: number; token: string }

Type declaration

  • expires_at: number
  • token: string

AuthTokenResponse

AuthTokenResponse: ApiTokenInfo

Authorization

Authorization: { actor: string; permission: string }

Type declaration

  • actor: string
  • permission: string

BlockHeader

BlockHeader: { action_mroot: string; confirmed: number; header_extensions: any[]; new_producers: null; previous: string; producer: string; schedule_version: number; timestamp: string; transaction_mroot: string }

Type declaration

  • action_mroot: string
  • confirmed: number
  • header_extensions: any[]
  • new_producers: null
  • previous: string
  • producer: string
  • schedule_version: number
  • timestamp: string
  • transaction_mroot: string

BlockIdByTimeResponse

BlockIdByTimeResponse: { block: { id: string; num: number; time: string } }

Type declaration

  • block: { id: string; num: number; time: string }
    • id: string
    • num: number
    • time: string

ComparisonOperator

ComparisonOperator: "gt" | "gte" | "lt" | "lte" | "eq"

CompleteGraphqlStreamMessage

CompleteGraphqlStreamMessage: { type: "complete" }

Represents the completion of the streaming in a correct maner. This message means that messages will never be received anymore for this stream, even if it's restarted.

Type declaration

  • type: "complete"

ConnectOptions

ConnectOptions: SocketConnectOptions

CreationNode

CreationNode: [number, number, number]

Represents a node in the creation tree. first number represents the creation node index second number represents the parent node index (-1 for root) third number represents the action index

DBOp

DBOp<T>: DbOp<T>
deprecated

Renamed to DbOp

Type parameters

  • T = unknown

DTrxOp

DTrxOp: { action_idx: number; delay_until: string; expiration_at: string; op: "CREATE" | "PUSH_CREATE" | "MODIFY_CREATE" | "MODIFY_CANCEL" | "CANCEL"; payer: string; published_at: string; sender: string; sender_id: string; trx?: Transaction; trx_id: string }

Type declaration

  • action_idx: number
  • delay_until: string
  • expiration_at: string
  • op: "CREATE" | "PUSH_CREATE" | "MODIFY_CREATE" | "MODIFY_CANCEL" | "CANCEL"
  • payer: string
  • published_at: string
  • sender: string
  • sender_id: string
  • Optional trx?: Transaction
  • trx_id: string

DataGraphqlStreamMessage

DataGraphqlStreamMessage<T>: { data: T; type: "data" }

Represents a valid data result for which the payload of type T will be available for consumption in the data field.

Type parameters

  • T

Type declaration

  • data: T
  • type: "data"

DbOp

DbOp<T>: { account: string; action_idx: number; key: string; new?: DbRow<T>; old?: DbRow<T>; op: "ins" | "INS" | "upd" | "UPD" | "rem" | "REM"; scope: string; table: string }

Type parameters

  • T = unknown

Type declaration

  • account: string
  • action_idx: number
  • key: string
  • Optional new?: DbRow<T>
  • Optional old?: DbRow<T>
  • op: "ins" | "INS" | "upd" | "UPD" | "rem" | "REM"

    This is a quirk of dfuse API, it's recommended to do a lower case comparison on the op field.

  • scope: string
  • table: string

DbRow

DbRow<T>: { blockNum?: undefined | string; error?: ErrorData; hex?: undefined | string; json?: T; payer: string }

One of error, hex or json field will be present depending on the actual request made.

Type parameters

  • T = unknown

Type declaration

  • Optional blockNum?: undefined | string
  • Optional error?: ErrorData
  • Optional hex?: undefined | string
  • Optional json?: T
  • payer: string

DfuseClientEndpoints

DfuseClientEndpoints: { authUrl: string; graphqlQueryUrl: string; graphqlStreamUrl: string; restUrl: string; websocketUrl: string }

Type declaration

  • authUrl: string
  • graphqlQueryUrl: string
  • graphqlStreamUrl: string
  • restUrl: string
  • websocketUrl: string

ErrorData

ErrorData: { code: string; details?: undefined | {}; message: string; trace_id?: undefined | string }

Type declaration

  • code: string
  • Optional details?: undefined | {}
  • message: string
  • Optional trace_id?: undefined | string

ErrorGraphqlStreamMessage

ErrorGraphqlStreamMessage: { errors: Error[]; terminal: boolean; type: "error" }

Represents an error message received from the stream. Both resolvers error as well as stream error will fall into this type. When terminal is sets to true, this message is a stream error meaning the stream should terminate and cannot continue.

Note Only when it's a terminal error and auto restart on error is sets to true on the GraphQL stream client that the stream will auto-restart.

Type declaration

  • errors: Error[]
  • terminal: boolean
  • type: "error"

ErrorInboundMessage

ErrorInboundMessage: InboundMessage<ErrorData>

ExtDTrxOp

ExtDTrxOp: { block_id: string; block_num: number; block_time: string; src_trx_id: string } & DTrxOp

GetActionTracesMessageData

GetActionTracesMessageData: { accounts: string; action_names?: undefined | string; receivers?: undefined | string; with_dbops?: undefined | false | true; with_dtrxops?: undefined | false | true; with_inline_traces?: undefined | false | true; with_ramops?: undefined | false | true; with_tableops?: undefined | false | true }

Type declaration

  • accounts: string
  • Optional action_names?: undefined | string
  • Optional receivers?: undefined | string
  • Optional with_dbops?: undefined | false | true
  • Optional with_dtrxops?: undefined | false | true
  • Optional with_inline_traces?: undefined | false | true
  • Optional with_ramops?: undefined | false | true
  • Optional with_tableops?: undefined | false | true

GetTableRowsMessageData

GetTableRowsMessageData: { code: string; json?: undefined | false | true; lower_bound?: undefined | string; scope: string; table: string; upper_bound?: undefined | string }

Type declaration

  • code: string
  • Optional json?: undefined | false | true
  • Optional lower_bound?: undefined | string
  • scope: string
  • table: string
  • Optional upper_bound?: undefined | string

GetTransactionLifecycleMessageData

GetTransactionLifecycleMessageData: { id: string }

Type declaration

  • id: string

GraphqlDocument

GraphqlDocument: string | { definitions: ReadonlyArray<unknown>; kind: "Document"; loc?: Record<string, unknown> }

GraphqlInboundMessage

GraphqlInboundMessage: { type: "connection_ack" } | { payload: Error; type: "connection_error" } | { type: "ka" } | { id: string; payload: { data: any; errors?: Error[] }; type: "data" } | { id: string; payload: Error; type: "error" } | { id: string; type: "complete" }

GraphqlInboundMessageType

GraphqlInboundMessageType: "connection_ack" | "connection_error" | "ka" | "data" | "error" | "complete"

GraphqlOperationType

GraphqlOperationType: "query" | "mutation" | "subscription"

GraphqlOutboundMessage

GraphqlOutboundMessage: { payload?: Record<string, unknown>; type: "connection_init" } | { id: string; type: "stop" } | GraphqlStartOutboundMessage | { type: "connection_terminate" }

GraphqlResponse

GraphqlResponse<T>: { data: T; errors?: GraphqlResponseError[] }

Type parameters

  • T

Type declaration

GraphqlResponseError

GraphqlResponseError: { extensions?: Record<string, unknown>; locations?: { column: number; line: number }[]; message: string; path?: (string | number)[] }

Type declaration

  • Optional extensions?: Record<string, unknown>
  • Optional locations?: { column: number; line: number }[]
  • message: string
  • Optional path?: (string | number)[]

GraphqlStartOutboundMessage

GraphqlStartOutboundMessage: { id: string; payload: { operationName?: undefined | string; query: GraphqlDocument; variables?: GraphqlVariables }; type: "start" }

Type declaration

GraphqlStreamMessage

Type parameters

  • T = unknown

GraphqlVariables

GraphqlVariables: Record<string, unknown> | (() => Promise<Record<string, unknown>>) | (() => Record<string, unknown>) | undefined

HeadInfoData

HeadInfoData: { head_block_id: string; head_block_num: number; head_block_producer: string; head_block_time: string; last_irreversible_block_id: string; last_irreversible_block_num: number }

Type declaration

  • head_block_id: string
  • head_block_num: number
  • head_block_producer: string
  • head_block_time: string
  • last_irreversible_block_id: string
  • last_irreversible_block_num: number

HeadInfoInboundMessage

HeadInfoInboundMessage: InboundMessage<HeadInfoData>

HttpHeaders

HttpHeaders: Record<string, string>

HttpQueryParameters

HttpQueryParameters: Record<string, any>

InboundMessage

InboundMessage<T>: { data: T; req_id?: undefined | string; type: InboundMessageType }

Type parameters

  • T = any

Type declaration

Int64

Int64: number | string

A int64_t natively in nodeos but can become a string when > 32 bits number due to how nodeos serialize number to JSON.

This is like because JavaScript largest number possible is 53 bits large which make it impossible to hold a full int64_t type. To overcome that, nodeos will output a string when number is too large to preserve precision.

LinkedPermission

LinkedPermission: { action: string; contract: string; permission_name: string }

Type declaration

  • action: string
  • contract: string
  • permission_name: string

ListeningData

ListeningData: { next_block: number }

Type declaration

  • next_block: number

ListeningInboundMessage

ListeningInboundMessage: InboundMessage<ListeningData>

MultiStateResponse

MultiStateResponse<T>: { abi?: Abi; last_irreversible_block_id: string; last_irreversible_block_num: number; tables: TableRows<T>[]; up_to_block_id?: undefined | string; up_to_block_num?: undefined | number }

Type parameters

  • T = unknown

Type declaration

  • Optional abi?: Abi
  • last_irreversible_block_id: string
  • last_irreversible_block_num: number
  • tables: TableRows<T>[]
  • Optional up_to_block_id?: undefined | string
  • Optional up_to_block_num?: undefined | number

OnGraphqlStreamMessage

OnGraphqlStreamMessage<T>: (message: GraphqlStreamMessage<T>, stream: Stream) => void

Handler invoked when a message is routed to this exact stream via the matching of the message id and the stream id. If this is invoked, you are guaranteed to received a message for your stream.

param

The actual inbound GraphQL message received destinated to you.

param

The actual stream object on which the handler is defined, can be used to mark the stream at right location or close it eagerly.

Type parameters

  • T = unknown

Type declaration

OnGraphqlStreamRestart

OnGraphqlStreamRestart: () => void

Type declaration

    • (): void
    • Returns void

OnStreamMessage

OnStreamMessage: (message: InboundMessage, stream: Stream) => void

Handler invoked when a message is routed to this exact stream via the matching of the message id and the stream id. If this is invoked, you are guaranteed to received a message for your stream.

param

The actual inbound WebSocket message received destinated to you

param

The actual stream object on which the handler is defined, can be used to mark the stream at right location or close it eagerly.

Type declaration

OnStreamRestart

OnStreamRestart: () => void

Type declaration

    • (): void
    • Returns void

OutboundMessage

OutboundMessage<T>: { data: T; fetch?: undefined | false | true; listen?: undefined | false | true; req_id: string; start_block?: undefined | number; type: OutboundMessageType; with_progress?: undefined | number }

Type parameters

  • T = unknown

Type declaration

  • data: T
  • Optional fetch?: undefined | false | true
  • Optional listen?: undefined | false | true
  • req_id: string
  • Optional start_block?: undefined | number
  • type: OutboundMessageType
  • Optional with_progress?: undefined | number

OutboundMessageFactory

OutboundMessageFactory<T>: (createOutboundMessage: (type: OutboundMessageType, data: T, userOptions: StreamOptions) => OutboundMessage<T>, withDefaultOptions: (userOptions: StreamOptions) => StreamOptions) => OutboundMessage<T>

Type parameters

  • T

Type declaration

PingInboundMessage

PingInboundMessage: InboundMessage

ProgressData

ProgressData: { block_id: string; block_num: number }

Type declaration

  • block_id: string
  • block_num: number

ProgressInboundMessage

ProgressInboundMessage: InboundMessage<ProgressData>

RAMOp

RAMOp: RamOp
deprecated

Renamed to RamOp

RamOp

RamOp: { action: string; action_idx: number; delta: number; family: string; op: string; payer: string; usage: number }

Type declaration

  • action: string
  • action_idx: number
  • delta: number
  • family: string
  • op: string
    deprecated

    This field is scheduled for removal, newer RamOp will have this field set to "deprecated".

    Use the family and action fields instead

  • payer: string
  • usage: number

Rejecter

Rejecter: (reason?: any) => void

Type declaration

    • (reason?: any): void
    • Parameters

      • Optional reason: any

      Returns void

RequestIdGenerator

RequestIdGenerator: () => string

Type declaration

    • (): string
    • Returns string

RequestInit

RequestInit: { body?: any; headers?: any; method?: undefined | string }

Type declaration

  • Optional body?: any
  • Optional headers?: any
  • Optional method?: undefined | string

Resolver

Resolver<T>: (value?: T | PromiseLike<T>) => void

Type parameters

  • T

Type declaration

    • (value?: T | PromiseLike<T>): void
    • Parameters

      • Optional value: T | PromiseLike<T>

      Returns void

ScheduleJob

ScheduleJob: () => void

Type declaration

    • (): void
    • Returns void

SearchSortType

SearchSortType: "asc" | "desc"

SearchTransactionRow

SearchTransactionRow: { action_idx: number[]; lifecycle: TransactionLifecycle }

Type declaration

SearchTransactionsResponse

SearchTransactionsResponse: { cursor: string; forked_head_warning: boolean; transactions?: SearchTransactionRow[] }

Type declaration

SocketConnectOptions

SocketConnectOptions: { onReconnect?: undefined | (() => void); onTermination?: undefined | ((initiator: "client" | "server", event: CloseEvent) => void) }

Type declaration

  • Optional onReconnect?: undefined | (() => void)
  • Optional onTermination?: undefined | ((initiator: "client" | "server", event: CloseEvent) => void)

SocketMessageListener

SocketMessageListener: (message: unknown) => void

Type declaration

    • (message: unknown): void
    • Parameters

      • message: unknown

      Returns void

StateAbiResponse

StateAbiResponse: { abi: Abi; account: string; block_num: number }

Type declaration

  • abi: Abi
  • account: string
  • block_num: number

StateAbiToJsonResponse

StateAbiToJsonResponse<T>: { account: string; block_num: number; rows: T[]; table: string }

Type parameters

  • T = unknown

Type declaration

  • account: string
  • block_num: number
  • rows: T[]
  • table: string

StateKeyAccountsResponse

StateKeyAccountsResponse: { account_names: string[]; block_num: number }

Type declaration

  • account_names: string[]
  • block_num: number

StateKeyType

StateKeyType: "name" | "hex" | "hex_be" | "uint64" | "symbol" | "symbol_code"

StatePermissionLinksResponse

StatePermissionLinksResponse: { last_irreversible_block_id: string; last_irreversible_block_num: number; linked_permissions: LinkedPermission[]; up_to_block_id?: undefined | string; up_to_block_num?: undefined | number }

Type declaration

  • last_irreversible_block_id: string
  • last_irreversible_block_num: number
  • linked_permissions: LinkedPermission[]
  • Optional up_to_block_id?: undefined | string
  • Optional up_to_block_num?: undefined | number

StateResponse

StateResponse<T>: { abi?: Abi; last_irreversible_block_id: string; last_irreversible_block_num: number; rows: DbRow<T>[]; up_to_block_id?: undefined | string; up_to_block_num?: undefined | number }

Type parameters

  • T = unknown

Type declaration

  • Optional abi?: Abi
  • last_irreversible_block_id: string
  • last_irreversible_block_num: number
  • rows: DbRow<T>[]
  • Optional up_to_block_id?: undefined | string
  • Optional up_to_block_num?: undefined | number

StateTableRowResponse

StateTableRowResponse<T>: { abi?: Abi; last_irreversible_block_id: string; last_irreversible_block_num: number; row: DbRow<T>; up_to_block_id?: undefined | string; up_to_block_num?: undefined | number }

Type parameters

  • T = unknown

Type declaration

  • Optional abi?: Abi
  • last_irreversible_block_id: string
  • last_irreversible_block_num: number
  • row: DbRow<T>
  • Optional up_to_block_id?: undefined | string
  • Optional up_to_block_num?: undefined | number

StateTableScopesResponse

StateTableScopesResponse: { block_num: number; scopes: string[] }

Type declaration

  • block_num: number
  • scopes: string[]

StreamMarker

StreamMarker: { cursor: string } | { atBlockNum: number }

Represents a marker of stream which indicates where the stream is currently at in its processing of messages.

The marker can be later re-used to restart a Stream at the right location.

StreamOptions

StreamOptions: { fetch?: undefined | false | true; irreversible_only?: undefined | false | true; listen?: undefined | false | true; req_id?: undefined | string; start_block?: undefined | number; with_progress?: undefined | number }

Type declaration

  • Optional fetch?: undefined | false | true
  • Optional irreversible_only?: undefined | false | true
  • Optional listen?: undefined | false | true
  • Optional req_id?: undefined | string
  • Optional start_block?: undefined | number
  • Optional with_progress?: undefined | number

TableDeltaData

TableDeltaData<T>: { block_id: string; block_num: number; dbop: DbOp<T>; step: "new" | "undo" | "redo" }

Type parameters

  • T = Record<string, any>

Type declaration

  • block_id: string
  • block_num: number
  • dbop: DbOp<T>
  • step: "new" | "undo" | "redo"

TableDeltaInboundMessage

TableDeltaInboundMessage<T>: InboundMessage<TableDeltaData<T>>

Type parameters

  • T = Record<string, any>

TableOp

TableOp: { action_idx: number; op: "INS" | "REM"; path: string; payer: string }

Type declaration

  • action_idx: number
  • op: "INS" | "REM"
  • path: string
  • payer: string

TableRows

TableRows<R>: { account: string; rows: DbRow<R>[]; scope: string }

Type parameters

  • R = unknown

Type declaration

  • account: string
  • rows: DbRow<R>[]
  • scope: string

TableSnapshotData

TableSnapshotData<T>: { rows: DbRow<T>[] }

Type parameters

  • T = Record<string, any>

Type declaration

TableSnapshotInboundMessage

TableSnapshotInboundMessage<T>: InboundMessage<TableSnapshotData<T>>

Type parameters

  • T = Record<string, any>

Transaction

Transaction: { actions: Action<any>[]; context_free_actions: Action<any>[]; context_free_data?: Action<any>[]; delay_sec: number; expiration: string; max_cpu_usage_ms: number; max_net_usage_words: number; ref_block_num: number; ref_block_prefix: number; signatures?: string[]; transaction_extensions: any[] }

Type declaration

  • actions: Action<any>[]
  • context_free_actions: Action<any>[]
  • Optional context_free_data?: Action<any>[]
  • delay_sec: number
  • expiration: string
  • max_cpu_usage_ms: number
  • max_net_usage_words: number
  • ref_block_num: number
  • ref_block_prefix: number
  • Optional signatures?: string[]
  • transaction_extensions: any[]

TransactionLifecycle

TransactionLifecycle: { cancelation_irreversible: boolean; canceled_by?: ExtDTrxOp; created_by?: ExtDTrxOp; creation_irreversible: boolean; creation_tree?: CreationNode[]; dbops?: DbOp[]; dtrxops?: DTrxOp[]; execution_block_header?: BlockHeader; execution_irreversible: boolean; execution_trace?: TransactionTrace; id: string; pub_keys?: string[]; ramops?: RamOp[]; tableops?: TableOp[]; transaction: Transaction; transaction_status: TransactionStatus }

Type declaration

TransactionLifecycleData

TransactionLifecycleData: { lifecycle: TransactionLifecycle }

Type declaration

TransactionLifecycleInboundMessage

TransactionLifecycleInboundMessage: InboundMessage<TransactionLifecycleData>

TransactionReceipt

TransactionReceipt: { cpu_usage_us: number; net_usage_words: number; status: TransactionStatus }

Type declaration

TransactionStatus

TransactionStatus: "pending" | "delayed" | "canceled" | "expired" | "executed" | "soft_fail" | "hard_fail"

TransactionTrace

TransactionTrace: { action_traces: ActionTrace<any>[]; block_num: number; block_time: string; elapsed: number; except?: any; failed_dtrx_trace?: TransactionTrace; id: string; net_usage: number; producer_block_id?: undefined | string; receipt?: TransactionReceipt; scheduled: boolean }

Type declaration

  • action_traces: ActionTrace<any>[]
  • block_num: number
  • block_time: string
  • elapsed: number
  • Optional except?: any
  • Optional failed_dtrx_trace?: TransactionTrace
  • id: string
  • net_usage: number
  • Optional producer_block_id?: undefined | string
  • Optional receipt?: TransactionReceipt
  • scheduled: boolean

Uint64

Uint64: number | string

A uint64_t natively in nodeos but can become a string when > 32 bits number due to how nodeos serialize number to JSON.

This is like because JavaScript largest number possible is 53 bits large which make it impossible to hold a full uint64_t type. To overcome that, nodeos will output a string when number is too large to preserve precision.

UnlistenMessageData

UnlistenMessageData: { req_id: string }

Type declaration

  • req_id: string

UnlistenedInboundMessage

UnlistenedInboundMessage: InboundMessage

WalkActionsState

WalkActionsState: { actions: ActionTrace<unknown>[]; index: number }

Type declaration

WebSocketFactory

WebSocketFactory: (url: string) => Promise<WebSocket>

Type declaration

    • (url: string): Promise<WebSocket>
    • Parameters

      • url: string

      Returns Promise<WebSocket>

Variables

Const DEFAULT_DELAY_BUFFER_PERCENT

DEFAULT_DELAY_BUFFER_PERCENT: 0.95 = 0.95

Const DEFAULT_KEEP_ALIVE_INTERVAL_IN_MS

DEFAULT_KEEP_ALIVE_INTERVAL_IN_MS: 30000 = 30000

Const DEFAULT_RECONNECT_DELAY_IN_MS

DEFAULT_RECONNECT_DELAY_IN_MS: 2500 = 2500

Const DEFAULT_RESTART_ON_ERROR_DELAY_IN_MS

DEFAULT_RESTART_ON_ERROR_DELAY_IN_MS: 2500 = 2500

Const MAX_UINT32_INTEGER

MAX_UINT32_INTEGER: 2147483647 = 2147483647

Const V0_FETCH_BLOCK_ID_BY_TIME

V0_FETCH_BLOCK_ID_BY_TIME: "/v0/block_id/by_time" = "/v0/block_id/by_time"

Const V0_FETCH_TRANSACTION

V0_FETCH_TRANSACTION: "/v0/transactions/:id" = "/v0/transactions/:id"

Const V0_SEARCH_TRANSACTIONS

V0_SEARCH_TRANSACTIONS: "/v0/search/transactions" = "/v0/search/transactions"

Const V0_STATE_ABI

V0_STATE_ABI: "/v0/state/abi" = "/v0/state/abi"

Const V0_STATE_ABI_BIN_TO_JSON

V0_STATE_ABI_BIN_TO_JSON: "/v0/state/abi/bin_to_json" = "/v0/state/abi/bin_to_json"

Const V0_STATE_KEY_ACCOUNTS

V0_STATE_KEY_ACCOUNTS: "/v0/state/key_accounts" = "/v0/state/key_accounts"

Const V0_STATE_PERMISSION_LINKS

V0_STATE_PERMISSION_LINKS: "/v0/state/permission_links" = "/v0/state/permission_links"

Const V0_STATE_TABLE

V0_STATE_TABLE: "/v0/state/table" = "/v0/state/table"

Const V0_STATE_TABLES_ACCOUNTS

V0_STATE_TABLES_ACCOUNTS: "/v0/state/tables/accounts" = "/v0/state/tables/accounts"

Const V0_STATE_TABLES_SCOPES

V0_STATE_TABLES_SCOPES: "/v0/state/tables/scopes" = "/v0/state/tables/scopes"

Const V0_STATE_TABLE_ROW

V0_STATE_TABLE_ROW: "/v0/state/table/row" = "/v0/state/table/row"

Const V0_STATE_TABLE_SCOPES

V0_STATE_TABLE_SCOPES: "/v0/state/table_scopes" = "/v0/state/table_scopes"

Const V1_AUTH_ISSUE

V1_AUTH_ISSUE: "/v1/auth/issue" = "/v1/auth/issue"

Let clientInstanceId

clientInstanceId: number = 0

Functions

checkApiKey

  • checkApiKey(apiKey: string | undefined, authentication: boolean | undefined): void
  • Parameters

    • apiKey: string | undefined
    • authentication: boolean | undefined

    Returns void

createApiTokenManager

  • Create the standard ApiTokenManager interface that will manage all the lifecycle of a token.

    kind

    Factories

    Parameters

    • fetchTokenInfo: () => Promise<ApiTokenInfo>

      The async function that should be used to retrieve a fresh token.

    • onTokenRefresh: (apiToken: string) => void

      The function to call when a token has been refreshed.

        • (apiToken: string): void
        • Parameters

          • apiToken: string

          Returns void

    • delayBuffer: number

      The percentage of time to use to schedule the next token refresh (i.e. with a value of 0.9 and a token valid for 1000ms from now, the next refresh would be scheduled to happen at now + (0.9 * 1000))

    • apiTokenStore: ApiTokenStore

      The API token store interface to retrieve token from and to save it back to.

    • refreshScheduler: RefreshScheduler

      The scheduler interface that should be used to schedule upcoming refresh token and check if a scheduled one already exist.

    Returns ApiTokenManager

createDfuseClient

  • The main entry point of the library, use it to create the standard DfuseClient instance.

    Only the apiKey and network parameters are mandatory, all others have sane default values based on your execution environment (be it a Browser or Node.js).

    This will create the default

    kind

    Factories

    Parameters

    Returns DfuseClient

createGraphqlStreamClient

createHttpClient

  • Create the default HttpClient concrete implementation.

    Parameters

    • authUrl: string

      The full dfuse Authentication url to use to perform the authRequest calls.

    • apiUrl: string

      The full dfuse REST API url to use to perform the apiRequest calls.

    • Default value options: HttpClientOptions = {}

      The set of options used to construct the default HttpClient instance. See HttpClientOptions for documentation of the options and default values for each of them.

    Returns HttpClient

createNoopApiTokenManager

createOutboundMessage

  • Exported for consumption from internal packages. This does not have any Backward compatibility policy nor documentation attached to it.

    It will be moved and made private again when message factories above have been removed.

    Type parameters

    • T

    Parameters

    Returns OutboundMessage<T>

createRefreshScheduler

createSocket

  • Create an actual Socket instance that will be used as the interface to wrap all communicaton of the WebSocket protocol.

    Parameters

    • url: string

      The url used to reach the dfuse Stream API, should not contain the token query parameter.

    • Default value options: SocketOptions = {}

      The options used to configure the Socket instance, see SocketOptions for default options.

    Returns Socket

createStreamClient

dynamicMessageDispatcher

  • This small utility is useful to implement a dynamic dispatcher based on the type of message. That is usefull to avoid having to code yourself a switch (message.type) { ... } switch case.

    Instead, define a series of specific of handlers on a class or an object, then when calling the stream method of your choices, pass the dynamic dispatcher created by calling this method as the message handler.

    The created dispatcher upon each message, will check the received type to handler map and will dispatch it there.

    const dispatch = dynamicMessageDispatcher({
      listening: this.onListening,
      progress: this.onProgress,
      action_trace: this.onAction,
    })
    
    client.streamActionTraces({ ... }, dispatcher)

    Parameters

    Returns OnStreamMessage

flattenActionTraces

  • This method flattens the nested action traces of a TransactionLifecycle into a single flat list. The flat list indexes matches dfuse API action index which is used within dfuse to identify particular action trace in various situation (db ops, RAM ops, etc).

    The action index of a given action is obtained simply by doing a deep-first traversal of the action traces structure incrementing a counter at each step and binding the counter to the current traversed action becoming the action's index.

    As an example of this method, assume the following transaction:

    Transaction 123 {
      ExecutionTrace {
        ActionTraces: [
          ActionTrace(eosio.token/eosio.token:transfer) {
            InlineTraces: [
              ActionTrace(from/eosio.token:transfer) {
                InlineTraces: [
                  ActionTrace(contractX/contractX:log)
                ]
              }
              ActionTrace(to/eosio.token:transfer) {
                InlineTraces: [
                  ActionTrace(contractY/contractY:update)
                ]
              }
            ]
          }
        ]
      }
    }

    This will results in the following flattened actions list being returned:

    [
      ActionTrace(eosio.token/eosio.token:transfer),
      ActionTrace(from/eosio.token:transfer),
      ActionTrace(contractX/contractX:log),
      ActionTrace(to/eosio.token:transfer),
      ActionTrace(contractY/contractY:update),
    ]

    Parameters

    Returns ActionTrace<any>[]

    A flat list of action traces extracted from the transaction lifecycle for which each index of the list represents the action's index concept of dfuse API.

getActionTracesMessage

getHeadInfoMessage

  • deprecated

    The message factories are deprecated, there is no need to create your own message anynore. This will be removed in a future release. The standard client does not use this anymore.

    Parameters

    Returns OutboundMessage

getTableRowsMessage

getTransactionLifecycleMessage

inferApiTokenStore

inferFetch

  • inferFetch(fetch?: Fetch): Fetch

inferWebSocketFactory

isApiTokenExpired

isCommunityEdition

  • isCommunityEdition(endpoint: string): boolean

isValidDocumentType

  • isValidDocumentType(type?: undefined | string): boolean

matchingActionTraces

  • This method extracts the matchinf actions out of SearchTransactionRow object.

    Using the search endpoint, you receives a SearchTransactionRow that is simply a composite object containing an actual TransactionLifecycle element as well as a list of action indexes which are the actual ones that matched your query.

    A single transaction can contains a big amount of actions but usually, only a subset of the actions in a transaction matches your search query.

    By using this method, you can easily extracts the matching actions out of the SearchTransactionRow object.

    Parameters

    Returns ActionTrace<any>[]

    A flat list of action traces extracted from the search result row that matched the query term(s).

mkdirpSync

  • mkdirpSync(directory: string): Promise<void>

networkToEndpoint

  • networkToEndpoint(network: string): string

Const noop

  • noop(): void

randomReqId

  • randomReqId(): string

readData

  • readData(filePath: string): Promise<string | undefined>

unlistenMessage

waitFor

  • waitFor(ms: number): Promise<void>

walkFlattenedActionTraces

walkMatchingActionTraces

writeData

  • writeData(filePath: string, data: string): Promise<void>

Generated using TypeDoc