EOS Tribe launched a beta version of it's web-socket streaming Spectrum API on Telos Mainnet (https://www.telosfoundation.io/).
Telos Mainnet Spectrum API web-socket endpoint: wss://api.telos.eostribe.io
This version currently supports subscriptions for get_actions, get_transaction and get_blocks streams.
Here is the sample subscription message for get_actions endpoint:
{
"apikey":"test-api-key",
"event":"subscribe",
"type":"get_actions",
"data": {
"account":"eostribeprod",
“actions":[“transfer”,”buyram”]
}
}
Fields description for get_actions:
- event - type of events, there are two variants: “subscribe” and “unsubscribe”. Required [String].
- type - type of endpoint. Required [String].
- data - Contents of this object depends on type argument. Required for get_actions.
- account - name of account. Required [String].
- actions - List of actions name. [Object]. If actions are not specified - all actions will be matched.
Endpoint get_blocks - subscribe on new block events:
Request message format for get_blocks endpoint:
{
"apikey":"test-api-key",
"event":"subscribe",
"type":"get_blocks"
}
Fields description:
- apikey - key for access and accounting, not using on testnet.[String]
- event - type of event, there are two variants “subscribe” and “unsubscribe”. To subscribe necessary using "subscribe" * value - this field is mandatory. [String].
- type - type of endpoint. Required [String].
Below is the sample subscription message for get_transaction endpoint:
{
"apikey":"test-api-key",
"event":"subscribe",
"type":"get_transaction",
"data": {"account":"eosio"}
}
Fields description for get_transaction:
- apikey - key for access and accounting, not using on testnet.[String]
- event - type of event, there are two variants “subscribe” and “unsubscribe”. To subscribe necessary using "subscribe" value . This field is mandatory. [String].
- type - type of endpoint. Required [String].
- data - Contents of this object depends on type argument. Required for get_transaction.
- account - name of account. Required [String].
Sample JS web-socket client to subscribe for events:
Spectrum Web Sockets
Spectrum Web Sockets Test: Get Actions