Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • AssetApi

Index

Constructors

constructor

  • Parameters

    Returns AssetApi

Properties

Private api

Methods

claim

  • Claim fees. Claim funds from asset pool, only the asset issuer can claim.

    Parameters

    • credentials: Credentials

      account credentials issuing the asset

    • asset: AssetRef

      which asset to claim from

    • uia: Long | number

      UIA raw amount

    • dct: Long | number

      DCT raw amount

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<TransactionConfirmation>

convertFromDCT

  • convertFromDCT(assetId: ChainObject, amount: number | Long, roundingMode?: Decimal.Rounding): Promise<AssetAmount>
  • Get asset by id and convert amount in DCT to this asset

    Parameters

    • assetId: ChainObject

      asset id to get

    • amount: number | Long

      amount to convert

    • Default value roundingMode: Decimal.Rounding = Decimal.ROUND_CEIL

      rounding mode to use when rounding to target asset precision

    Returns Promise<AssetAmount>

convertToDCT

  • convertToDCT(assetId: ChainObject, amount: number | Long, roundingMode?: Decimal.Rounding): Promise<AssetAmount>
  • Get asset by id and convert amount in this asset to DCT

    Parameters

    • assetId: ChainObject

      asset id to get

    • amount: number | Long

      amount to convert

    • Default value roundingMode: Decimal.Rounding = Decimal.ROUND_CEIL

      rounding mode to use when rounding to target asset precision

    Returns Promise<AssetAmount>

create

  • Create a new Asset.

    Parameters

    • credentials: Credentials

      account credentials issuing the asset

    • symbol: string

      the string symbol, 3-16 uppercase chars

    • precision: AssetPrecision

      base unit precision, decimal places used in string representation

    • description: string

      optional description

    • Default value options: AssetOptions = new AssetOptions(ExchangeRate.forCreateOp(1, 1))

      asset options

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<TransactionConfirmation>

createAssetCreateOperation

  • Create asset create operation.

    Parameters

    • issuer: ChainObject

      account id issuing the asset

    • symbol: string

      the string symbol, 3-16 uppercase chars

    • precision: AssetPrecision

      base unit precision, decimal places used in string representation

    • description: string

      optional description

    • options: AssetOptions

      asset options

    • Optional monitoredOptions: MonitoredAssetOpts

      options for monitored asset

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<AssetCreateOperation>

createAssetIssueOperation

  • Create issue asset operation. Only the issuer of the asset can issue some funds until maxSupply is reached.

    Parameters

    • asset: AssetRef

      asset to issue

    • amount: Long | number

      raw amount to issue

    • Optional to: ChainObject

      optional account id receiving the created funds, issuer account id is used if not defined

    • Optional memo: Memo

      optional memo for receiver

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<AssetIssueOperation>

createAssetUpdateAdvancedOperation

  • Create update advanced options operation for the asset.

    Parameters

    • asset: AssetRef

      asset to update

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<AssetUpdateAdvancedOperation>

createAssetUpdateOperation

  • Create update asset operation.

    Parameters

    • asset: AssetRef

      asset to update

    • Optional newIssuer: ChainObject

      a new issuer account id

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<AssetUpdateOperation>

createClaimFeesOperation

  • Create claim fees operation. Claim funds from asset pool, only the asset issuer can claim.

    Parameters

    • asset: AssetRef

      which asset to claim from

    • uia: Long | number

      UIA raw amount

    • dct: Long | number

      DCT raw amount

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<AssetClaimFeesOperation>

createFundPoolsOperation

  • Create fund asset pool operation. Any account can fund a pool.

    Parameters

    • asset: AssetRef

      which asset to fund

    • uia: Long | number

      UIA raw amount

    • dct: Long | number

      DCT raw amount

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<AssetFundPoolsOperation>

createMonitoredAsset

  • cannot create asset_create_op has account_id_type fee_payer()const { return monitored_asset_opts.valid() ? account_id_type() : issuer; } therefore throws Missing Active Authority 1.2.0

    Parameters

    Returns Promise<TransactionConfirmation>

