A class for referencing the states of the blockchain database.

Constructors

  • Creates a new Reference object.

    Parameters

    • ain: default

      The Ain object.

    • Optional path: string

      The path to refer to in the global state tree.

    Returns default

Properties

_ain: default
_isGlobal: boolean
_isRootReference: boolean
_listeners: ListenerMap
_numberOfListeners: number
key: null | string
path: string

Accessors

  • get numberOfListeners(): number
  • Getter for the number of listeners.

    Returns number

    The number of listeners.

Methods

  • Decrements a value in the blockchain states.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Deletes a value from the blockchain states.

    Parameters

    • Optional transactionInput: ValueOnlyTransactionInput

      The transaction input object. Any value given will be overwritten with null.

    • isDryrun: boolean = false

      The dryrun option.

    Returns Promise<any>

    The return value of the blockchain API.

  • Requests an eval-owner (EVAL_OWNER) operation to the network. If it returns true, it means that the input operation satisfies the owner permissions in the blockchain states.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Requests an eval-rule (EVAL_RULE) operation to the network. If it returns true, it means that the input operation satisfies the write rule in the blockchain states.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Performs multiple get operations for values, rules, owners, or functions.

    Parameters

    Returns Promise<any>

    The results of the get operations.

  • Fetches the function configuration of a blockchain state path.

    Parameters

    • Optional path: string

      The path of the blockchain state.

    • Optional options: GetOptions

      The get options.

    Returns Promise<any>

    The function configuration of the blockchain state.

  • Fetches the owner configuration of a blockchain state path.

    Parameters

    • Optional path: string

      The path of the blockchain state.

    • Optional options: GetOptions

      The get options.

    Returns Promise<any>

    The owner configuration of the blockchain state.

  • Fetches the proof hash of a global blockchain state path.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Fetches the rule configuration of a blockchain state path.

    Parameters

    • Optional path: string

      The path of the blockchain state.

    • Optional options: GetOptions

      The get options.

    Returns Promise<any>

    The rule configuration the blockchain state.

  • Fetches the state information of a global blockchain state path.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Fetches the state proof of a global blockchain state path.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Fetches the value of a blockchain state path.

    Parameters

    • Optional path: string

      The path of the blockchain state.

    • Optional options: GetOptions

      The get options.

    Returns Promise<any>

    The value of the blockchain state.

  • Increments a value in the blockchain states.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Fetches the function configurations matched to the input reference (blockchain state path).

    Parameters

    • Optional params: MatchInput

      The match input object.

    Returns Promise<any>

    The return value of the blockchain API.

  • Fetches the owner configurations matched to the input reference (blockchain state path).

    Parameters

    • Optional params: MatchInput

      The match input object.

    Returns Promise<any>

    The return value of the blockchain API.

  • Fetches the rule configurations matched to the input reference (blockchain state path).

    Parameters

    • Optional params: MatchInput

      The match input object.

    Returns Promise<any>

    The return value of the blockchain API.

  • Pushes a new child state to the current path of the blockchain states and returns the reference of the child state. If a value is given, it's set as the value of the newly added child by sending a transaction to the network. Otherwise, it creates a key locally for a new child but doesn't change any blockchain states.

    Parameters

    • Optional value: any

      The value of the newly added child state.

    Returns Promise<any> | default

    The reference of the newly added child state.

  • Sends a transaction of multi-set (SET) operation to the network.

    Parameters

    • transactionInput: SetMultiTransactionInput

      The multi-set (SET) transaction input object.

    • isDryrun: boolean = false

      The dryrun option.

    Returns Promise<any>

    The return value of the blockchain API.

  • Sets a function configuration in the blockchain states.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Sets the global path flag.

    Parameters

    • isGlobal: boolean

    Returns void

  • Sets a owner configuration in the blockchain states.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Sets a rule configuration in the blockchain states.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Sets a value in the blockchain states.

    Parameters

    Returns Promise<any>

    The return value of the blockchain API.

  • Builds a get request.

    Parameters

    • type: GetOperationType

      The get operations type.

    • ref: string

      The blockchain state reference (path).

    • Optional options: GetOptions

      The get options.

    Returns any

    The request built.

  • Extends a base path with an extension.

    Parameters

    • Optional basePath: string

      The base path.

    • Optional extension: string

      The extension.

    Returns string

    The extended path.

  • Builds a transaction input object from a multi-set (SET) transaction input object and additional parameters.

    Parameters

    • input: SetMultiTransactionInput

      The multi-set (SET) transaction input object.

    • ref: string

      The blockchain state reference (path).

    Returns TransactionInput

    The transaction input built.

  • Returns a sanitized blockchain state reference (path). It should have a slash at the beginning and no slash at the end.

    Parameters

    • Optional ref: string

      The blockchain state reference (path).

    Returns string

    The blockchain state reference sanitized.