Accounts

Retrieve account detail

get

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.

Path parameters
addressstring · bytes20Required

address of account

Example: 0x5034aa590125b64023a0262112b98d72e3c8e40e
Query parameters
revisionstringOptional

can be block number or ID. best block is assumed if omitted.

Responses
application/json
objectOptional
get
GET /accounts/{address} HTTP/1.1
Host: meter.nownodes.io
Accept: */*
200

OK

{
  "balance": "0x47ff1f90327aa0f8e",
  "energy": "0xcf624158d591398",
  "hasCode": false
}

Execute account code

post

to simulate contract method call, without sending transaction to block chain.

It's useful to estimate gas usage and execution result of a clause.

Path parameters
addressstring · bytes20Required

address of account

Example: 0x5034aa590125b64023a0262112b98d72e3c8e40e
Query parameters
revisionstringOptional

can be block number or ID. best block is assumed if omitted.

Body
valuestringOptional

amount of token to be transferred

datastringOptional

input data for contract call

gasinteger · uint64Optional

max allowed gas for execution

gasPricestringOptional

absolute gas price

callerstringOptional

caller address (msg.sender)

Responses
application/json
objectOptional
post
POST /accounts/{address} HTTP/1.1
Host: meter.nownodes.io
Content-Type: application/json
Accept: */*
Content-Length: 65

{
  "value": "0xde0b6b3a7640000",
  "data": "0x5665436861696e2054686f72"
}
200

OK

{
  "data": "0x103556a73c10e38ffe2fc4aa50fc9d46ad0148f07e26417e117bd1ece9d948b5",
  "events": [],
  "transfers": [],
  "gasUsed": 21000,
  "reverted": false,
  "vmError": ""
}

Execute bytecodes

post

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:

  • data in request body is the bytecodes of a contract
  • data in response body is the runtime bytecodes assigned to account which the contract to be deployed
Query parameters
revisionstringOptional

can be block number or ID. best block is assumed if omitted.

Body
valuestringOptional

amount of token to be transferred

datastringOptional

input data for contract call

gasinteger · uint64Optional

max allowed gas for execution

gasPricestringOptional

absolute gas price

callerstringOptional

caller address (msg.sender)

Responses
application/json
objectOptional
post
POST /accounts HTTP/1.1
Host: meter.nownodes.io
Content-Type: application/json
Accept: */*
Content-Length: 65

{
  "value": "0xde0b6b3a7640000",
  "data": "0x5665436861696e2054686f72"
}
200

OK

{
  "data": "0x103556a73c10e38ffe2fc4aa50fc9d46ad0148f07e26417e117bd1ece9d948b5",
  "events": [],
  "transfers": [],
  "gasUsed": 21000,
  "reverted": false,
  "vmError": ""
}