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|Record<string,any>
-
TxBody.
chainIdHash
¶ type: Uint8Array|string
-
TxBody.
from
¶ type: string|Record<string,any>
-
TxBody.
limit
¶ type: undefined|number
-
TxBody.
nonce
¶ type: number
-
TxBody.
payload
¶ type: null|Uint8Array
-
TxBody.
price
¶ type: string|number|JSBI|Record<string,any>
-
TxBody.
sign
¶ type: undefined|string
-
TxBody.
to
¶ type: null|string|Record<string,any>
-
TxBody.
type
¶ type: undefined|number
-