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

PoolService

package

Swapable

subpackage

Services

since

v1.2.1

description

Class that describes a service around liquidity pools.

Hierarchy

Index

Constructors

constructor

Properties

Protected context

context: Context

Accessors

Protected networkReader

  • get networkReader(): ReaderImpl

Methods

Protected formatMetadata

getInfo

  • getInfo(targetAddress: Address, lpSharesMosaic: MosaicId): Promise<PoolInfo>
  • Helper function to read a liquidity pool's information from the network.

    async
    access

    public

    Parameters

    • targetAddress: Address
    • lpSharesMosaic: MosaicId

      The mosaic id of liquidity provider shares.

    Returns Promise<PoolInfo>

Protected getKnownMetadataKey

  • getKnownMetadataKey(hexKey: string): string
  • Helper function to retrieve known mosaic metadata keys

    access

    protected

    Parameters

    • hexKey: string

    Returns string

getPools

  • getPools(authority: PublicAccount | Address, revision?: number): Promise<PoolInfo[]>
  • Helper function to read all liquidity pools that are publicly listed in one given \a registry public account.

    async
    access

    public

    Parameters

    • authority: PublicAccount | Address
    • Default value revision: number = 0

    Returns Promise<PoolInfo[]>

Protected interpretMetadata

Object literals

Private KNOWN_METADATAS

KNOWN_METADATAS: object

Known metadata keys. This dictionary stores hexadecimal representations for scopedMetadataKey values thus making the read operations of mosaic metadata by key instead of having to use hexadecimal notation to refer to these.

var

{KeyValueDictionary}

826A59AE988FFE4B

826A59AE988FFE4B: string = "y_mosaic_id"

8399C1CBB066F944

8399C1CBB066F944: string = "identifier"

9B2823771F48325D

9B2823771F48325D: string = "x_mosaic_id"

Generated using TypeDoc