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:
op == "INS"
, npayer
and new
are presentop == "UPD"
, opayer
, old
, npayer
and new
are presentop == "REM"
, opayer
and old
are presentThe 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.
The hexadecimal string encoded representing the new version of the
row in binary format. Present when op == "INS" | "UPD"
.
The account which is the new payer of the row. Present when op == "UPD" | "REM"
.
The hexadecimal string encoded representing the old version of the
row in binary format. Present when op == "UPD" | "REM"
.
The account which was the old payer of the row. Present when op == "UPD" | "REM"
.
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
}
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.
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
Represents a valid data result for which the payload of type T
will
be available for consumption in the data
field.
One of error
, hex
or json
field will be present depending
on the actual request made.
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.
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.
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.
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.
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.
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.
Create the standard ApiTokenManager interface that will manage all the lifecycle of a token.
The async function that should be used to retrieve a fresh token.
The function to call when a token has been refreshed.
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)
)
The API token store interface to retrieve token from and to save it back to.
The scheduler interface that should be used to schedule upcoming refresh token and check if a scheduled one already exist.
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
The options that can be passed to customize DfuseClient instance, refer to the DfuseClientOptions for further details.
Create the default StreamClient concrete implementation.
The url used to reach the dfuse Stream API, should not contain the token
query parameter. Passed as
is to created Socket interface through the createSocket factory method. This parameter has no effect
if StreamClientOptions.socket options is used.
The set of options used to construct the default StreamClient instance. See StreamClientOptions for documentation of the options and default values for each of them.
Create the default HttpClient concrete implementation.
The full dfuse Authentication url to use to perform the authRequest
calls.
The full dfuse REST API url to use to perform the apiRequest
calls.
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.
Create the Noop ApiTokenManager interface that will manage all the lifecycle of a token.
The hardwired token value
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.
Create an actual Socket instance that will be used as the interface to wrap all communicaton of the WebSocket protocol.
The url used to reach the dfuse Stream API, should not contain the token
query parameter.
The options used to configure the Socket instance, see SocketOptions for default options.
Create the default StreamClient concrete implementation.
The url used to reach the dfuse Stream API, should not contain the token
query parameter. Passed as
is to created Socket interface through the createSocket factory method. This parameter has no effect
if StreamClientOptions.socket options is used.
The set of options used to construct the default StreamClient instance. See StreamClientOptions for documentation of the options and default values for each of them.
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)
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),
]
The transaction lifecycle object to flatten action traces from.
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.
Check wheter the received ApiTokenInfo parameter is expired or near its expiration.
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.
The search result row to extract matching action traces from.
A flat list of action traces extracted from the search result row that matched the query term(s).
Generated using TypeDoc
The actual ABI JSON representation as returned by EOSIO platform. Extracted from EOSIO/eosjs library.
https://github.com/EOSIO/eosjs/blob/develop/src/eosjs-rpc-interfaces.ts#L4