Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

Properties

arguments

arguments: string[] = ['provider','input_x','input_y',]
access

public

description

The list of required arguments to execute this automated pool command.

context

context: Context

The execution context.

Protected identifier

identifier: AssetIdentifier

The automated pool shares asset identifier.

mosaicInfo

mosaicInfo: MosaicInfo | undefined
access

public

description

Mosaic information for the network-wide created automated pool shares of an automated liquidity pool.

reserveInfo

reserveInfo: AccountInfo | undefined
access

public

description

Account information for the network-wide target public account. This variable holds balances of reserves under the mosaics field.

target

target: PublicAccount
access

public

description

The deterministic public account which owns an automated liquidity pool. This account is used to issue the automated pool shares mosaic.

Accessors

descriptor

  • get descriptor(): string
  • This method MUST return a unique automated pool command descriptor which includes:

    • the open standard descriptor (e.g.: "Swapable") ;
    • the open standard revision (e.g.: 1) ;
    • the kebab-case command name (e.g.: "create-pool") ;
    • and the automated pool shares asset identifier.

    Items are joined with the : operator and attached to a so-called execution proof transaction.

    access

    public

    Returns string

name

  • get name(): string

Protected transactions

  • get transactions(): Transaction[]
  • This method returns a list of unsigned transactions in a sequencial order of execution. The resulting transaction array is later wrapped inside a digital contract that is executed atomically such that either all transactions do succeed or all transactions are cancelled.

    :warning: This method creates at least one- or more than one - network-wide account restriction. Restrictions can potentially lock you out of your account, please use this only with caution and if you understand the risks.

    see

    {execute()}

    access

    public

    Returns Transaction[]

    Given the execution of a command, returns a list of unsigned transactions.

Methods

Protected assertExecutionAllowance

  • assertExecutionAllowance(actor: PublicAccount, argv: CommandOption[] | undefined): boolean

Protected assertHasMandatoryArguments

  • assertHasMandatoryArguments(argv: CommandOption[] | undefined, fields: string[]): boolean

canExecute

  • Verifies allowance of \a actor to execute a command with arguments \a argv. This method returns true if all required arguments are present.

    This method asserts the presence of mandatory arguments.

    access

    public

    throws

    {FailureMissingArgument} On missing mandatory argument(s).

    Parameters

    • actor: PublicAccount

      The actor is whom executes the command.

    • Optional argv: CommandOption[]

      The command options (arguments).

    Returns AllowanceResult

    Returns whether an actor is authorized to execute this command.

execute

  • execute(actor: PublicAccount, argv?: CommandOption[]): TransactionURI<Transaction>
  • Executes an automated pool command with \a actor given \a argv command options.

    access

    public

    throws

    {FailureMissingArgument} On missing mandatory argument(s).

    throws

    {FailureOperationForbidden} On denial of authorization.

    Parameters

    • actor: PublicAccount

      The actor is whom executes the command.

    • Optional argv: CommandOption[]

      The command options (arguments).

    Returns TransactionURI<Transaction>

    Returns one transaction URI with all transactions.

Protected prepare

  • prepare(): AggregateTransaction | Transaction

Protected reserveOf

  • Returns the available reserve of asset \a r. This method is used internally to determine the available balance in the automated pool and calculate the liquidity shares ratio.

    access

    protected

    Parameters

    • r: AssetIdentifier

      The asset identifier (i.e. for which to check reserves).

    Returns number

    number The total balance (reserve) available.

Generated using TypeDoc