Home

Thorest API

v2.4.1
Base URL
https://vet.nownodes.io

Authentication

api-keyAuthapiKey

API Key: api-key in header

General

Accounts

Retrieve account details

GET
https://vet.nownodes.io/accounts/{address}

Retrieve information about an account or a contract identified by its address.

To access historical details, you can specify a revision as a query parameter.

Parameters

addressstring<hex>requiredpath

The address of the account/ contract

revisionstringquery

Specify either best, a block number or block ID. If omitted, the best block is assumed.

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Inspect clauses

POST
https://vet.nownodes.io/accounts/*

This endpoint can be used for various purposes:

  • Read contract state.
  • Simulate the execution of a transaction. This can be useful to determine if your transaction may revert before submitting it.
  • Inspect the outputs of a transaction before executing it.
  • Estimate the gas consumption of a transaction. Note: The caller field should be provided for higher accuracy.

The fields gasPrice, gasPayer, provedWork, blockRef and expiration are for exposing themselves in EVM. Transaction meta features won't be reflected in the result, for example, no error is returned if the transaction is technically expired. For more information, please refer to the vechain documentation.

To access historical details, you can specify a revision as a query parameter.

Body

application/json
provedWorkstring | null

The transaction's proved work (for extension contract).

gasPayerstring | null

The address of the gas payer (for extension contract).

expirationinteger<uint32> | null

The transaction expiration (for extension contract).

blockRefstring | null

The block reference (for extension contract).

clausesArray<Clause> | null

An array of clauses to be executed.

Show child attributes
tostring | null

The recipient of the clause. Null indicates contract deployment.

valuestring

The hexadecimal representation of the amount (wei) of VET to be transferred.

datastring

The input data for the clause (in bytes).

gasinteger<uint64> | null

The maximum allowed gas for the execution of the batch call.

gasPricestring | null

The absolute gas price for the batch call.

callerstring | null

The caller's address (msg.sender) for the batch call.

Parameters

revisionstringquery

Specify either best, a block number or block ID. If omitted, the best block is assumed.

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Retrieve a contract's bytecode

GET
https://vet.nownodes.io/accounts/{address}/code

If the provided address is not a contract, empty bytecode is returned.

Parameters

addressstring<hex>requiredpath

The address of the account/ contract

revisionstringquery

Specify either best, a block number or block ID. If omitted, the best block is assumed.

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header
GET
https://vet.nownodes.io/accounts/{address}/storage/{key}

This endpoint allows you to retrieve the value stored at a specific storage position ({key}) of a Vechain smart contract associated with the provided address ({address}). The response will contain information about the stored value for the given key.

To access historical details, you can specify a revision as a query parameter.

Parameters

addressstring<hex>requiredpath

The address of the account/ contract

keystringrequiredpath

The unique identifier (key) representing the specific position in the account storage. This key is used to access and retrieve data stored at a particular storage position.

revisionstringquery

Specify either best, a block number or block ID. If omitted, the best block is assumed.

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header
GET
https://vet.nownodes.io/accounts/{address}/storage/raw/{key}

This endpoint retrieves the storage for the given storage position in RAW RLP encoded format. This API is not served as the general purpose API, the storage value needs to be decoded by the caller to serve any further purpose..

Parameters

addressstring<hex>requiredpath

The address of the account/ contract

keystringrequiredpath

The unique identifier (key) representing the specific position in the account storage. This key is used to access and retrieve data stored at a particular storage position.

revisionstringquery

Specify either best, a block number or block ID. If omitted, the best block is assumed.

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Transactions

Retrieve a transaction by ID

GET
https://vet.nownodes.io/transactions/{id}

This endpoint allows you to retrieve a transaction identified by its ID. If the pending parameter is set to true, the response may include a pending transaction with a null meta field. Use this option when you want to retrieve pending transactions, providing flexibility in accessing real-time transaction data.

