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

BaseCommand

package

Swapable

subpackage

Contracts

since

v1.0.0

description

Abstract class that describes a command interface for executing commands that involve swapable 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 command'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: CommandOption[] | undefined): boolean
  • Asserts the allowance of actor to execute the command.

    throws

    {FailureOperationForbidden} On denial of authorization

    Parameters

    Returns boolean

Protected assertHasMandatoryArguments

  • assertHasMandatoryArguments(argv: CommandOption[] | 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: CommandOption[] | undefined): TransactionURI<Transaction>

Protected Abstract prepare

  • prepare(): AggregateTransaction | Transaction
  • Prepare the command's transactions. Some commands 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