Extends Message
This implements basic functions relating to Dfinity Transactions
Parameters
version
Number the tx version (optional, default0
)to
Buffer the function reference (optional, default0
)caps
Number the number of response capabilities 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
includeSig
(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 signed message
Recovers a public key from a signed message
Parameters
hash
sig
recovery
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 message
Returns Promise resolve with a new instance of DfinityTx