If no transaction is found, the response will be be a 200 with a null body.

Parameters

idstringrequiredpath

The transaction ID

rawbooleanquery

Whether the response should include a raw transaction represented in hexadecimal format.

headstringquery

Explicitly define the ID of the head block. Best block is assumed if omitted.

pendingbooleanquery

Allows you to indicate whether the response should include transactions that are still pending

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Retrieve transaction receipt

GET
https://vet.nownodes.io/transactions/{id}/receipt

This endpoint allows you to retrieve the receipt of a transaction identified by its ID. If the transaction is not found, the response will be null.

Parameters

idstringrequiredpath

The transaction ID

headstringquery

Explicitly define the ID of the head block. Best block is assumed if omitted.

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Send a transaction

POST
https://vet.nownodes.io/transactions

This endpoint allows you to send a transaction to the blockchain. The transaction must be signed and RLP encoded.

The below is a TypeScript example of how to sign and RLP encode a transaction using the thor-devkit library:

Copied!
import { Transaction, secp256k1 } from 'thor-devkit'

const clauses = [{
    to: '0x7567d83b7b8d80addcb281a71d54fc7b3364ffed',
    value: 10000,
    data: '0x'
}]

let body: Transaction.Body = {
    chainTag: '0x4a',
    blockRef: '0x0000000000000000',
    expiration: 32,
    clauses: clauses,
    gasPriceCoef: 128,
    gas: Transaction.intrinsicGas(clauses),
    dependsOn: null,
    nonce: 12345678
}

const tx = new Transaction(body)
const signingHash = tx.signingHash()
tx.signature = secp256k1.sign(signingHash, Buffer.from("99f0500549792796c14fed62011a51081dc5b5e68fe8bd8a13b86be829c4fd36", "hex"))

const raw = tx.encode()
const decoded = Transaction.decode(raw)

axios.post('http://localhost:8669/transactions', {
  raw: '0x' + raw.toString('hex')
})

Body

application/json
rawstring<hex>

The raw RLP encoded transaction.

Response

200OK

OK

400Bad Request

Bad Request

403Forbidden

Forbidden

Authorization

api-keyAuthapiKey in header

Blocks

Retrieve a block

GET
https://vet.nownodes.io/blocks/{revision}

Retrieve information about a block identified by its revision.

If the provided revision is not found, the response will be null

Parameters

revisionstringrequiredpath

Revision can be one of:

  • a block ID (hex string)
  • a block number (integer)
  • best stands for latest block
  • finalized stands for the finalized block
expandedbooleanquery

Whether the returned block is expanded.

  • true returns transactions as an array of objects with the transaction details and outputs
  • false returns transactions as an array of transaction IDs (hex strings)

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Logs

Query smart contract events

POST
https://vet.nownodes.io/logs/event

Query event logs generated by vechain smart contracts. Events are created using the LOG opcode in the Ethereum Virtual Machine (EVM).

Event logs provide a way to track specific occurrences and state changes within a smart contract. By querying these logs, you can gain insights into the history of events emitted by a particular contract.

Body

application/json
rangeFilterRange | null

Defines the range for filtering. Setting values to null indicates the entire range.

Note: If omitted or set to null, a timeout may occur if there is a large amount of data to query.

Example:

Copied!
{
  "range": {
    "unit": "block",
    "from": 10,
    "to": 1000
  }
}

This refers to the range from block 10 to block 1000.

Show child attributes
unitstring | nullblocktime

Specifies the unit of measurement for the from and to values. Use block for block numbers or time for block timestamps. Default is block.

frominteger<uint64> | null

Defines the starting block number or timestamp for the specified range.

tointeger<uint64> | null

Specifies the ending block number or timestamp for the specified range.

optionsFilterOptions | null

Include these parameters to receive filtered results in a paged format.

Note: If omitted, a timeout may occur if there is a large amount of data to query. If there is a small amount of data you can omit to receive all results in a single response.

