asset property

Asset get asset

Returns the Asset object representing the credited asset.

Converts the asset type, code, and issuer fields into an Asset instance. For native assets, returns AssetTypeNative. For credit assets, creates a non-native asset using the code and issuer.

Returns: The credited Asset instance

Implementation

Asset get asset {
  if (assetType == Asset.TYPE_NATIVE) {
    return AssetTypeNative();
  } else {
    return Asset.createNonNativeAsset(assetCode!, assetIssuer!);
  }
}