Hashing

Arbitrary messages

hash(data)

Calculate hash of transaction

Arguments:
  • data (Buffer) –
Returns:

Buffer – transaction hash

Transactions

hashTransaction(tx)

Calculate hash of transaction

Arguments:
  • tx (hashing.TxBody) – Transaction
Returns:

Promise<string> – transaction hash. If encoding is bytes, the result is a Buffer, otherwise a string.

class TxBody()

interface, exported from hashing

Transaction body. All fields except nonce, from, and chainIdHash are optional and will assume sensible defaults.

TxBody.amount

type: string|number|JSBI|hashing.StringCovertible

TxBody.chainIdHash

type: Uint8Array|string

TxBody.from

type: string|hashing.StringCovertible

TxBody.limit

type: undefined|number

TxBody.nonce

type: number

TxBody.payload

type: null|string|Uint8Array

TxBody.price

type: string|number|JSBI|hashing.StringCovertible

TxBody.sign

type: undefined|string

TxBody.to

type: null|string|hashing.StringCovertible

TxBody.type

type: undefined|number