Example:

Copied!
{
  "options": {
    "offset": 0,
    "limit": 10
  }
}

In this example, the page offset is 0, and the page size is 10.

Show child attributes
offsetinteger | null

The offset in the matched record set. Use this parameter for pagination.

Default's to 0.

limitinteger | null

The limit of records to be included in the output. Use this parameter for pagination.

Default's to all results.

criteriaSetArray<EventCriteria> | null
Show child attributes
addressstring | null

The address of the contract that emits the event.

topic0string | null

The keccak256 hash representing the event signature. For example, the signature for the Transfer event is keccak256("Transfer(address,address,uint256)").

topic1string | null

Filters events based on the 1st parameter in the event.

Note: The parameter must be padded to 32 bytes.

For example, for the event MySolidityEvent(address,uint256), use topic1 to match the address parameter.

topic2string | null

Filters events based on the 2nd parameter in the event.

Note: The parameter must be padded to 32 bytes.

For example, for the event MySolidityEvent(address,uint256), use topic2 to match the uint256 parameter.

topic3string | null

Filters events based on the 3rd parameter in the event.

Note: The parameter must be padded to 32 bytes.

For example, for the event MySolidityEvent(address,address,uint256), use topic3 to match the uint256 parameter.

topic4string | null

Filters events based on the 4th parameter in the event.

Note: The parameter must be padded to 32 bytes.

For example, for the event MySolidityEvent(address,address,address,uint256), use topic4 to match the uint256 parameter.

orderstring | nullascdesc

Specifies the order of the results. Use asc for ascending order, and desc for descending order.

Default value: asc

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Query VET transfer events

POST
https://vet.nownodes.io/logs/transfer

Query VET transfers with a given criteria.

Body

application/json
rangeFilterRange | null

Defines the range for filtering. Setting values to null indicates the entire range.

Note: If omitted or set to null, a timeout may occur if there is a large amount of data to query.

Example:

Copied!
{
  "range": {
    "unit": "block",
    "from": 10,
    "to": 1000
  }
}

This refers to the range from block 10 to block 1000.

Show child attributes
unitstring | nullblocktime

Specifies the unit of measurement for the from and to values. Use block for block numbers or time for block timestamps. Default is block.

frominteger<uint64> | null

Defines the starting block number or timestamp for the specified range.

tointeger<uint64> | null

Specifies the ending block number or timestamp for the specified range.

optionsFilterOptions | null

Include these parameters to receive filtered results in a paged format.

Note: If omitted, a timeout may occur if there is a large amount of data to query. If there is a small amount of data you can omit to receive all results in a single response.

Example:

Copied!
{
  "options": {
    "offset": 0,
    "limit": 10
  }
}

In this example, the page offset is 0, and the page size is 10.

Show child attributes
offsetinteger | null

The offset in the matched record set. Use this parameter for pagination.

Default's to 0.

limitinteger | null

The limit of records to be included in the output. Use this parameter for pagination.

Default's to all results.

criteriaSetArray<TransferCriteria> | null
Show child attributes
txOriginstring | null

The address from which the transaction was sent.

senderstring | null

The address that sent the VET. In most cases this is the same as txOrigin, but it may be different if the VET was sent by a contract.

recipientstring | null

The address that received the VET.

orderstring | nullascdesc

Specifies the order of the results. Use asc for ascending order, and desc for descending order.

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Node

Retrieve connected peers

GET
https://vet.nownodes.io/node/network/peers

Retrieve information about the peers connected to the node.

Response

200OK

OK

Authorization

api-keyAuthapiKey in header

Subscriptions

(Websocket) Blocks

GET
https://vet.nownodes.io/subscriptions/block

Establish a websocket connection to the node to receive real-time updates on new blocks.

This endpoint can also be used to resume a subscription from a specific point in time.

Example:

