API docs for explorer

Emyrk 6e649c9e25 Update 'README.md' 2 months ago
README.md 6e649c9e25 Update 'README.md' 2 months ago

README.md

TFA Explorer API

API Used to query for factom blockchain data

Table of Contents

  1. Explorer API

api

Specification Value
Resource Path /api
API Version 1.0.0
BasePath for the API https://explorer.factoid.org
Consumes
Produces

Operations

Resource Path Operation Description
/api/v1/directory-block/{param} GET retrieves directory block by height or keymr
/api/v1/factoid-block/{param} GET retrieves factoid block by height or keymr
/api/v1/admin-block/{param} GET retrieves admin block by height or keymr
/api/v1/entrycredit-block/{param} GET retrieves admin block by height or keymr
/api/v1/range/{blocktype} GET Retrieves the block range for the given type
/api/v1/directory-block/entries/{height} GET retrieves directory block entries
/api/v1/entry-block/{keymr} GET Retrieves the Entry block
/api/v1/eblock-block/entries/{keymr} GET retrieves entry block entries
/api/v1/eblock-block/entries/{chainid} GET retrieves entries in a chain
/api/v1/admin-block/entries/{height} GET retrieves admin block entries by height.
/api/v1/entrycredit-block/entries/{height} GET retrieves entry credit block entries
/api/v1/entry/ GET Retrieves the entry commit and reveal by hash. ExtIDs & Content are base64 encoded!
/api/v1/entry/ GET Retrieves the entry reveal by hash. ExtIDs & Content are base64 encoded!
/api/v1/entrycommit/ GET Retrieves the entry commit by hash.
/api/v1/top GET retrieves the topmost height in the blockchain
/api/v1/address/commits/ GET Retrieves all entry credit commits related to a given address (must be an ec address)
/api/v1/address/transactions/ GET Retrieves all factoid transactions related to a given address
/api/v1/factoid-block/transactions/ GET Retrieves all factoid transactions related to a given block height
/api/v1/transaction/ GET Retrieves the transaction by txid
/api/v1/richlist/ GET Retrieves richlist for the given type ('factoid' or 'entrycredit')
/api/v1/address/balance/ GET Retrieves the balance for a given address
/api/v1/search/ GET Searches the database for the hash
/api/v1/identity/ GET Retrieves the identity for a given root chain id
/api/v1/authority/ GET Retrieves the authority for a given root chain id
/api/v1/authorities GET Retrieves all authorities
/api/v1/index GET Retrieves all data needed for index page

API: /api/v1/directory-block/{param} (GET)

retrieves directory block by height or keymr

Param Name Param Type Data Type Description Required?
param path string Can be either a height or keymr Yes
Code Type Model Message
200 object SQLDirectoryBlock

API: /api/v1/factoid-block/{param} (GET)

retrieves factoid block by height or keymr

Param Name Param Type Data Type Description Required?
param path string Can be either a height or keymr Yes
Code Type Model Message
200 object SQLFactoidBlock

API: /api/v1/admin-block/{param} (GET)

retrieves admin block by height or keymr

Param Name Param Type Data Type Description Required?
param path string Can be either a height or keymr Yes
Code Type Model Message
200 object SQLAdminBlock

API: /api/v1/entrycredit-block/{param} (GET)

retrieves admin block by height or keymr

Param Name Param Type Data Type Description Required?
param path string Can be either a height or keymr Yes
Code Type Model Message
200 object SQLEntryCreditBlock

API: /api/v1/range/{blocktype} (GET)

Retrieves the block range for the given type

Param Name Param Type Data Type Description Required?
param blocktype string Can be either 'directory-block', 'entrycredit-block', 'factoid-block', or 'admin-block' Yes
param start int Start of the block range INCLUSIVE Yes
param stop int Stop of the block range EXCLUSIVE Yes
Code Type Model Message
200 object GenericBlock The block type you specified

API: /api/v1/directory-block/entries/{height} (GET)

retrieves directory block entries

Param Name Param Type Data Type Description Required?
height int int Input height of directory block Yes
limit int int Number of entry blocks to return, max 200
offset int int Offset of entry blocks
Code Type Model Message
200 object DirectoryBlockEntries

API: /api/v1/entry-block/{keymr} (GET)

Retrieves the Entry block

Param Name Param Type Data Type Description Required?
keymr string string Key Mr of Eblock Yes
Code Type Model Message
200 array SQLEntryBlock

API: /api/v1/eblock-block/entries/{keymr} (GET)

retrieves entry block entries

