krapio
Library referenceTypes

AppWebhookEvent

type AppWebhookEvent = 
  | AppWebhookOf<"trade.received", {
  from: AppPlayerRef;
  trade_id: number;
}>
  | AppWebhookOf<"trade.completed", {
  partner: AppPlayerRef;
  trade_id: number;
}>
  | AppWebhookOf<"market.sold", {
  buyer: AppPlayerRef;
  listing_id: number;
  price: number;
  skin_index: number;
}>
  | AppWebhookOf<"dm.received", {
  from: AppPlayerRef;
  message_id: number;
}>
  | AppWebhookOf<"friend.followed", {
  follower: AppPlayerRef;
}>
  | AppWebhookOf<"notification.received", {
  from?: AppPlayerRef;
  notification_id: number;
  system: boolean;
}>
  | AppWebhookOf<"grant.revoked", {
  reason: "player" | "staff" | "deleted";
}>
  | {
  created_at: string;
  data: {
     message: string;
  };
  id: 0;
  type: "webhook.test";
}
  | {
  created_at: string;
  data: Record<string, unknown>;
  id: 0;
  type: "webhook.verify";
};

a delivery to an app's webhook: a signal with ids, the details are read with the app api. verify it with verifyWebhook