Hive Multisig SDK
  • Welcome!
  • Quick Start
  • WebSocket flow
    • 1 - Users connect to the Websocket
    • 2 - User A requests a transaction
    • 3 - User B receives the signature request
    • 4 - User B signs the transaction
    • 5 - User B broadcasts the transaction
    • 6 - Users both receive a successful broadcast notification
  • API
  • Utils
    • Encode Transaction
    • Decode Transaction
  • Static helpers
    • Get/Reset HiveMultisig instance
    • Get Signers
    • Get Authorities
    • Validate Initiator
  • Demo
Powered by GitBook
On this page
  • SignatureRequestCallback type
  • SignatureRequest object
  • Signer object
  1. WebSocket flow

3 - User B receives the signature request

Previous2 - User A requests a transactionNext4 - User B signs the transaction

Last updated 1 year ago

The user can receive signature requests either through or through the following process.

When the user has successfully subscribed to the WebSocket, they may then proceed to subscribe to real-time signature request notifications.

const signRequestCallback:SignatureRequestCallback =  async (message: SignatureRequest) => {
   // the user can decode the transaction here
   console.log(message);
  };

await multisig.wss.onReceiveSignRequest(signRequestCallback);

SignatureRequestCallback type

Field
Description
Type

SignatureRequestCallback

A function that accepts a SignatureRequest object as an argument.

function

SignatureRequest object

Property
Description
Type

id

An id assigned by the backend.

number

expirationDate

The expiration date set by the initiator.

Date

threshold

The minimum number of weight required before broadcasting the transaction.

number

keyType

The type of key subscribing to the WebSocket. Can be "Active" or "Posting"

KeychainKeyTypes enum

initiator

The username of transaction initiator.

string

broadcasted

The flag set by the backend when a transaction hahs been broadcasted. True when it is broadcasted otherwise False.

boolean

createdAt

Creation date of the request.

Date

signers

An array of Signer object

Signer object

status

The current status of the signature request set by the backend. It can be Pending, Expired, or Broadcasted.

string

Signer object

Property
Description
Type

id

An id assigned by the backend.

number

publicKey

The public key of the signer with respect to the keyType used in the transaction.

string

encrptedTransaction

The encrypted transaction string.

string

weight

The weight of the signer.

number

signature

The signature of the signer

string (optional)

subscribing to Websocket