This class is the main entrypoint to interact with the DesmoHub contract. It is responsible for calling all the functions of the contract and returning the results.

Hierarchy

  • DesmoHub

Constructors

Properties

REQUEST_ID: Subject<IRequestIDEvent>
TDD_CREATED: Subject<ITDDCreatedEvent>
TDD_DISABLED: Subject<ITDDDisabledEvent>
TDD_ENABLED: Subject<ITDDEnabledEvent>
TRANSACTION_SENT: Subject<ISentTransaction>
_isConnected: boolean
_isListening: boolean
_walletSigner: WalletSigner
abiInterface: Interface
contract: Contract
requestID$: Observable<IRequestIDEvent>
tddCreated$: Observable<ITDDCreatedEvent>
tddDisabled$: Observable<ITDDDisabledEvent>
tddEnabled$: Observable<ITDDEnabledEvent>
transactionSent$: Observable<ISentTransaction>

Accessors

  • get isConnected(): boolean
  • Returns

    whether the wallet signer is connected to the DesmoHub contract.

    Returns boolean

  • get isListening(): boolean
  • Returns

    whether the desmoHub is listening for events.

    Returns boolean

Methods

  • Parameters

    • eventFilter: EventFilter
    • listener: Listener

    Returns void

  • This method is used to connect the wallet signer to the DesmoHub contract.

    Returns void

  • This method is used to call the homonym function on the smart contract that disable a TDD. It produce an event when the transaction is sent. It is possible to get the result of the transaction by subscribing to the tddDisabled$ observable, after having activated the listeners.

    Returns Promise<void>

  • This method is used to call the homonym function on the smart contract that enable a TDD. It produce an event when the transaction is sent. It is possible to get the result of the transaction by subscribing to the tddEnabled$ observable, after having activated the listeners.

    Returns Promise<void>

  • This method is used to call the homonym function on the smart contract to get a new Request id. It produce an event when the transaction is sent. It is possible to get the result of the transaction by subscribing to the requestID$ observable, after having activated the listeners.

    Returns Promise<void>

  • Get the scores relative to a request id.

    Returns

    Parameters

    • requestID: Bytes

    Returns Promise<Bytes>

  • Get TDD by request id.

    Returns

    Parameters

    • requestID: Bytes

    Returns Promise<string[]>

  • Returns

    the length of the TDD storage.

    Returns Promise<BigNumber>

  • This method is used to call the homonym function on the smart contract that register a new TDD. It produce an event when the transaction is sent. It is possible to get the result of the transaction by subscribing to the tddCreated$ observable, after having activated the listeners.

    Parameters

    • tddUrl: string

      the url of the TDD to be created.

    Returns Promise<void>

  • This method start the listeners. It is possible to get the result of a transction by subscribing to the following observables:

    • transactionSent$
    • tddCreated$
    • tddDisabled$
    • tddEnabled$
    • requestID$

    Returns Promise<void>

Generated using TypeDoc