createReserveOperation

  • Create reserve funds operation. Return issued funds to the issuer of the asset.

    Parameters

    • asset: AssetRef

      which asset to reserve from

    • amount: Long | number

      raw amount to remove from current supply

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<AssetReserveOperation>

fund

  • Fund asset pool. Any account can fund a pool.

    Parameters

    • credentials: Credentials

      account credentials funding the pool

    • asset: AssetRef

      which asset to fund

    • uia: Long | number

      UIA raw amount

    • dct: Long | number

      DCT raw amount

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<TransactionConfirmation>

get

  • Get asset by id or symbol.

    Parameters

    • asset: AssetRef

      asset id eg. DCT or id 1.3.0

    Returns Promise<Asset>

    asset or ObjectNotFoundError

getAll

  • Get assets by id.

    Parameters

    Returns Promise<Asset[]>

    list of assets or ObjectNotFoundError

getAllByName

  • getAllByName(assetSymbols: string[]): Promise<Asset[]>
  • Get assets by symbol

    Parameters

    • assetSymbols: string[]

      asset symbols eg. DCT

    Returns Promise<Asset[]>

    list of assets or ObjectNotFoundError

getAssetsData

  • Get asset dynamic data by id.

    Parameters

    • assetIds: ChainObject[]

      asset data id eg. DCT id is 2.3.0

    Returns Promise<AssetData[]>

    asset dynamic data or ObjectNotFoundError

getByName

  • getByName(assetSymbol: string): Promise<Asset>
  • Get asset by symbol

    Parameters

    • assetSymbol: string

      asset symbol eg. DCT

    Returns Promise<Asset>

    asset or ObjectNotFoundError

getRealSupply

  • Return current core asset supply.

    Returns Promise<RealSupply>

    current supply

issue

  • Issue asset. Only the issuer of the asset can issue some funds until maxSupply is reached.

    Parameters

    • credentials: Credentials

      account credentials issuing the asset

    • asset: AssetRef

      asset to issue

    • amount: Long | number

      raw amount to issue

    • Optional to: ChainObject

      optional account id receiving the created funds, issuer account id is used if not defined

    • Optional memo: Memo

      optional memo for receiver

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<TransactionConfirmation>

listAll

  • listAll(includeMonitored?: boolean): Promise<Asset[]>
  • Parameters

    • Default value includeMonitored: boolean = false

    Returns Promise<Asset[]>

listAllRelative

  • listAllRelative(lowerBound: string, limit?: number): Promise<Asset[]>
  • Get assets alphabetically by symbol name.

    Parameters

    • lowerBound: string

      lower bound of symbol names to retrieve

    • Default value limit: number = 100

      maximum number of assets to fetch (must not exceed 100)

    Returns Promise<Asset[]>

    the assets found

reserve

  • Reserve funds. Return issued funds to the issuer of the asset.

    Parameters

    • credentials: Credentials

      account credentials returning the asset

    • asset: AssetRef

      which asset to reserve from

    • amount: Long | number

      raw amount to remove from current supply

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<TransactionConfirmation>

update

  • Update asset.

    Parameters

    • credentials: Credentials

      account credentials issuing the asset

    • asset: AssetRef

      asset to update

    • Optional exchangeRate: [Long | number, Long | number]

      new exchange rate, DCT base amount to UIA quote amount pair

    • Optional description: undefined | string

      new description

    • Optional exchangeable: undefined | false | true

      enable converting the asset to DCT, so it can be used to pay for fees

    • Optional maxSupply: Long

      new max supply

    • Optional newIssuer: ChainObject

      a new issuer account id

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<TransactionConfirmation>

updateAdvanced

  • Update advanced options for the asset.

    Parameters

    • credentials: Credentials

      account credentials issuing the asset

    • asset: AssetRef

      asset to update

    • Optional precision: AssetPrecision

      new precision

    • Optional fixedMaxSupply: undefined | false | true

      whether it should be allowed to change max supply, cannot be reverted once set to true

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<TransactionConfirmation>

Generated using TypeDoc