Meterest
v1.2.2https://meter.nownodes.ioRESTful API to access Meter.io
Authentication
api-keyAuthapiKeyAPI Key: api-key in header
API Reference
Accounts
Access to account objects
Retrieve account detail
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
includes balance, energy and hasCode, by account address. An account with hasCode be true is a contract.
Historical account detail can be queried by specifying revision query string.
Parameters
addressstring<bytes20>requiredpathaddress of account
revisionstringquerycan be block number or ID. best block is assumed if omitted.
Response
OK
Execute account code
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
to simulate contract method call, without sending transaction to block chain.
It's useful to estimate gas usage and execution result of a clause.
Body
arguments and environment
valuestringamount of token to be transferred
datastringinput data for contract call
gasinteger<uint64>max allowed gas for execution
gasPricestringabsolute gas price
callerstringcaller address (msg.sender)
Parameters
addressstring<bytes20>requiredpathaddress of account
revisionstringquerycan be block number or ID. best block is assumed if omitted.
Response
OK
Execute a batch of codes
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
to simulate execution of a transaction.
Body
arguments and environment
clausesArray<Clause>gasinteger<uint64>max allowed gas for execution
gasPricestringabsolute gas price
callerstringcaller address (msg.sender)
Parameters
revisionstringquerycan be block number or ID. best block is assumed if omitted.
Response
OK
Execute bytecodes
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
to simulate contract deployment without sending transaction to block chain.
It's useful to estimate gas usage and contract deployment result of a clause.
TIPS:
datain request body is the bytecodes of a contractdatain response body is the runtime bytecodes assigned to account which the contract to be deployed
Body
arguments and environment
valuestringamount of token to be transferred
datastringinput data for contract call
gasinteger<uint64>max allowed gas for execution
gasPricestringabsolute gas price
callerstringcaller address (msg.sender)
Parameters
revisionstringquerycan be block number or ID. best block is assumed if omitted.
Response
OK
Retrieve account code
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
if any. Here the code is runtime bytecodes.
Parameters
addressstring<bytes20>requiredpathaddress of account
revisionstringquerycan be block number or ID. best block is assumed if omitted.
Response
OK
Retrieve account storage value
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
for given key.
Parameters
addressstring<bytes20>requiredpathaddress of account
keystringrequiredpaththe key(position) to access account storage
revisionstringquerycan be block number or ID. best block is assumed if omitted.
Response
OK
Transactions
Access to transactions
Retrieve transaction
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
by ID.
Parameters
idstringrequiredpathID of transaction
rawbooleanquerywhether retrieve a raw transaction.
headstringqueryID of head block. best block is assumed if omitted
Response
OK
Retrieve transaction receipt
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
by ID.
Parameters
idstringrequiredpathID of transaction
headstringqueryID of head block. best block is assumed if omitted
Response
OK
Commit transaction
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
in raw or structured format. If no signature in structured format,
signingHash is returned in response body.
Body
rawstringhex form of encoded transaction
chainTaginteger<uint8>last byte of genesis block ID
blockRefstring8 bytes prefix of some block ID
expirationinteger<uint32>expiration relative to blockRef, in unit block
clausesArray<Clause>gasPriceCoefinteger<uint8>coefficient used to calculate the final gas price
gasinteger<uint64>max amount of gas can be consumed to execute this transaction
dependsOnstring<bytes32>ID of the transaction on which the current transaction depends on. can be null.
noncestringsignaturestringsignature hex string
chainTaginteger<uint8>last byte of genesis block ID
blockRefstring8 bytes prefix of some block ID
expirationinteger<uint32>expiration relative to blockRef, in unit block
clausesArray<Clause>gasPriceCoefinteger<uint8>coefficient used to calculate the final gas price
gasinteger<uint64>max amount of gas can be consumed to execute this transaction
dependsOnstring<bytes32>ID of the transaction on which the current transaction depends on. can be null.
noncestringResponse
OK
Blocks
Access to blocks
Retrieve block
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
by ID or number, or 'best' for latest block.
Parameters
revisionstringrequiredpathblock ID or number, or 'best' stands for latest block
Response
OK
Logs
Access to event & transfer logs
Filter event logs
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Event logs are produced by OP_LOG in EVM.
Body
rangeFilterRangedefines the range to filter in. e.g.
{
"range": {
"unit": "block",
"from": 10,
"to": 1000
}
}refers to the range from block 10 to block 1000.
null stands for the full range.
optionsFilterOptionspass these parameters if you need filtered results paged. e.g.
{
"options": {
"offset": 0,
"limit": 10
}
}the above refers that page offset is 0, and the page size is 10.
pass options null if you don't need to demand paging.
criteriaSetArray<EventCriteria>orderstringascdescorder of filters, defaults to asc
Response
OK
Filter transfer logs
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Transfer logs are recorded on MTRG transferring.
Body
rangeFilterRangedefines the range to filter in. e.g.
{
"range": {
"unit": "block",
"from": 10,
"to": 1000
}
}refers to the range from block 10 to block 1000.
null stands for the full range.
optionsFilterOptionspass these parameters if you need filtered results paged. e.g.
{
"options": {
"offset": 0,
"limit": 10
}
}the above refers that page offset is 0, and the page size is 10.
pass options null if you don't need to demand paging.
criteriaSetArray<TransferCriteria>orderstringascdescorder of filters, defaults to asc
Response
OK
Filter event logs
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Event logs are produced by OP_LOG in EVM.
Body
event filter criteria
rangeFilterRangedefines the range to filter in. e.g.
{
"range": {
"unit": "block",
"from": 10,
"to": 1000
}
}refers to the range from block 10 to block 1000.
null stands for the full range.
optionsFilterOptionspass these parameters if you need filtered results paged. e.g.
{
"options": {
"offset": 0,
"limit": 10
}
}the above refers that page offset is 0, and the page size is 10.
pass options null if you don't need to demand paging.
topicSetsArray<TopicSetLegacy>Parameters
orderstringascdescqueryorder of filters, defaults to asc
addressstringqueryaddress of account which is the events emitter
Response
OK
Filter transfer logs
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Transfer logs are recorded on MTR transferring.
Body
transfer log filter criteria
rangeFilterRangedefines the range to filter in. e.g.
{
"range": {
"unit": "block",
"from": 10,
"to": 1000
}
}refers to the range from block 10 to block 1000.
null stands for the full range.
optionsFilterOptionspass these parameters if you need filtered results paged. e.g.
{
"options": {
"offset": 0,
"limit": 10
}
}the above refers that page offset is 0, and the page size is 10.
pass options null if you don't need to demand paging.
addressSetsArray<AddressSetLegacy>Parameters
orderstringascdescqueryorder of filters, defaults to asc
Response
OK
Filter event logs
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Body
event filter criteria
rangeFilterRangedefines the range to filter in. e.g.
{
"range": {
"unit": "block",
"from": 10,
"to": 1000
}
}refers to the range from block 10 to block 1000.
null stands for the full range.
optionsFilterOptionspass these parameters if you need filtered results paged. e.g.
{
"options": {
"offset": 0,
"limit": 10
}
}the above refers that page offset is 0, and the page size is 10.
pass options null if you don't need to demand paging.
topicSetsArray<TopicSetLegacy>Parameters
orderstringascdescqueryorder of filters, defaults to asc
addressstringqueryaddress of account which is the events emitter
Response
OK
Filter transfer logs
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Body
transfer log filter criteria
rangeFilterRangedefines the range to filter in. e.g.
{
"range": {
"unit": "block",
"from": 10,
"to": 1000
}
}refers to the range from block 10 to block 1000.
null stands for the full range.
optionsFilterOptionspass these parameters if you need filtered results paged. e.g.
{
"options": {
"offset": 0,
"limit": 10
}
}the above refers that page offset is 0, and the page size is 10.
pass options null if you don't need to demand paging.
addressSetsArray<AddressSetLegacy>Parameters
orderstringascdescqueryorder of filters, defaults to asc
Response
OK
Node
Access to node status info
Retrieve connected peers
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Response
OK
Retrieve current committee members
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Subscriptions
Subscribe interested subjects
(Websocket) Subscribe new blocks
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Parameters
posstringquerya saved block ID for resuming the subscription. best block ID is assumed if omitted.
Response
OK
(Websocket) Subscribe new events
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
which satisfy criteria in query.
Parameters
posstringquerya saved block ID for resuming the subscription. best block ID is assumed if omitted.
addrstringqueryaddress of event emitter
t0stringquerytopic0 of event
t1stringquerytopic1 of event
t2stringquerytopic2 of event
t3stringquerytopic3 of event
t4stringquerytopic4 of event
Response
OK
(Websocket) Subscribe new transfers
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
which satisfy criteria in query.
Parameters
posstringquerya saved block ID for resuming the subscription. best block ID is assumed if omitted.
txOriginstringquerysigner address of tx which contains the transfer
senderstringqueryaddress of token sender
recipientstringqueryaddress of token recipient
Response
OK
(Websocket) Subscribe block chain's beats
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
which contain summary of new blocks, and bloom filters that composited with affected addresses.
Parameters
posstringquerya saved block ID for resuming the subscription. best block ID is assumed if omitted.
Response
OK
Debug
Debug utilities
Create a tracer
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
for a clause
Body
namestring4bytebigramcallevmdisnoopopcountprestatetrigramunigramname of tracer. Empty name stands for default struct logger tracer.
targetstringthe unified path of target to be traced.
Currently, only clause is supported. Format:
blockID/(txIndex|txId)/clauseIndex
Response
OK
Retrieve storage range
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
of the account with given address
Body
addressstringaddress of account
keyStartstringmaxResultnumbertargetstringResponse
OK
Staking
Access to staking data
Retrieve staking buckets
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Retrieve staking candidates
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Retrieve staking stakeholder
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.
Retrieve staking delegates for consensus
Authorizations
ApiKeyAuthApiKeyAuthapi-key string
NOWNodes API key passed in the api-key header.