Extends Message
This implements basic functions relating to Dfinity Transactions
Parameters
version
Number the tx version (optional, default0
)to
Buffer the address of the contract this tx is too (optional, defaultnewUint8Array(20)
)caps
Number the number of repsonse capablities this message has (optional, default0
)ticks
Number the number of to allocate for this message (optional, default0
)ticksPrice
Number the price by ticks (optional, default0
)nonce
Number (optional, default0
)data
Buffer (optional, default0
)publicKey
Buffer (optional, defaultnewUint8Array(32)
)signature
Buffer (optional, defaultnewUint8Array([])
)recovery
Number (optional, default0
)
serializes the message
Parameters
inculdeSig
(optional, defaultthis.signature.length!==0
)
Returns Buffer
signs a message and returns the serialized and signed message
Parameters
secretKey
Buffer a 32 bytes buffer to use as a secret key
Returns Promise resolve with a Buffer containing the sinded message
Gets the SHA-256 hash for some given data
Parameters
data
Buffer the data to be hashed
Returns Promise resolves with 32 bytes of hashed data
Recovers a public key from a signed message
Parameters
serialized
Buffer the serialized message
Returns Promise resolves with a 32 byte public key
deserializes the message and returns a new instance of DfinityTx
Parameters
raw
Buffer the serialized raw messsage
Returns Promise resolve with a new instance of DfinityTx