|
// using my utility https://github.com/joekiller/socket-to-interface I've managed to come up with the following interface for BP socket messages: |
|
|
|
interface RootObject { |
|
BPSocketEvent: BPSocketEvent[]; |
|
} |
|
|
|
interface BPSocketEvent { |
|
id: string; |
|
event: string; |
|
payload: Payload; |
|
} |
|
|
|
interface Payload { |
|
id: string; |
|
steamid: string; |
|
appid: number; |
|
currencies: Currencies; |
|
value: Value; |
|
tradeOffersPreferred?: boolean; |
|
buyoutOnly?: boolean; |
|
details?: string; |
|
listedAt: number; |
|
bumpedAt: number; |
|
intent: string; |
|
count: number; |
|
status: string; |
|
item: Item2; |
|
user: User; |
|
source?: string; |
|
userAgent?: UserAgent; |
|
deal?: Deal; |
|
promoted?: boolean; |
|
} |
|
|
|
interface Deal { |
|
percent: number; |
|
value: number; |
|
} |
|
|
|
interface UserAgent { |
|
client: string; |
|
lastPulse: number; |
|
} |
|
|
|
interface User { |
|
id: string; |
|
name: string; |
|
avatar: string; |
|
avatarFull: string; |
|
premium: boolean; |
|
online: boolean; |
|
banned: boolean; |
|
customNameStyle: string; |
|
acceptedSuggestions: number; |
|
class: string; |
|
style: string; |
|
role?: Role; |
|
tradeOfferUrl?: string; |
|
isMarketplaceSeller: boolean; |
|
flagImpersonated?: boolean; |
|
bans: any[] | Bans2 | Bans3; |
|
} |
|
|
|
interface Bans3 { |
|
'11': number; |
|
} |
|
|
|
interface Bans2 { |
|
'4': number; |
|
} |
|
|
|
interface Role { |
|
id: string; |
|
name: string; |
|
description: string; |
|
nameColor: string; |
|
} |
|
|
|
interface Item2 { |
|
appid: number; |
|
baseName?: string; |
|
defindex?: number; |
|
id: string; |
|
imageUrl: string; |
|
marketName: string; |
|
name: string; |
|
origin?: Origin; |
|
originalId: string; |
|
price: Price | any[] | Price3 | Price4 | Price5; |
|
quality?: Quality; |
|
summary: string; |
|
texture?: Texture; |
|
class?: string[]; |
|
wearTier?: WearTier; |
|
slot?: string; |
|
particle?: Particle; |
|
tradable: boolean; |
|
craftable?: boolean; |
|
priceindex?: string; |
|
level?: number | string; |
|
craftedBy?: CraftedBy; |
|
tag?: Tag; |
|
killstreakTier?: number; |
|
killEaters?: KillEater2[]; |
|
australium?: boolean; |
|
giftedBy?: CraftedBy; |
|
recipe?: Recipe2; |
|
sheen?: Origin; |
|
paint?: Paint; |
|
paintSecondaryHex?: string; |
|
style?: Style3; |
|
customName?: string; |
|
crateSeries?: number; |
|
customDesc?: string; |
|
equipped?: Equipped[]; |
|
killstreaker?: Origin; |
|
tradableAfter?: number; |
|
elevatedQuality?: Quality; |
|
festivized?: boolean; |
|
craftNumber?: number; |
|
strangeParts?: StrangePart[]; |
|
rarity?: Quality; |
|
spells?: Spell[]; |
|
marketplaceTfListing?: MarketplaceTfListing; |
|
dupe?: boolean; |
|
decal?: Decal; |
|
quantity?: number; |
|
attributes?: Attribute2[]; |
|
medalNumber?: number; |
|
containedItem?: ContainedItem; |
|
} |
|
|
|
interface ContainedItem { |
|
appid: number; |
|
baseName: string; |
|
defindex: number; |
|
id: string; |
|
imageUrl: string; |
|
marketName: string; |
|
name: string; |
|
origin: Origin; |
|
originalId: string; |
|
price: any[] | Price3; |
|
quality: Quality; |
|
summary: string; |
|
level: number; |
|
tradable?: boolean; |
|
craftable: boolean; |
|
class?: string[]; |
|
slot?: string; |
|
} |
|
|
|
interface Attribute2 { |
|
field: string; |
|
value: number | string; |
|
} |
|
|
|
interface Decal { |
|
url: string; |
|
} |
|
|
|
interface MarketplaceTfListing { |
|
value: number; |
|
raw: number; |
|
short: string; |
|
currency: string; |
|
} |
|
|
|
interface Spell { |
|
id: string; |
|
spellId: string; |
|
name: string; |
|
type: string; |
|
defindex?: number; |
|
color?: string; |
|
} |
|
|
|
interface StrangePart { |
|
score: number; |
|
killEater: KillEater3; |
|
} |
|
|
|
interface KillEater3 { |
|
id: number; |
|
name: string; |
|
item: Item; |
|
} |
|
|
|
interface Item { |
|
appid: number; |
|
baseName: string; |
|
defindex: number; |
|
id: string; |
|
imageUrl: string; |
|
marketName: string; |
|
name: string; |
|
origin?: any; |
|
originalId: string; |
|
price: Price3; |
|
quality: Quality; |
|
summary: string; |
|
tradable: boolean; |
|
craftable: boolean; |
|
} |
|
|
|
interface Equipped { |
|
class: number; |
|
slot: number; |
|
} |
|
|
|
interface Style3 { |
|
name: string; |
|
additional_hidden_bodygroups?: Additionalhiddenbodygroups2; |
|
} |
|
|
|
interface Additionalhiddenbodygroups2 { |
|
headphones?: number; |
|
hat?: number; |
|
head?: number; |
|
grenades?: number; |
|
} |
|
|
|
interface Paint { |
|
id?: number; |
|
name: string; |
|
color: string; |
|
} |
|
|
|
interface Recipe2 { |
|
estimatedCraftingCost: Value | any[]; |
|
inputItems: InputItem[]; |
|
outputItem?: OutputItem; |
|
targetItem?: TargetItem2; |
|
} |
|
|
|
interface TargetItem2 { |
|
itemName: string; |
|
imageUrl: string; |
|
_source: Source2; |
|
} |
|
|
|
interface Source2 { |
|
_id: string; |
|
name: string; |
|
defindex: number; |
|
item_class: string; |
|
item_type_name: string; |
|
item_name: string; |
|
proper_name: boolean; |
|
item_slot: string; |
|
item_quality: number; |
|
image_inventory: string; |
|
min_ilevel: number; |
|
max_ilevel: number; |
|
image_url: string; |
|
image_url_large: string; |
|
item_set?: string; |
|
craft_class?: string; |
|
craft_material_type?: string; |
|
capabilities: Capabilities2; |
|
used_by_classes?: string[]; |
|
attributes?: Attribute[]; |
|
first_sale_date?: number; |
|
release_date?: number; |
|
appid: number; |
|
_keywords: string[]; |
|
styles?: Style2[]; |
|
per_class_loadout_slots?: Perclassloadoutslots; |
|
item_description?: string; |
|
drop_type?: string; |
|
} |
|
|
|
interface Style2 { |
|
name: string; |
|
additional_hidden_bodygroups?: Additionalhiddenbodygroups; |
|
} |
|
|
|
interface Additionalhiddenbodygroups { |
|
hat: number; |
|
headphones?: number; |
|
} |
|
|
|
interface Capabilities2 { |
|
nameable: boolean; |
|
can_gift_wrap: boolean; |
|
can_craft_mark: boolean; |
|
can_be_restored: boolean; |
|
strange_parts: boolean; |
|
can_card_upgrade: boolean; |
|
can_strangify: boolean; |
|
can_killstreakify: boolean; |
|
can_consume: boolean; |
|
can_craft_count?: boolean; |
|
can_craft_if_purchased?: boolean; |
|
can_unusualify?: boolean; |
|
can_customize_texture?: boolean; |
|
paintable?: boolean; |
|
can_collect?: boolean; |
|
} |
|
|
|
interface OutputItem { |
|
appid: number; |
|
baseName: string; |
|
defindex: number; |
|
id: string; |
|
imageUrl: string; |
|
marketName: string; |
|
name: string; |
|
origin?: any; |
|
originalId: string; |
|
price: Price2; |
|
quality: Quality; |
|
summary: string; |
|
tradable: boolean; |
|
craftable: boolean; |
|
recipe?: Recipe; |
|
priceindex?: string; |
|
sheen?: Origin; |
|
killstreaker?: Origin; |
|
class?: string[]; |
|
slot?: string; |
|
} |
|
|
|
interface Recipe { |
|
estimatedCraftingCost: any[]; |
|
inputItems: any[]; |
|
outputItem?: any; |
|
targetItem: TargetItem; |
|
} |
|
|
|
interface TargetItem { |
|
itemName: string; |
|
imageUrl: string; |
|
_source: Source; |
|
} |
|
|
|
interface Source { |
|
_id: string; |
|
name: string; |
|
defindex: number; |
|
item_class: string; |
|
item_type_name: string; |
|
item_name: string; |
|
proper_name: boolean; |
|
item_slot: string; |
|
item_quality: number; |
|
image_inventory: string; |
|
min_ilevel: number; |
|
max_ilevel: number; |
|
image_url: string; |
|
image_url_large: string; |
|
item_set?: string; |
|
craft_class?: string; |
|
craft_material_type?: string; |
|
capabilities: Capabilities; |
|
styles?: Style[]; |
|
used_by_classes: string[]; |
|
attributes?: Attribute[]; |
|
first_sale_date?: number; |
|
release_date: number; |
|
appid: number; |
|
_keywords: string[]; |
|
item_description?: string; |
|
drop_type?: string; |
|
per_class_loadout_slots?: Perclassloadoutslots; |
|
} |
|
|
|
interface Perclassloadoutslots { |
|
Soldier: string; |
|
Heavy: string; |
|
Pyro: string; |
|
Engineer: string; |
|
} |
|
|
|
interface Attribute { |
|
name: string; |
|
class: string; |
|
value: number; |
|
} |
|
|
|
interface Style { |
|
name: string; |
|
} |
|
|
|
interface Capabilities { |
|
nameable: boolean; |
|
can_gift_wrap: boolean; |
|
can_craft_count?: boolean; |
|
can_craft_mark: boolean; |
|
can_be_restored: boolean; |
|
strange_parts: boolean; |
|
can_card_upgrade: boolean; |
|
can_strangify: boolean; |
|
can_killstreakify: boolean; |
|
can_consume: boolean; |
|
can_customize_texture?: boolean; |
|
paintable?: boolean; |
|
can_craft_if_purchased?: boolean; |
|
can_collect?: boolean; |
|
} |
|
|
|
interface Price2 { |
|
steam: Steam; |
|
suggested: Suggested; |
|
community?: Community; |
|
} |
|
|
|
interface InputItem { |
|
quantity: number; |
|
name: string; |
|
} |
|
|
|
interface KillEater2 { |
|
score: number; |
|
killEater: KillEater; |
|
} |
|
|
|
interface KillEater { |
|
id?: number; |
|
name: string; |
|
} |
|
|
|
interface Tag { |
|
id: string; |
|
steamId: string; |
|
itemId: number; |
|
color: string; |
|
text: string; |
|
} |
|
|
|
interface CraftedBy { |
|
personaname: string; |
|
steamid: string; |
|
} |
|
|
|
interface Particle { |
|
id: number; |
|
name: string; |
|
shortName: string; |
|
imageUrl: string; |
|
type: string; |
|
} |
|
|
|
interface WearTier { |
|
id: number; |
|
name: string; |
|
short: string; |
|
} |
|
|
|
interface Texture { |
|
id: number; |
|
itemDefindex: number; |
|
rarity: Quality; |
|
name: string; |
|
} |
|
|
|
interface Quality { |
|
id: number; |
|
name: string; |
|
color: string; |
|
} |
|
|
|
interface Price5 { |
|
community: Community; |
|
suggested: Suggested; |
|
} |
|
|
|
interface Price4 { |
|
steam: Steam; |
|
suggested: Suggested; |
|
} |
|
|
|
interface Price3 { |
|
steam: Steam; |
|
community: Community; |
|
suggested: Suggested; |
|
} |
|
|
|
interface Suggested { |
|
raw: number; |
|
short: string; |
|
long: string; |
|
usd: number; |
|
} |
|
|
|
interface Community { |
|
value: number; |
|
valueHigh: number; |
|
currency: string; |
|
raw: number; |
|
short: string; |
|
long: string; |
|
usd: number; |
|
updatedAt: number; |
|
difference: number; |
|
} |
|
|
|
interface Price { |
|
steam: Steam; |
|
} |
|
|
|
interface Steam { |
|
currency: string; |
|
short: string; |
|
long: string; |
|
raw: number; |
|
value: number; |
|
} |
|
|
|
interface Origin { |
|
id: number; |
|
name: string; |
|
} |
|
|
|
interface Value { |
|
raw: number; |
|
short: string; |
|
long: string; |
|
} |
|
|
|
interface Currencies { |
|
keys?: number; |
|
metal?: number; |
|
usd?: number; |
|
} |