public AssetData(JObject value) { var token = value.Root; Amount = Convert.ToInt64(value.TryGetValue(AMOUNT_FIELD_KEY, out token) ? token.ToObject <object>() : 0); Asset = value.TryGetValue(ASSET_ID_FIELD_KEY, out token) ? token.ToObject <SpaceTypeId>() : SpaceTypeId.EMPTY; }
public static bool IsNullOrEmpty(this SpaceTypeId sti) => sti.IsNull() || SpaceTypeId.EMPTY.Equals(sti);
public AssetData(long amount, SpaceTypeId asset) { Amount = amount; Asset = asset; }