Skip to content

Latest commit

 

History

History
221 lines (168 loc) · 6.27 KB

README.md

File metadata and controls

221 lines (168 loc) · 6.27 KB

Blockmetrics Websocket API

Table of Contents

Introduction

This Service is used to stream blockchains data to Blockmetrics

Technologies

The service work with:

ws

Subscriptions

How it works

The subscribe/unsubscribe messages should be built according to the following structure and be stringified before beeing sent.

// subscribe

{
  type: "subscribe",
  channel: "channelYouWantToSubscribe"
}

// or to unsubscribe

{
  type: "unsubscribe",
  channel: "channelYouWantToUnsubscribe"
}

Channels

Blockchains

Message
{
  ...
  channel: "blockchains"
}
Response
{
  channel: "blockchains",
  data: ...
}
Update data
Name Type Description
id string (uuid) Example: "ethereum"
name string Example: "Ethereum"
score integer Example: 50
reliability integer Example: 79
node_count integer Example: 5000
testnet_node_count integer Example: 100
single_node_power_consumption number Example: 50
blockchain_power_consumption number Example: 100000
hashrate number Example: 16745649.145948
difficulty number Example: 1359284933
last_block_timestamp number Example: 1564984100
token_count integer Example: 4890
transaction_count integer Example: 178039483
gas_price number Example: 250000000
consensus string Example: "PoW"
today_transaction_count integer Example: 1928493
address_count integer Example: 192849345
today_address_count integer Example: 1928493
today_user_count integer Example: 19284
today_contract_count integer Example: 975451
total_value_locked integer Example: 192849308903.3464

Blockchains Cards

Message
{
  ...
  channel: "blockchainsCards"
}
Response
{
  channel: "blockchainsCards",
  data: ...
}
Update data
Name Type Description
id string (uuid) Example: "ethereum"
name string Example: "Ethereum"
reliability integer Example: 79
blockchain_power_consumption number Example: 100000
token_count integer Example: 4890
gas_price number Example: 250000000
score integer Example: 52
rank string Example: "C+"

Single blockchain

Details

Available blockchains id

  • ethereum
  • binance-smart-chain
  • polygon
  • avalanche
  • fantom
  • bitcoin
Message
{
  ...
  channel: "blockchain_id"
}
Response
{
  channel: "blockchain_id",
  data: ...
}
Update data
Name Type Description
id string (uuid) Example: "ethereum"
name string Example: "Ethereum"
score integer Example: 50
reliability integer Example: 79
node_count integer Example: 5000
testnet_node_count integer Example: 100
single_node_power_consumption number Example: 50
blockchain_power_consumption number Example: 100000
hashrate number Example: 16745649.145948
difficulty number Example: 1359284933
last_block_timestamp number Example: 1564984100
token_count integer Example: 4890
transaction_count integer Example: 178039483
gas_price number Example: 250000000
consensus string Example: "PoW"
today_transaction_count integer Example: 1928493
address_count integer Example: 192849345
today_address_count integer Example: 1928493
today_user_count integer Example: 19284
today_contract_count integer Example: 975451
total_value_locked integer Example: 192849308903.3464

Blockchains Total

Details

Available properties

  • addressCount
  • transactionCount
  • todayTransactionCount
  • todayAddressCount
Message
{
  ...
  channel: "total_property"
}
Response
{
  channel: "total_property",
  data: ...
}
Update data
Name Type Description
value integer Example: 12928463395