Param Name Param Type Data Type Description Required?
keymr string string Key Mr of Eblock Yes
limit int int Number of entry blocks to return, max 200
offset int int Offset of entry blocks
short string string If set to true, will not give entry body and extids
Code Type Model Message
200 array SQLEntry

API: /api/v1/eblock-block/entries/{chainid} (GET)

retrieves entries in a chain

Param Name Param Type Data Type Description Required?
chainid string string ChainID of chain Yes
limit int int Number of entry blocks to return, max 200
offset int int Offset of entry blocks
short string string If set to true, will not give entry body and extids
Code Type Model Message
200 array SQLEntry

API: /api/v1/admin-block/entries/{height} (GET)

retrieves admin block entries by height.

Param Name Param Type Data Type Description Required?
height int int Input height of admin block Yes
limit int int Number of adminblock entries to return, max 200
offset int int Offset of adminblock entries
Code Type Model Message
200 object AdminBlockEntriesResponse

API: /api/v1/entrycredit-block/entries/{height} (GET)

retrieves entry credit block entries

Param Name Param Type Data Type Description Required?
height int int Input height of directory block Yes
limit int int Number of entry blocks to return, max 200
offset int int Offset of entry blocks
Code Type Model Message
200 object EntryCreditBlockEntriesResponse

API: /api/v1/entry/ (GET)

Retrieves the entry commit and reveal by hash. ExtIDs & Content are base64 encoded!

Param Name Param Type Data Type Description Required?
entryhash string string Input entryhash for the entry Yes
Code Type Model Message
200 object EntryCommitAndReveal

API: /api/v1/entry/ (GET)

Retrieves the entry reveal by hash. ExtIDs & Content are base64 encoded!

Param Name Param Type Data Type Description Required?
entryhash string string Input entryhash for the entry Yes
Code Type Model Message
200 object SQLEntry

API: /api/v1/entrycommit/ (GET)

Retrieves the entry commit by hash.

Param Name Param Type Data Type Description Required?
entryhash string string Input entryhash for the entry Yes
Code Type Model Message
200 object SQLEntryCreditBlockEntry

API: /api/v1/top (GET)

retrieves the topmost height in the blockchain

Code Type Model Message
200 object int

API: /api/v1/address/commits/ (GET)

Retrieves all entry credit commits related to a given address (must be an ec address)

Code Type Model Message
200 array FetchECAddressCommitsResponse

API: /api/v1/address/transactions/ (GET)

Retrieves all factoid transactions related to a given address

Code Type Model Message
200 object FactoidTransactionList

API: /api/v1/factoid-block/transactions/ (GET)

Retrieves all factoid transactions related to a given block height

Code Type Model Message
200 object FactoidTransactionList

API: /api/v1/transaction/ (GET)

Retrieves the transaction by txid

Code Type Model Message
200 object FactomTransaction

API: /api/v1/richlist/ (GET)

Retrieves richlist for the given type ('factoid' or 'entrycredit')

Code Type Model Message
200 array FactoidAddress

API: /api/v1/address/balance/ (GET)

Retrieves the balance for a given address

Code Type Model Message
200 array FactoidAddress

API: /api/v1/search/ (GET)

Searches the database for the hash

Code Type Model Message
200 object DatabaseHashType

API: /api/v1/identity/ (GET)

Retrieves the identity for a given root chain id

Code Type Model Message
200 object ExtendedIdentity

API: /api/v1/authority/ (GET)

Retrieves the authority for a given root chain id

Code Type Model Message
200 object ExtendedAuthority

API: /api/v1/authorities (GET)

Retrieves all authorities

Code Type Model Message
200 array ExtendedAuthority

API: /api/v1/index (GET)

Retrieves all data needed for index page

Code Type Model Message
200 object string

Models

AuthorityExtension

Field Name (alphabetical) Field Type Description
name string
readable_status string
user_coinbase_address string

ExtendedAuthority

Field Name (alphabetical) Field Type Description
auth_core github.com.FactomProject.factomd.common.identity.Authority
auth_extension github.com.Emyrk.factom-identity.AuthorityExtension

ExtendedIdentity

Field Name (alphabetical) Field Type Description
id_core github.com.FactomProject.factomd.common.identity.Identity
id_extension github.com.Emyrk.factom-identity.IdentityExtension

IdentityExtension

Field Name (alphabetical) Field Type Description
name string
user_coinbase_address string

AdminBlockEntriesResponse

Field Name (alphabetical) Field Type Description
entries array
total_entries int

DirectoryBlockEntries

Field Name (alphabetical) Field Type Description
adminblock github.com.Emyrk.tfa-explorer.database.BlockResponse
entryblocks array
entrycreditblock github.com.Emyrk.tfa-explorer.database.BlockResponse
factoidblock github.com.Emyrk.tfa-explorer.database.BlockResponse

