Interface AssetApi

Asset API

The Asset API provides all functions for Asset/Token operations

interface AssetApi {
    addAssetTreasuryAccount: ((args: AddAssetTreasuryAccountArgs) => Promise<TransactionId | UnsignedTransaction>);
    burnAsset: ((args: Omit<TransferAssetArgs, "recipientPublicKey" | "recipientId">) => Promise<TransactionId | UnsignedTransaction>);
    calculateDistributionFee: ((args: CalculateDistributionFeeArgs) => Promise<DistributionFee>);
    cancelAskOrder: ((args: CancelOrderArgs) => Promise<TransactionId | UnsignedTransaction>);
    cancelBidOrder: ((args: CancelOrderArgs) => Promise<TransactionId | UnsignedTransaction>);
    distributeToAssetHolders: ((args: DistributeToAssetHoldersArgs) => Promise<TransactionId | UnsignedTransaction>);
    getAllAssets: ((args: GetAllAssetsArgs) => Promise<AssetList>);
    getAllTrades: ((args: GetAllTradesArgs) => Promise<AssetTradeList>);
    getAsset: ((args: GetAssetArgs) => Promise<Asset>);
    getAssetHolders: ((args: GetAssetHoldersArgs) => Promise<AssetAccountList>);
    getAssetTrades: ((args: GetAssetTradesArgs) => Promise<AssetTradeList>);
    getAssetTradesPerAccount: ((args: GetAssetTradesPerAccountArgs) => Promise<AssetTradeList>);
    getAssetTradesPerAsset: ((args: GetAssetTradesPerAssetArgs) => Promise<AssetTradeList>);
    getAssetTransfers: ((args: GetAssetTransfersArgs) => Promise<AssetTransferList>);
    getAssetTransfersPerAccount: ((args: GetAssetTransfersPerAccountArgs) => Promise<AssetTransferList>);
    getAssetTransfersPerAsset: ((args: GetAssetTransfersPerAssetArgs) => Promise<AssetTransferList>);
    getAssetsByIssuer: ((args: GetAssetsByIssuerArgs) => Promise<AssetList>);
    getAssetsByName: ((args: GetAssetsByNameArgs) => Promise<AssetList>);
    getAssetsByOwner: ((args: GetAssetsByIssuerArgs) => Promise<AssetList>);
    getOpenAskOrders: ((args: GetAssetOpenOrdersArgs) => Promise<AssetAskOrderList>);
    getOpenAskOrdersPerAccount: ((args: GetAssetOpenOrdersPerAccountArgs) => Promise<AssetAskOrderList>);
    getOpenAskOrdersPerAsset: ((args: GetAssetOpenOrdersPerAssetArgs) => Promise<AssetAskOrderList>);
    getOpenBidOrders: ((args: GetAssetOpenOrdersArgs) => Promise<AssetBidOrderList>);
    getOpenBidOrdersPerAccount: ((args: GetAssetOpenOrdersPerAccountArgs) => Promise<AssetBidOrderList>);
    getOpenBidOrdersPerAsset: ((args: GetAssetOpenOrdersPerAssetArgs) => Promise<AssetBidOrderList>);
    getTradeHistoryPerAccount: ((args: GetTradeHistoryPerAccountArgs) => Promise<TradeHistory>);
    issueAsset: ((args: IssueAssetArgs) => Promise<TransactionId | UnsignedTransaction>);
    mintAsset: ((args: MintAssetArgs) => Promise<TransactionId | UnsignedTransaction>);
    placeAskOrder: ((args: PlaceOrderArgs) => Promise<TransactionId | UnsignedTransaction>);
    placeBidOrder: ((args: PlaceOrderArgs) => Promise<TransactionId | UnsignedTransaction>);
    transferAsset: ((args: TransferAssetArgs) => Promise<TransactionId | UnsignedTransaction>);
    transferAssetOwnership: ((args: TransferAssetOwnershipArgs) => Promise<TransactionId | UnsignedTransaction>);
    transferMultipleAssets: ((args: TransferMultipleAssetsArgs) => Promise<TransactionId | UnsignedTransaction>);
}

Properties

addAssetTreasuryAccount: ((args: AddAssetTreasuryAccountArgs) => Promise<TransactionId | UnsignedTransaction>)

Adds/Marks an account as treasury account for a given asset

Treasury Accounts are excluded from distributions for token/asset holders.

Type declaration

Error in case of unsuccessful transaction

burnAsset: ((args: Omit<TransferAssetArgs, "recipientPublicKey" | "recipientId">) => Promise<TransactionId | UnsignedTransaction>)

Burns assets, i.e. is de facto a transfer to recipient address '0'

Type declaration

calculateDistributionFee: ((args: CalculateDistributionFeeArgs) => Promise<DistributionFee>)

Calculates the fee for AssetApi.distributeToAssetHolders

Type declaration

cancelAskOrder: ((args: CancelOrderArgs) => Promise<TransactionId | UnsignedTransaction>)

Cancel Ask Order

Type declaration

cancelBidOrder: ((args: CancelOrderArgs) => Promise<TransactionId | UnsignedTransaction>)

Cancel Bid Order

Type declaration

distributeToAssetHolders: ((args: DistributeToAssetHoldersArgs) => Promise<TransactionId | UnsignedTransaction>)

Distributes Signa and/or another asset to the holders of a given asset. Just pass the total amount to be distributed and it will be sent/distributed proportionally (at very high transaction rate, i.e. 5K TPS) to all holders.

