Transaction

Object schema

The tx object inherits it’s properties from the transaction object, as specified in the web3 API:

  • from: String - The address for the sending account. Uses the web3.eth.defaultAccount property, if not specified.
  • to: String - (optional) The destination address of the message, left undefined for a contract-creation transaction.
  • value: Number|String|BigNumber - (optional) The value transferred for the transaction in Wei, also the endowment if it’s a contract-creation transaction.
  • gas: Number|String|BigNumber - (optional) The amount of gas to use for the transaction (unused gas is refunded).
  • gasPrice: Number|String|BigNumber - (optional) The price of gas for this transaction in wei, defaults to the mean network gas price.
  • data: String - (optional) Either a byte string containing the associated data of the message, or in the case of a contract-creation transaction, the initialisation code.
  • nonce: Number - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.

Mapping

For some fields, there are multiple encodings available, which are nested as properties on the field. More information on those data types can be found here.

The following is the output of the Elasticsearch mapping for the Transaction type:

{
  "blockHash": {
    "type": "keyword",
    "ignore_above": 256
  },
  "blockNumber": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "contractAddress": {
    "type": "text",
    "fields": {
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "cumulativeGasUsed": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "from": {
    "type": "text",
    "fields": {
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "gas": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "gasPrice": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "gasUsed": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "hash": {
    "type": "keyword",
    "ignore_above": 256
  },
  "publicKey": {
    "type": "keyword",
    "ignore_above": 256
  },
  "creates": {
    "type": "keyword",
    "ignore_above": 256
  },
  "input": {
    "type": "keyword",
    "ignore_above": 256
  },
  "logsBloom": {
    "type": "keyword",
    "ignore_above": 256
  },
  "nonce": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "r": {
    "type": "keyword",
    "ignore_above": 256
  },
  "root": {
    "type": "keyword",
    "ignore_above": 256
  },
  "s": {
    "type": "keyword",
    "ignore_above": 256
  },
  "status": {
    "type": "boolean"
  },
  "timestamp": {
    "type": "date",
    "format": "epoch_second"
  },
  "to": {
    "type": "text",
    "fields": {
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "transactionIndex": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "v": {
    "type": "keyword",
    "ignore_above": 256
  },
  "value": {
    "properties": {
      "num": {
        "type": "long"
      },
      "eth": {
        "type": "double"
      },
      "padded": {
        "type": "keyword",
        "ignore_above": 256
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  }
}