EntryCommitAndReveal

Field Name (alphabetical) Field Type Description
commit github.com.Emyrk.tfa-explorer.common.SQLEntryCreditBlockEntry
reveal github.com.Emyrk.tfa-explorer.common.SQLEntry

EntryCreditBlockEntriesResponse

Field Name (alphabetical) Field Type Description
commits array
total_commits int
total_credits int

FactoidTransactionList

Field Name (alphabetical) Field Type Description
total_transactions int
transactions array

FetchECAddressCommitsResponse

Field Name (alphabetical) Field Type Description
address string
commits array
total_commits int
total_ec_spent int

GenericBlock

Field Name (alphabetical) Field Type Description

FactoidAddress

Field Name (alphabetical) Field Type Description
address string
balance int64
order int

FactomTransaction

Field Name (alphabetical) Field Type Description
block_height int
blockchain_date Time
ecoutputs array
inputs array
outputs array
total_ec_fct_output int64
total_ec_output int64
total_fct_output int64
total_input int64
trans_date Time
txid string

FactomTransactionPart

Field Name (alphabetical) Field Type Description
address string
ec_amount int64
fct_amount int64
seq_num int
signature string

SQLAdminBlock

Field Name (alphabetical) Field Type Description
block_height int
body_size int
key_mr string
message_count int
prev_key_mr string

SQLAdminBlockEntry

Field Name (alphabetical) Field Type Description
RawEntry interfaces.IABEntry
ab_type uint8
block_height int
raw array
raw_json string
raw_type int
raw_type_string string
sequence int

SQLDirectoryBlock

Field Name (alphabetical) Field Type Description
admin_entry_count int
block_count int
block_height int
blockchain_timestamp Time
body_mr string
dblock_hash string
eblock_count int
entry_count int
entrycredit_entry_count int
exch_rate int64
fct_trans_count int
key_mr string
prev_full_hash string
prev_key_mr string
total_ec_burned int64
total_ec_output int64
total_fct_input int64
total_fct_output int64

SQLEntry

Field Name (alphabetical) Field Type Description
OnlyHash bool
block_height int
blockchain_date Time
chain_id string
content array Base64 encoded
eblock_key_mr string
entry_hash string
extid_count int
extids array []Base64 encoded
extidsString array
id int

SQLEntryBlock

Field Name (alphabetical) Field Type Description
block_height int
body_mr string
chain_id string
eb_sequence int
entry_count int
key_mr string
prev_full_hash string
prev_key_mr string

SQLEntryCreditBlock

Field Name (alphabetical) Field Type Description
block_height int
body_hash string
body_size int
full_hash string
header_hash string
key_mr string
object_count int
prev_full_hash string
prev_header_hash string
prev_key_mr string

SQLEntryCreditBlockEntry

Field Name (alphabetical) Field Type Description
address string
block_height int
blockchain_date Time
chain_commit bool
commit_date Time
credits int
ecent_hash string
entry_hash string
signature string

SQLFactoidBlock

Field Name (alphabetical) Field Type Description
block_height int
body_mr string
body_size int
exchange_rate int64
key_mr string
prev_key_mr string
prev_ledger_key_mr string
transaction_count int

BlockResponse

Field Name (alphabetical) Field Type Description
chain_id string
entry_count int
keymr string
sequence int

DatabaseHashType

Field Name (alphabetical) Field Type Description
hash string
object_type string

AnchorSigningKey

Field Name (alphabetical) Field Type Description
blockchain string
key github.com.FactomProject.factomd.common.primitives.ByteSlice20
keytype byte
level byte

Authority

Field Name (alphabetical) Field Type Description
anchor_keys array
coinbase_address interfaces.IAddress
efficiency uint16
identity_chainid interfaces.IHash
management_chaind interfaces.IHash
matryoshka_hash interfaces.IHash
signing_key github.com.FactomProject.factomd.common.primitives.PublicKey
status uint8

Identity

Field Name (alphabetical) Field Type Description
IdentityCreated uint32
IdentityRegistered uint32
ManagementChainID interfaces.IHash
ManagementCreated uint32
ManagementRegistered uint32
MatryoshkaHash interfaces.IHash
anchor_keys array
coinbase_address interfaces.IHash
efficiency uint16
identity_chainid interfaces.IHash
identity_keys array
signing_key interfaces.IHash
status uint8

ByteSlice20

Field Name (alphabetical) Field Type Description

PublicKey

Field Name (alphabetical) Field Type Description