Options
All
  • Public
  • Public/Protected
  • All
Menu
class

BaseContract

package

Governable

subpackage

Kernel

since

v1.0.0

description

Abstract class that describes executable contracts that involve governable digital assets.

Hierarchy

Implements

Index

Constructors

constructor

Properties

context

context: Context

Accessors

descriptor

  • get descriptor(): string

name

  • get name(): string

Protected transactions

  • get transactions(): Transaction[]
  • Build a contract's transactions. Transactions returned here will be formatted to a transaction URI in the execute() step.

    Returns Transaction[]

Methods

Protected assertExecutionAllowance

  • assertExecutionAllowance(actor: PublicAccount, argv: ContractOption[] | undefined): boolean
  • Asserts the allowance of actor to execute the contract.

    throws

    {FailureOperationForbidden} On denial of authorization

    Parameters

    Returns boolean

Protected assertHasMandatoryArguments

  • assertHasMandatoryArguments(argv: ContractOption[] | undefined, fields: string[]): boolean
  • Asserts the presence of fields in argv.

    throws

    {FailureMissingArgument} On missing mandatory argument(s).

    Parameters

    Returns boolean

Abstract canExecute

Abstract execute

  • execute(actor: PublicAccount, argv: ContractOption[] | undefined): TransactionURI<Transaction>

Protected Abstract prepare

  • prepare(): AggregateTransaction | Transaction
  • Prepare the contract's transactions. Some contracts may require the atomic execution of all their transactions and therefor need the prepare method to wrap transactions inside an aggregate transaction.

    Returns AggregateTransaction | Transaction

Generated using TypeDoc