To inspect the share a token holder received you need to use TransactionApi.getDistributionAmountsFromTransaction

To calculate the fees upfront use AssetApi.calculateDistributionFee.

Type declaration

Error in case of unsuccessful transaction

getAllAssets: ((args: GetAllAssetsArgs) => Promise<AssetList>)

Get all available assets

Type declaration

    • (args): Promise<AssetList>
    • Parameters

      • args: GetAllAssetsArgs

        The argument object

      Returns Promise<AssetList>

      List of assets

getAllTrades: ((args: GetAllTradesArgs) => Promise<AssetTradeList>)

Search for asset trades

Type declaration

getAsset: ((args: GetAssetArgs) => Promise<Asset>)

Get asset information by its id

Type declaration

    • (args): Promise<Asset>
    • Parameters

      Returns Promise<Asset>

      The asset, if exists

getAssetHolders: ((args: GetAssetHoldersArgs) => Promise<AssetAccountList>)

Get all accounts that holds the fiven asset

Type declaration

getAssetTrades: ((args: GetAssetTradesArgs) => Promise<AssetTradeList>)

Get all asset trades by accountId and/or assetId

Type declaration

also AssetApi.getAssetTradesPerAsset or AssetApi.getAssetTradesPerAccount

Error if not at least assetId or accountId was giveb

getAssetTradesPerAccount: ((args: GetAssetTradesPerAccountArgs) => Promise<AssetTradeList>)

A convenience function to get all asset transfers by accountId

Type declaration

getAssetTradesPerAsset: ((args: GetAssetTradesPerAssetArgs) => Promise<AssetTradeList>)

A convenience function to get all asset transfers by assetId

Type declaration

getAssetTransfers: ((args: GetAssetTransfersArgs) => Promise<AssetTransferList>)

Get all asset transfers by accountId and/or assetId

Type declaration

also AssetApi.getAssetTransfersPerAsset or AssetApi.getAssetTransfersPerAccount

Error if not at least assetId or accountId was giveb

getAssetTransfersPerAccount: ((args: GetAssetTransfersPerAccountArgs) => Promise<AssetTransferList>)

A convenience function to get all asset transfers by accountId

Type declaration

getAssetTransfersPerAsset: ((args: GetAssetTransfersPerAssetArgs) => Promise<AssetTransferList>)

A convenience function to get all asset transfers by assetId

Type declaration

getAssetsByIssuer: ((args: GetAssetsByIssuerArgs) => Promise<AssetList>)

Gets all assets by given issuer. So, if an ownership was transferred the asset won't be listed by this call.

Type declaration

getAssetsByName: ((args: GetAssetsByNameArgs) => Promise<AssetList>)

Gets all assets by name (or parts of it)

Type declaration

getAssetsByOwner: ((args: GetAssetsByIssuerArgs) => Promise<AssetList>)

Gets all assets by given owner. So, if an ownership was transferred this new owner is considered byt this call.

Type declaration

getOpenAskOrders: ((args: GetAssetOpenOrdersArgs) => Promise<AssetAskOrderList>)

Gets all open Ask Orders

Type declaration

getOpenAskOrdersPerAccount: ((args: GetAssetOpenOrdersPerAccountArgs) => Promise<AssetAskOrderList>)

Gets all open Ask Orders

Type declaration

getOpenAskOrdersPerAsset: ((args: GetAssetOpenOrdersPerAssetArgs) => Promise<AssetAskOrderList>)

Gets all open Ask Orders per asset

Type declaration

getOpenBidOrders: ((args: GetAssetOpenOrdersArgs) => Promise<AssetBidOrderList>)

Gets all open Bid Orders

Type declaration

getOpenBidOrdersPerAccount: ((args: GetAssetOpenOrdersPerAccountArgs) => Promise<AssetBidOrderList>)

Gets all open Bid Orders per account

Type declaration

getOpenBidOrdersPerAsset: ((args: GetAssetOpenOrdersPerAssetArgs) => Promise<AssetBidOrderList>)

Gets all open Bid Orders per asset

Type declaration

getTradeHistoryPerAccount: ((args: GetTradeHistoryPerAccountArgs) => Promise<TradeHistory>)

The trade history is a journal about open/filled and/or cancelled trades for a given account and optionally set asset

Type declaration

issueAsset: ((args: IssueAssetArgs) => Promise<TransactionId | UnsignedTransaction>)

Issues assets

Type declaration

mintAsset: ((args: MintAssetArgs) => Promise<TransactionId | UnsignedTransaction>)

Mints assets

Type declaration

placeAskOrder: ((args: PlaceOrderArgs) => Promise<TransactionId | UnsignedTransaction>)

Place Ask Order

Type declaration

placeBidOrder: ((args: PlaceOrderArgs) => Promise<TransactionId | UnsignedTransaction>)

Place Ask Order

Type declaration

transferAsset: ((args: TransferAssetArgs) => Promise<TransactionId | UnsignedTransaction>)

Transfer assets

Type declaration

transferAssetOwnership: ((args: TransferAssetOwnershipArgs) => Promise<TransactionId | UnsignedTransaction>)

Transfer assets ownership

Type declaration

transferMultipleAssets: ((args: TransferMultipleAssetsArgs) => Promise<TransactionId | UnsignedTransaction>)

Transfer multiple (2-4) assets in one transaction.

Type declaration