Tx-Validation

Send transaction and simultaneously ensure they are valid

Transactions are added to a block only if they pass the node's validation test.

Use the Tx Validation utility to send transactions while, at the same time, ensure that you are constructing your transactions correctly, i.e. that they will pass the test.

Send the transaction using the request format below. The response will include:

  1. Your request in the format that should be used when sending it to CloudAPI

  2. Details about the transaction such as gas price and value

  3. If an error occurred, information about the error

Tx Validation adds a layer of usability to the existing node validation utility.

When adding node_validation: true to a transaction request you will receive an error response only if your transaction was not valid.

Using Tx Validation you will always get a response and additional information is provided regarding errors, if and when they occur.

REQUEST

# ETH example
https://tools.bloxroute.com/txvalidation?transaction=<TX_RAW_DATA>&auth_header=<AUTH_HEADER>

# BSC example
https://tools.bloxroute.com/txvalidation?transaction=<TX_RAW_DATA>&auth_header=<AUTH_HEADER>&blockchain_network=BSC-Mainnet

Parameters

Parameters

NameDescription Options & Additional notes

auth_header

Allows the user to include the authentication in the URL string directly.

If the authentication is provided in both the header and the URL parameter, the one in the header will be used.

blockchain_network

Blockchain network name.

Optional. Available options are: Mainnet, BSC-Mainnet. Default: Mainnet

nonce_monitoring

A boolean flag indicating if Tx Nonce Monitoring should be enabled for the transaction.

Optional. Default: False

validators_only

Support for semi private transactions in all networks.

Optional. Must be false when using node validation. Default: False

next_validator

Transaction should be sent to the next validator.

Optional. Must be false when using node validation. Default: False

RESPONSE

Examples

for a valid transaction:

{
  "request": {
      "method": "blxr_tx",
      "params": {
          "transaction": "02f88f010c843b9aca00843b9aca00830291df9429112b276c53c27ad62bdd1b1b1806de317fbce080a4a0712d680000000000000000000000000000000000000000000000000000000000000001c001a032123092eeb64fd7b59cfe2eecfc87976e51d12e8eb89c3f46298bfde0d4c977a04565140ac0d6c4ec3e296834a8886f28a721f3bd3ec86e77edc2da0b2caa7cb8",
          "blockchain_network": "Mainnet",
          "nonce_monitoring": false,
          "validators_only": false,
          "next_validator": false,
          "node_validation": true
      },
      "id": 1,
      "jsonrpc": "2.0"
  },
  "txData": {
      "to": "0x29112b276c53c27ad62bdd1b1b1806de317fbce0",
      "gasPrice": 1000000000,
      "value": 0,
      "hash": "0xb01a07a594d8110dff7ce266ac14b6c1907dbe90bd117221cfb04dc3c2a1be97",
      "nonce": 12,
      "gas": 168415
  }
}

for an invalid transaction - nonce too low:

{
  "request": {
      "method": "blxr_tx",
      "params": {
          "transaction": "f86a028506fc23ac00832dc6c0948915a2d490e7a985c79aee594f00e6f660e06c788307a12080820136a00a7996fb5e1bd1909cbece36a03fec211f75dbefc5fa1626766593f3a2200631a03831562f7d8002cfef49d72dd88e5a78ce1b1526f6a18c9a5c79fab513a57704",
          "blockchain_network": "BSC-Mainnet",
          "nonce_monitoring": false,
          "validators_only": false,
          "next_validator": false,
          "node_validation": true
     },
      "id": 0,
      "jsonrpc": "2.0"
  },
  "error": {
      "code": 0,
      "message": "jsonrpc2: code -32602 message: Invalid params - Data: "tx (2623e9129c1871145feb7bf68b6c79f4cbcfe857a325f5ed3e778b0eb95a1286) failed node validation with error: nonce too low"",
      "data": null
  },
  "txData": {
      "from": "0x8915a2d490e7a985c79aee594f00e6f660e06c78",
      "gas": "0x2dc6c0",
      "gasPrice": "0x6fc23ac00",
      "hash": "0x2623e9129c1871145feb7bf68b6c79f4cbcfe857a325f5ed3e778b0eb95a1286",
      "input": "0x",
      "nonce": "0x2",
      "r": "0xa7996fb5e1bd1909cbece36a03fec211f75dbefc5fa1626766593f3a2200631",
      "s": "0x3831562f7d8002cfef49d72dd88e5a78ce1b1526f6a18c9a5c79fab513a57704",
      "to": "0x8915a2d490e7a985c79aee594f00e6f660e06c78",
      "type": "0x0",
      "v": "0x136",
      "value": "0x7a120"
  }
}

Last updated