OperatorService

OperatorService handles all interaction with the operator. This includes things like sending transactions and pulling any pending transactions.


getNextBlock

operator.getNextBlock()

Returns the next block that will be submitted.

Returns

Promise<number>: Next block number.


getEthInfo

operator.getEthInfo()

Returns information about the smart contract.

Returns

Promise<Object>: Smart contract info.


getTransactions

operator.getTransactions(address, startBlock, endBlock)

Returns a list of transactions received by an address between two blocks.

Parameters

  1. address - string: Address to query.
  2. startBlock - number: Block to query from.
  3. endBlock - number: Block to query to.

Returns

Promise<Array>: List of encoded transactions.


getTransaction

operator.getTransaction(encoded)

Returns a transaction proof for a given transaction.

Parameters

  1. encoded - string: The encoded transaction.

Returns

Promise<Object>: Proof information for the transaction.


sendTransaction

operator.sendTransaction(transaction)

Sends a SignedTransaction_ to the operator.

Parameters

  1. transaction - string: The encoded SignedTransaction_.

Returns

Promise<string>: The transaction receipt.


submitBlock

operator.submitBlock()

Attempts to have the operator submit a new block. Won’t work if the operator is properly configured, but used for testing.