Skip to content

Latest commit

 

History

History
81 lines (49 loc) · 3.66 KB

index.md

File metadata and controls

81 lines (49 loc) · 3.66 KB

Table of Contents

index

index.js:20-120

Extends Message

This implements basic functions relating to Dfinity Transactions

Parameters

  • version Number the tx version (optional, default 0)
  • to Buffer the function reference (optional, default 0)
  • caps Number the number of response capabilities this message has (optional, default 0)
  • ticks Number the number of to allocate for this message (optional, default 0)
  • ticksPrice Number the price by ticks (optional, default 0)
  • nonce Number (optional, default 0)
  • data Buffer (optional, default 0)
  • publicKey Buffer (optional, default newUint8Array(32))
  • signature Buffer (optional, default newUint8Array([]))
  • recovery Number (optional, default 0)

serialize

index.js:25-40

serializes the message

Parameters

  • includeSig (optional, default this.signature.length!==0)

Returns Buffer

sign

index.js:47-54

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

recoverPublicKey

index.js:61-69

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

deserialize

index.js:76-104

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