Skip to main content
This dataset has been retired. As SQD consolidates onto Portal, the Fuel and Starknet gateways were discontinued on June 1, 2026, and Eclipse (gateway and Portal dataset) on May 21, 2026. The endpoints listed for this network no longer respond. See the deprecation announcement for details.

setFields(options)

Set the fields to be retrieved for data items of each supported type. The options object has the following structure:
Every field selector is a collection of boolean fields that map to the fields of data items within the batch context iterables. Defining a field of a field selector of a given type and setting it to true will cause the processor to populate the corresponding field of all data items of that type. Here is a definition of a processor that requests hash and status fields for transactions and the contract field for receipts:
Same fields will be available for all data items of any given type, including the items accessed via nested references. Suppose we used the processor defined above to subscribe to some transactions as well as some receipts, and for each receipt we requested its parent transaction:
After populating the convenience reference fields with augmentBlock() from @subsquid/fuel-objects, the contract field will be available both within the data items of the transactions iterable of block data and within the transaction items that provide parent transaction information for the receipts matching the addReceipt() data request:
Some data fields, like hash for transactions, are enabled by default but can be disabled by setting a field of a field selector to false. For example, this code will not compile:
Disabling unused fields will improve sync performance, as the fields’ data will not be fetched from the SQD Network gateway.

Data item types and field selectors

Most IDEs support smart suggestions to show the possible field selectors. For VS Code, press Ctrl+Space.
Here we describe the data item types as functions of the field selectors. Unless otherwise mentioned, each data item type field maps to the eponymous field of its corresponding field selector. Item fields are divided into three categories:
  • Fields that are always added regardless of the setFields() call.
  • Fields that are enabled by default and can be disabled by setFields(). E.g. a hash field will be fetched for transactions by default, but can be disabled by setting hash: false within the transaction field selector.
  • Fields that can be requested by setFields().

Transaction

Fields of Transaction data items may be requested by the eponymous fields of the field selector. Composite fields like inputContract are requested in their entirety by a single selector. Here’s a detailed description of possible Transaction fields:
  • transactionType field has the following type:
  • status field has the following type:
    Status can be one of the following:
    ProgramState is defined as follows:
  • policies field has the following interface:
  • upgradePurpose field is of type ConsensusParametersPurpose | StateTransitionPurpose, where the types are defined as:

Receipt

Fields of Receipt data items may be requested by the eponymous fields of the field selector. Here’s a detailed description of possible Receipt fields:
  • receiptType has the following type:

Input

Input data items can be of types InputCoin, InputContract or InputMessage. Each type has its own set of fields. To access the type-specific fields, narrow down the type by asserting the value of the type field, e.g.
To get a name of a field selector field, apply a type prefix to a capitalized name of the data item field, e.g.
  • amount field of InputCoin input items is requested by coinAmount: true;
  • witnessIndex field of InputMessage input items is requested by messageWitnessIndex: true etc.
All Input* data types have transactionIndex, index and type fields. These cannot be disabled. There aren’t any fields that are enabled by default and can be disabled. InputCoin data items may have the following fields:
InputContract data items may have the following fields:
InputMessage data items may have the following fields:
It is possible to request more than one type of input in the same data request. For example, to request all inputs of type InputCoin and InputContract:

Output

Output data items can be of types CoinOutput, ContractOutput, ChangeOutput, VariableOutput or 'ContractCreated'. Each type has its own set of fields. To access the type-specific fields, narrow down the type by asserting the value of the type field, e.g.
To get a name of a field selector field, apply a type prefix to a capitalized name of the data item field, e.g.
  • to field of CoinOutput items is requested by coinTo: true;
  • inputIndex field of ContractOutput items is requested by contractInputIndex: true;
  • amount field of ChangeOutput items is requested by changeAmount: true;
  • assetId field of VariableOutput items is requested by variableAssetId: true;
  • stateRoot field of ContractCreated items is requested by contractCreatedStateRoot: true etc.
All output data types have transactionIndex, index and type fields. These cannot be disabled. There aren’t any fields that are enabled by default and can be disabled. CoinOutput data items may have the following fields:
ContractOutput data items may have the following fields:
ChangeOutput data items may have the following fields:
VariableOutput data items may have the following fields:
ContractCreated data items may have the following fields:

Block header

BlockHeader data items may have the following fields:
Request the fields with eponymous field request flags.

A complete example