Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HandlerBasedContract<State>

An implementation of Contract that is backwards compatible with current style of writing SW contracts (ie. using the "handle" function).

It requires ExecutorFactory that is using HandlerApi generic type.

Type parameters

  • State

Hierarchy

  • HandlerBasedContract

Implements

Index

Constructors

constructor

Properties

Private evaluationOptions

evaluationOptions: EvaluationOptions = ...

Optional networkInfo

networkInfo: NetworkInfoInterface = null

Private Optional wallet

wallet: ArWallet

Methods

connect

Private createExecutionContext

Private createExecutionContextFromTx

Private maybeClearNetworkInfo

  • maybeClearNetworkInfo(): void

readState

  • readState(blockHeight?: number, currentTx?: { contractTxId: string; interactionTxId: string }[]): Promise<EvalStateResult<State>>

setEvaluationOptions

viewState

viewStateForTx

  • A version of the viewState method to be used from within the contract's source code. The transaction passed as an argument is the currently processed interaction transaction. The "caller" will be se to the owner of the interaction transaction, that requires to call this method.

    note: calling "interactRead" from withing contract's source code was not previously possible - this is a new feature.

    Type parameters

    • Input

    • View

    Parameters

    Returns Promise<InteractionResult<State, View>>

Private waitForConfirmation

  • waitForConfirmation(transactionId: string): Promise<TransactionStatusResponse>

writeInteraction

  • writeInteraction<Input>(input: Input, tags?: Tags, transfer?: ArTransfer): Promise<string>

Generated using TypeDoc