P2P Deposits & Withdraws

Data Models

Item Object

The item object used in the marketplace.

Field
Type
Description

id

string

Steam Asset ID.

appid

number

Steam App ID (e.g., 730 for CS2, 252490 for Rust).

gun

string

Name of the gun/weapon (can be null for some categories).

skin

string

Name of the skin.

type

string

Item category/type.

wear

string

Item wear condition (optional).

image

string

Full URL to the item icon.

price

number

Item price in sweepstake balance (includes seller rate adjustment).

rate

number

Seller's price adjustment percentage (-25 to 25).

seller

string

Steam ID of the seller.

status

string

marketplace | pending | success | failed | timeout.

buyer

string

Steam ID of the buyer (present if status is not marketplace).

Trade Record

The structure returned by trade-related events.

interface TradeRecord {
    seller: string;
    buyer:
        | {
              avatar: string;
              username: string;
              steamid: string;
          }
        | string
        | null;
    item: Item;
    status: string;
    deadline?: number; // Timestamp when the trade expires
    tradeLink?: string; // Buyer's trade URL (for seller)
    confirmations: {
        buyer: boolean;
        seller: boolean;
    };
}

Client -> Server Events

marketplace

Request the current pool of items available for withdrawal.

  • Payload: { appid: number }

  • Response: Emits marketplace event.

  • Example Response:

deposit-item

List items on the marketplace.

  • Payload: Array<{ id: string, rate: number }>

  • Response: Emits deposit-item event.

  • Example Response:

cancel-deposit

Remove a listed item from the marketplace.

  • Payload: { id: string }

  • Response: Emits cancel-deposit event.

  • Example Response:

withdraw-item

Initiate a purchase/withdrawal of items.

  • Payload: Array<{ id: string }>

  • Response: Emits withdraw-item event.

  • Example Response:

check-trades

Sync the current state of active trades (both as buyer and seller).

  • Payload: None

  • Response: Emits buyer-response and/or seller-response.

  • Example Response (buyer-response):

create-trade

Request the buyer's trade URL to initiate the Steam trade.

  • Payload: { id: string }

  • Response: Emits create-trade event.

  • Example Response:

confirm-trade

Confirm that the trade has been completed on Steam.

  • Payload: { id: string, position: "seller" | "buyer" }

  • Response: Emits confirm-trade event.

  • Example Response:

not-received-trade

Report a trade failure where the seller confirmed but the buyer did not receive the item.

  • Payload: { id: string }

  • Response: Emits failed-trade event to both parties.

  • Example Response:


Server -> Client Events

marketplace

Broadcasted marketplace pool updates.

  • Data: { marketplace: Item[] }

buyer-response

Active trades where the user is the buyer.

  • Data: TradeRecord[]

seller-response

Active trades/listings where the user is the seller.

  • Data: TradeRecord[]

confirm-trade-response

Triggered when a trade confirmation is processed. Use this to refresh the UI.

response-reload

Signal to reload trade data.

failed-trade

Signal that a trade has failed.

  • Data: { id: string }


Integration Example

Buying an Item