Copied!
const ws = new WebSocket('ws://localhost:8669/subscriptions/block')

ws.onmessage = (event) => {
  console.log(event.data)
}

Parameters

posstringquery

A saved block ID for resuming the subscription. If omitted, the best block ID is assumed.

Note: If the provided position is too far behind the best block, a 403 error will be thrown. The allowable difference depends on the configuration of each node.

See the argument api-backtrace-limit when starting a node.

Response

200OK

OK

400Bad Request

Bad Request

403Forbidden

Forbidden

Authorization

api-keyAuthapiKey in header

(Websocket) Events

GET
https://vet.nownodes.io/subscriptions/event

Subscribe to events generated by vechain smart contracts. Events are created using the LOG opcode in the Ethereum Virtual Machine (EVM).

Example:

Copied!

// Filter the events by 'Transfer(address,address,uint256)'
const ws = new WebSocket('ws://localhost:8669/subscriptions/event?t0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef')

ws.onmessage = (event) => {
  console.log(event.data)
}

Parameters

posstringquery

A saved block ID for resuming the subscription. If omitted, the best block ID is assumed.

Note: If the provided position is too far behind the best block, a 403 error will be thrown. The allowable difference depends on the configuration of each node.

See the argument api-backtrace-limit when starting a node.

addrstringquery

The address of the contract that emits the event.

t0stringquery

The keccak256 hash representing the event signature. For example, the signature for the Transfer event is keccak256("Transfer(address,address,uint256)").

t1stringquery

Filters events based on the 1st parameter in the event.

Note: The parameter must be padded to 32 bytes.

For example, for the event MySolidityEvent(address,uint256), use t1 to match the address parameter.

t2stringquery

Filters events based on the 2nd parameter in the event.

Note: The parameter must be padded to 32 bytes.

For example, for the event MySolidityEvent(address,uint256), use t2 to match the uint256 parameter.

t3stringquery

Filters events based on the 3rd parameter in the event.

Note: The parameter must be padded to 32 bytes.

For example, for the event MySolidityEvent(address,address,uint256), use t3 to match the uint256 parameter.

Response

200OK

OK

400Bad Request

Bad Request

403Forbidden

Forbidden

Authorization

api-keyAuthapiKey in header

(Websocket) Transfers

GET
https://vet.nownodes.io/subscriptions/transfer

Subscribe to VET transfers with a given criteria.

Example:

Copied!
const ws = new WebSocket('ws://localhost:8669/subscriptions/transfer?sender=0x6d95e6dca01d109882fe1726a2fb9865fa41e7aa')

ws.onmessage = (event) => {
  console.log(event.data)
}

Parameters

posstringquery

A saved block ID for resuming the subscription. If omitted, the best block ID is assumed.

Note: If the provided position is too far behind the best block, a 403 error will be thrown. The allowable difference depends on the configuration of each node.

See the argument api-backtrace-limit when starting a node.

txOriginstringquery

The address from which the transaction was sent.

recipientstringquery

The address that received the VET.

senderstringquery

The address that sent the VET. In most cases this is the same as txOrigin, but it may be different if the VET was sent by a contract.

Response

200OK

OK

400Bad Request

Bad Request

403Forbidden

Forbidden

Authorization

api-keyAuthapiKey in header

(Websocket) Beats

GET
https://vet.nownodes.io/subscriptions/beat2

Establish a websocket connection to receive blockchain beats, which contain a summary of new blocks and bloom filters composited with affected addresses.

Example:

Copied!
const ws = new WebSocket('ws://localhost:8669/subscriptions/beat2')

ws.onmessage = (event) => {
  console.log(event.data)
}

Parameters

posstringquery

A saved block ID for resuming the subscription. If omitted, the best block ID is assumed.

Note: If the provided position is too far behind the best block, a 403 error will be thrown. The allowable difference depends on the configuration of each node.

See the argument api-backtrace-limit when starting a node.

Response

