XFI Scan API
These following API's are recommended for development on mainnet and testnet. When receive example pay attention to the domain:
xfiscan — for mainnet network
test.xfiscan — for testnet network
Queries
txs - queries for transactions
GET /api/1.0/txs
Retrieving a list of transactions.
Example of an answer: https://test.xfiscan.com/api/1.0/txs
Queries Parameters:
from_height
string
Block number from.
to_height
string
Block number to.
address
string
Account Address.
addresses
array [string]
Account addresses array.
txhash
string
Transaction hash.
txhashes
array [string]
Transaction hash array.
height
string
Block Height.
existsEVM
boolean
True - only EVM part transactions, false - only Cosmos part transactions.
messageType
string
Transaction message type.
page
number
Page Number.
limit
number
The number of entities to give away
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field Example: '-height' is descending, 'height' is ascending.
GET /api/1.0/txs/{hash} Getting the transaction hash.
Example of an answer: https://test.xfiscan.com/api/1.0/txs/D64C8804B101996F92F57603166CF2852C48DDDA959316034280088F1FF99731
hash
string
Transaction hash. Mandatory field.
blocks - query for blocks
GET /api/1.0/blocks
Getting a list of blocks.
Example of an answer: https://test.xfiscan.com/api/1.0/blocks
height
string
Block Height.
from_height
string
Block number from.
to_height
string
Block number to.
page
number
Page Number.
limit
number
The number of entities to give away.
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field Example: '-height' is descending, 'height' is ascending.
GET /api/1.0/blocks/latest Receiving the current confirmed block
Example of an answer: https://test.xfiscan.com/api/1.0/blocks/latest
Getting a specific block. Example of an answer: https://test.xfiscan.com/api/1.0/blocks/1
height
string
Block height. Mandatory field.
addresses - queries for account addresses
Retrieve a list of account addresses Example of an answer: https://test.xfiscan.com/api/1.0/addresses
address
string
Account Address.
validatorAddress
string
Validator Address.
addresses
array [string]
Account addresses array.
blockNumber
string
Block Number.
page
number
Page Number.
limit
number
The number of entities to give away.
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field Example: '-height' is descending, 'height' is ascending.
GET /api/1.0/addresses/{address}
Get address by hash of account address. Example of an answer: https://test.xfiscan.com/api/1.0/addresses/mx1j3ys0zehrles4y8vxmlxry03vnx4yltyg2alsv
address
string
Account Address Mandatory field.
withoutRewards
boolean
Awards where they're not needed.
GET /api/1.0/addresses/rich-list/{type}
Getting a list of addresses by the number of tokens purchased.
Example of an answer: https://test.xfiscan.com/api/1.0/addresses/rich-list/mpx
type
string
Token type (MPX or XFI). Mandatory field.
validators - queries for validators.
Getting a list of validators.
Example of an answer: https://test.xfiscan.com/api/1.0/validators
validatorJailed
boolean
If the validatorJailed field is true, it means that the validator is locked and temporarily cannot participate in the validation process and receive rewards.
validatorStatuses
string
The field filters validators by their current status.
ninAddresses
array [string]
The passed list ninAddresses of the threat from the search.
address
string
Account Address.
addresses
array [string]
Account addresses array.
page
number
Page number.
limit
number
The number of entities to give away.
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field Example: '-height' is descending, 'height' is ascending.
GET /api/1.0/validators/{address}
Getting the validator by the address.
Example of an answer: https://test.xfiscan.com/api/1.0/validators/mxvaloper1902re99ggp60q58z4nhcc9jqutp3xmaq6jlx0u
address
string
Validator Address. Mandatory field.
stat - getting statistics
GET /api/1.0/stat
Example of an answer: https://test.xfiscan.com/api/1.0/stat
event-logs - smart contracts logs
Getting smart contracts logs.
Example of an answer: https://test.xfiscan.com/api/1.0/event-logs
blockHash
string
Block hash.
originAddress
string
The address that called the smart contract.
transactionHash
string
Transaction hash.
transactionIndex
number
The log index in the transaction.
blockNumber
string
Block number.
contractAddress
string
Smart contract address.
page
number
Page number.
limit
number
The number of entities to give away.
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field Example: '-height' is descending, 'height' is ascending.
contracts - smart contracts queries
Getting smart contracts. Example of an answer: https://test.xfiscan.com/api/1.0/contracts
Parameter
Type
Description
contractAddress
string
Smart Contract Address.
tokenType
string
Search by token type.
creatorAddress
string
The address of the contract creator.
txHash
string
Contract hash.
blockNumber
string
Block Number.
verified
boolean
Whether or not the smart contract is verified.
page
number
Page Number.
limit
number
The number of entities to be given away.
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field
Example: '-height' is descending, 'height' is ascending.
GET /api/1.0/contracts/compiler-versions
Getting a list of compiler versions.
Example of an answer:
https://test.xfiscan.com/api/1.0/contracts/compiler-versions
GET /api/1.0/contracts/{address}
Getting the address of a smart contract.
Example of an answer: https://test.xfiscan.com/api/1.0/contracts/0x516354c4024246173b06F1D7BF834DE3865B7A47
Parameter
Type
Description
address
string
Contract Address. Required field.
POST /api/1.0/contracts/verify
The request responsible for verifying the contract.
After successful verification of the contract, the Application Binary Interface (ABI) is stored in the database, which allows you to define the methods of the contract.
tokens - list of tokens
GET /api/1.0/tokens
Getting a list of tokens.
Example of an answer:
https://test.xfiscan.com/api/1.0/tokens
Parameter
Type
Description
tokenSymbol
tokenType
string
string
Token character
Search by token type.
contractAddress
string
Contract address
txHashCreate
string
The hash of the token creation.
creatorAddress
string
The address of the creator of the token.
page
number
Page number.
limit
number
The number of entities to give away.
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field
Example: '-height' is descending, 'height' is ascending.
Receiving a token.
Example of an answer:
https://test.xfiscan.com/api/1.0/tokens/0x739fD25CaeFe272DFf9dbab25f161cE36301BF14
Parameter
Type
Description
address
string
Token address.
Mandatory field.
tokens-transfers
Query for tokenized transfers.
Example of an answer: https://test.xfiscan.com/api/1.0/token-transfers
contractAddress
string
Contract address.
blockNumber
string
Block number.
address
string
Account address.
addressTo
string
Address to.
addressFrom
string
Address from.
tokenSymbol
string
Token character.
tokenName
string
Name of the token.
txHash
string
Contract hash.
tokenId
string
Token ID.
tokenIds
array[string]
Token ID list.
tokenType
string
Search by token type.
page
number
Page number.
limit
number
The number of entities to give away.
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field Example: '-height' is descending, 'height' is ascending.
tokens-holders
Getting a list of token holders. Example of an answer: https://test.xfiscan.com/api/1.0/token-holders
tokenSymbol
string
Token character
address
string
Account address.
contractAddress
string
Contract address.
blockNumber
string
Block number.
tokenType
string
Search by token type.
page
number
Page number.
limit
number
The number of entities to give away.
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field Example: '-height' is descending, 'height' is ascending.
Token-inventory - ERC-721 token inventory
Asset management and display information about available tokens in the blockchain system.
Example of an answer:
https://test.xfiscan.com/api/1.0/token-inventory
Parameter
Type
Description
contractAddress
string
Smart Contract Address.
creatorAddress
string
The address of the contract creator.
ownerAddress
string
The string representing the CFC-721 token owner аddress to check for inventory.
tokenIds
string
Token ID list.
tokenType
string
Search by token type. Available values: CFC-20, CFC-721
page
number
Page Number.
limit
number
The number of entities to be given away.
sort
string
The sort field takes in values with or without the prefix "-" (minus) which indicates the decreasing or increasing of the specified field
Example: '-height' is descending, 'height' is ascending.
GET /api/1.0/token-inventory/{contractAddress}/{tokenId}
Inventory availability checks at a specific address.
Example of an answer:
Parameter
Type
Description
contractAddress
string
Smart Contract Address.
tokenId
string
Token ID.
search
GET /api/1.0/search
Searching an address, block, transaction, or token based on a passed value.
Example of an answer: https://test.xfiscan.com/api/1.0/search?value=0xf58941E4258320D76BdAb72C5eD8d47c25604e94
value
string
Address, block, transaction or token. Mandatory field.
stream
OPTIONS /api/1.0/stream/new-block Getting a data stream of new block data. OPTIONS /api/1.0/stream/new-tx
Getting a data stream of new transactions.
Per socketio protocol.
Example for js:
where:
url connection: https://test.xfiscan.com/stream, handshake path /api/1.0/stream, new-block - subscribe to receive new blocks, new-tx - subscribe to receive new transactions.
Last updated