Extends Message
This implements basic functions relating to Dfinity Transactions
Parameters
versionNumber the tx version (optional, default0)toBuffer the address of the contract this tx is too (optional, defaultnewUint8Array(20))capsNumber the number of repsonse capablities this message has (optional, default0)ticksNumber the number of to allocate for this message (optional, default0)ticksPriceNumber the price by ticks (optional, default0)nonceNumber (optional, default0)dataBuffer (optional, default0)publicKeyBuffer (optional, defaultnewUint8Array(32))signatureBuffer (optional, defaultnewUint8Array([]))recoveryNumber (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
secretKeyBuffer 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
dataBuffer the data to be hashed
Returns Promise resolves with 32 bytes of hashed data
Recovers a public key from a signed message
Parameters
serializedBuffer the serialized message
Returns Promise resolves with a 32 byte public key
deserializes the message and returns a new instance of DfinityTx
Parameters
rawBuffer the serialized raw messsage
Returns Promise resolve with a new instance of DfinityTx