200OK

OK

400Bad Request

Bad Request

403Forbidden

Forbidden

Authorization

api-keyAuthapiKey in header

(Websocket) Subscribe to new transactions

GET
https://vet.nownodes.io/subscriptions/txpool

Establish a websocket connection to receive real-time updates on transactions that are pending inclusion in a future block.

Example:

Copied!
const ws = new WebSocket('ws://localhost:8669/subscriptions/txpool')

ws.onmessage = (event) => {
  console.log(event.data)
}

Response

200OK

OK

400Bad Request

Bad Request

403Forbidden

Forbidden

Authorization

api-keyAuthapiKey in header

(Websocket) Subscribe to Blockchain Beats

deprecated
GET
https://vet.nownodes.io/subscriptions/beat

Establish a websocket connection to receive blockchain beats, which contain a summary of new blocks and bloom filters composited with affected addresses.

Example:

Copied!
const ws = new WebSocket('ws://localhost:8669/subscriptions/beat')

ws.onmessage = (event) => {
  console.log(event.data)
}

Parameters

posstringquery

A saved block ID for resuming the subscription. If omitted, the best block ID is assumed.

Note: If the provided position is too far behind the best block, a 403 error will be thrown. The allowable difference depends on the configuration of each node.

See the argument api-backtrace-limit when starting a node.

Response

200OK

OK

400Bad Request

Bad Request

403Forbidden

Forbidden

Authorization

api-keyAuthapiKey in header

Debug

Trace a transaction clause

POST
https://vet.nownodes.io/debug/tracers

This endpoint allows you to create a tracer for a specific clause. Tracers are instrumental in monitoring and analyzing the execution flow within the EVM. You can customize the tracer using various options to tailor it to your specific debugging needs.

Body

application/json
namestring | null4bytecallnoopprestateunigrambigramtrigramevmdisopcount

The name of the tracer. An empty name stands for the default struct logger tracer.

configobject | null

The configuration of the tracer. It is specific to the name

targetstring

The unified path of the target to be traced. Currently, only the clause is supported.

Format: blockID/(txIndex|txId)/clauseIndex

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Trace a contract call

POST
https://vet.nownodes.io/debug/tracers/call

This endpoint enables clients to create a tracer for a specific vechain function call.

You can customize the tracer using various options to suit your debugging requirements.

Body

application/json
namestring | null4bytecallnoopprestateunigrambigramtrigramevmdisopcount

The name of the tracer. An empty name stands for the default struct logger tracer.

configobject | null

The configuration of the tracer. It is specific to the name

valuestring

The amount of token to be transferred.

datastring

The input data for the contract call.

tostring | null

The recipient of the call. Null indicates contract deployment.

gasinteger<uint64> | null

The maximum allowed gas for execution.

gasPricestring | null

The absolute gas price.

callerstring | null

The caller's address (msg.sender).

provedWorkstring | null

The transaction's proved work (for extension contract).

gasPayerstring | null

The address of the gas payer (for extension contract).

expirationinteger<uint32> | null

The transaction expiration (for extension contract).

blockRefstring | null

The block reference (for extension contract).

Parameters

headstringquery

Explicitly define the ID of the head block. Best block is assumed if omitted.

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header

Retrieve storage range

POST
https://vet.nownodes.io/debug/storage-range

The endpoint retrieves storage entries related to a particular clause execution and contract address. This could be useful for inspecting or analyzing storage changes.

Body

application/json
addressstring

The address of the contract/ account to be traced.

keyStartstring | null

The start key of the storage range. Default is 0x0000000000000000000000000000000000000000000000000000000000000000

maxResultnumber | null

The maximum number of results to be returned. Default is 1000.

targetstring

The unified path of the transaction clause.

Format: blockID/(txIndex|txId)/clauseIndex

Response

200OK

OK

400Bad Request

Bad Request

Authorization

api-keyAuthapiKey in header