import "steammessages_base.proto";
import "steammessages_unified_base.steamclient.proto";

option cc_generic_services = true;

enum EAssetPropertyType {
	k_EAssetPropertyType_Unknown = 0;
	k_EAssetPropertyType_Float = 1;
	k_EAssetPropertyType_Int = 2;
	k_EAssetPropertyType_String = 3;
	k_EAssetPropertyType_MAX = 4;
}

message CEcon_GetInventoryItemsWithDescriptions_Request {
	message FilterOptions {
		repeated uint64 assetids = 1;
		repeated uint32 currencyids = 2;
		optional bool tradable_only = 3;
		optional bool marketable_only = 4;
	}

	optional fixed64 steamid = 1;
	optional uint32 appid = 2;
	optional uint64 contextid = 3;
	optional bool get_descriptions = 4;
	optional bool get_asset_properties = 11;
	optional bool for_trade_offer_verification = 10;
	optional string language = 5;
	optional .CEcon_GetInventoryItemsWithDescriptions_Request.FilterOptions filters = 6;
	optional uint64 start_assetid = 8;
	optional int32 count = 9;
}

message CEcon_Asset {
	optional uint32 appid = 1;
	optional uint64 contextid = 2;
	optional uint64 assetid = 3;
	optional uint64 classid = 4;
	optional uint64 instanceid = 5;
	optional uint32 currencyid = 6;
	optional int64 amount = 7;
	optional bool missing = 8;
	optional int64 est_usd = 9;
}

message CEconItem_DescriptionLine {
	optional string type = 1;
	optional string value = 2;
	optional string color = 3;
	optional string label = 4;
	optional string name = 5;
}

message CEconItem_Action {
	optional string link = 1;
	optional string name = 2;
}

message CEconItem_Description {
	optional int32 appid = 1;
	optional uint64 classid = 2;
	optional uint64 instanceid = 3;
	optional bool currency = 4;
	optional string background_color = 5;
	optional string icon_url = 6;
	optional string icon_url_large = 7;
	repeated .CEconItem_DescriptionLine descriptions = 8;
	optional bool tradable = 9;
	repeated .CEconItem_Action actions = 10;
	repeated .CEconItem_DescriptionLine owner_descriptions = 11;
	repeated .CEconItem_Action owner_actions = 12;
	repeated string fraudwarnings = 13;
	optional string name = 14;
	optional string name_color = 15;
	optional string type = 16;
	optional string market_name = 17;
	optional string market_hash_name = 18;
	optional string market_fee = 19;
	optional int32 market_fee_app = 28;
	optional .CEconItem_Description contained_item = 20;
	repeated .CEconItem_Action market_actions = 21;
	optional bool commodity = 22;
	optional int32 market_tradable_restriction = 23;
	optional int32 market_marketable_restriction = 24;
	optional bool marketable = 25;
	repeated .CEconItem_Tag tags = 26;
	optional string item_expiration = 27;
	optional string market_buy_country_restriction = 30;
	optional string market_sell_country_restriction = 31;
	optional bool sealed = 32;
	optional .CEconItem_ContainerProperties container_properties = 33;
	optional string market_bucket_group_name = 34;
	optional string market_bucket_group_id = 35;
	optional uint32 sealed_type = 37;
}

message CEconItem_Tag {
	optional uint32 appid = 1;
	optional string category = 2;
	optional string internal_name = 3;
	optional string localized_category_name = 4;
	optional string localized_tag_name = 5;
	optional string color = 6;
}

message CEconItem_ClassIdentifiers {
	optional uint64 classid = 1;
	optional uint64 instanceid = 2;
}

message CEconItem_ContainerProperties {
	repeated .CEconItem_ClassIdentifiers contained_items = 1;
	repeated .CEconItem_Tag search_tags = 2;
}

message CEconItem_AssetProperty {
	optional uint32 propertyid = 1;
	optional int64 int_value = 2;
	optional float float_value = 3;
	optional string string_value = 4;
}

message CEconItem_AssetAccessory {
	optional uint64 classid = 1;
	optional uint64 instanceid = 2;
	repeated .CEconItem_AssetProperty standalone_properties = 3;
	repeated .CEconItem_AssetProperty parent_relationship_properties = 4;
	repeated .CEconItem_AssetAccessory nested_accessories = 5;
}

message CEconItem_AssetProperties {
	optional uint32 appid = 1;
	optional uint64 contextid = 2;
	optional uint64 assetid = 3;
	repeated .CEconItem_AssetProperty asset_properties = 4;
	repeated .CEconItem_AssetAccessory asset_accessories = 5;
}

message CEcon_GetInventoryItemsWithDescriptions_Response {
	repeated .CEcon_Asset assets = 1;
	repeated .CEconItem_Description descriptions = 2;
	repeated .CEcon_Asset missing_assets = 3;
	repeated .CEconItem_AssetProperties asset_properties = 7;
	optional bool more_items = 4;
	optional uint64 last_assetid = 5;
	optional uint32 total_inventory_count = 6;
}

message CEcon_GetTradeOfferAccessToken_Request {
	optional bool generate_new_token = 1;
}

message CEcon_GetTradeOfferAccessToken_Response {
	optional string trade_offer_access_token = 1;
}

message CEcon_ClientGetItemShopOverlayAuthURL_Request {
	optional string return_url = 1;
}

message CEcon_ClientGetItemShopOverlayAuthURL_Response {
	optional string url = 1;
}

message CEcon_GetAssetClassInfo_Request {
	optional string language = 1;
	optional uint32 appid = 2;
	repeated .CEconItem_ClassIdentifiers classes = 3;
	optional bool high_pri = 4;
}

message CEcon_GetAssetClassInfo_Response {
	repeated .CEconItem_Description descriptions = 1;
}

message CEcon_GetAssetPropertySchema_Request {
	optional uint32 appid = 1;
	optional string language = 2;
}

message CEconItem_AssetPropertySchema {
	optional uint32 id = 1;
	optional string name = 2;
	optional .EAssetPropertyType type = 3 [default = k_EAssetPropertyType_Unknown];
	optional float float_min = 4;
	optional float float_max = 5;
	optional int64 int_min = 6;
	optional int64 int_max = 7;
	optional string localized_label = 8;
	optional bool hide_from_description = 9;
}

message CEcon_GetAssetPropertySchema_Response {
	repeated .CEconItem_AssetPropertySchema property_schemas = 1;
}

service Econ {
	rpc GetInventoryItemsWithDescriptions (.CEcon_GetInventoryItemsWithDescriptions_Request) returns (.CEcon_GetInventoryItemsWithDescriptions_Response);
	rpc GetTradeOfferAccessToken (.CEcon_GetTradeOfferAccessToken_Request) returns (.CEcon_GetTradeOfferAccessToken_Response);
	rpc ClientGetItemShopOverlayAuthURL (.CEcon_ClientGetItemShopOverlayAuthURL_Request) returns (.CEcon_ClientGetItemShopOverlayAuthURL_Response);
	rpc GetAssetClassInfo (.CEcon_GetAssetClassInfo_Request) returns (.CEcon_GetAssetClassInfo_Response);
	rpc GetAssetPropertySchema (.CEcon_GetAssetPropertySchema_Request) returns (.CEcon_GetAssetPropertySchema_Response);
}
