@nadohq/mobile-client 0.53.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/dist/{MobileClient-CEVEYnV1.cjs → MobileClient-BbTaqTzi.cjs} +141 -3
- package/dist/MobileClient-BbTaqTzi.cjs.map +1 -0
- package/dist/MobileClient.cjs +1 -1
- package/dist/MobileClient.d.cts +75 -8
- package/dist/MobileClient.d.cts.map +1 -1
- package/dist/MobileClient.d.ts +75 -8
- package/dist/MobileClient.d.ts.map +1 -1
- package/dist/MobileClient.js +141 -3
- package/dist/MobileClient.js.map +1 -1
- package/dist/{MobileServerFailureError-GsGrBgO0.d.ts → MobileServerFailureError-B2og8e5O.d.ts} +3 -3
- package/dist/{MobileServerFailureError-GsGrBgO0.d.ts.map → MobileServerFailureError-B2og8e5O.d.ts.map} +1 -1
- package/dist/{MobileServerFailureError-D4ina2b2.d.cts → MobileServerFailureError-BrLtaHnU.d.cts} +3 -3
- package/dist/{MobileServerFailureError-D4ina2b2.d.cts.map → MobileServerFailureError-BrLtaHnU.d.cts.map} +1 -1
- package/dist/{buildSignedMobileRequest-D9XzRTyq.d.cts → buildSignedMobileRequest-CZ-EdxYI.d.cts} +2 -2
- package/dist/{buildSignedMobileRequest-D9XzRTyq.d.cts.map → buildSignedMobileRequest-CZ-EdxYI.d.cts.map} +1 -1
- package/dist/{buildSignedMobileRequest-7Iwi5k6h.d.ts → buildSignedMobileRequest-CoAVSDPx.d.ts} +2 -2
- package/dist/{buildSignedMobileRequest-7Iwi5k6h.d.ts.map → buildSignedMobileRequest-CoAVSDPx.d.ts.map} +1 -1
- package/dist/{canonicalize-OYR35XMP.d.cts → canonicalize-0_B6UOxO.d.cts} +2 -2
- package/dist/canonicalize-0_B6UOxO.d.cts.map +1 -0
- package/dist/{canonicalize-T4ShepBu.d.ts → canonicalize-BC-JICjp.d.ts} +2 -2
- package/dist/canonicalize-BC-JICjp.d.ts.map +1 -0
- package/dist/clientTypes-P4LAjreY.d.ts +731 -0
- package/dist/clientTypes-P4LAjreY.d.ts.map +1 -0
- package/dist/clientTypes-YF5d8bvg.d.cts +731 -0
- package/dist/clientTypes-YF5d8bvg.d.cts.map +1 -0
- package/dist/dataMappers.cjs +358 -0
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.d.cts +132 -6
- package/dist/dataMappers.d.cts.map +1 -1
- package/dist/dataMappers.d.ts +132 -6
- package/dist/dataMappers.d.ts.map +1 -1
- package/dist/dataMappers.js +339 -2
- package/dist/dataMappers.js.map +1 -1
- package/dist/{eip712MethodByType-D6edRSIs.d.ts → eip712MethodByType-DWtLyPY7.d.ts} +2 -2
- package/dist/eip712MethodByType-DWtLyPY7.d.ts.map +1 -0
- package/dist/{eip712MethodByType-BAqld4fP.d.cts → eip712MethodByType-sHQ-VTHd.d.cts} +2 -2
- package/dist/eip712MethodByType-sHQ-VTHd.d.cts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/{mobileErrorCodes-CGYR3_Io.d.ts → mobileErrorCodes-DccrM4NI.d.cts} +8 -2
- package/dist/{mobileErrorCodes-CGYR3_Io.d.cts.map → mobileErrorCodes-DccrM4NI.d.cts.map} +1 -1
- package/dist/{mobileErrorCodes-CGYR3_Io.d.cts → mobileErrorCodes-DccrM4NI.d.ts} +8 -2
- package/dist/{mobileErrorCodes-CGYR3_Io.d.ts.map → mobileErrorCodes-DccrM4NI.d.ts.map} +1 -1
- package/dist/{payloadHash-B7Nmf64N.d.cts → payloadHash-CSgTglN4.d.cts} +2 -2
- package/dist/payloadHash-CSgTglN4.d.cts.map +1 -0
- package/dist/{payloadHash-RxkbwgTH.d.ts → payloadHash-qsU1DEF0.d.ts} +2 -2
- package/dist/payloadHash-qsU1DEF0.d.ts.map +1 -0
- package/dist/{serverBaseTypes-BOuAdmuQ.d.cts → serverBaseTypes-CuMsGXgc.d.cts} +2 -2
- package/dist/{serverBaseTypes-BOuAdmuQ.d.cts.map → serverBaseTypes-CuMsGXgc.d.cts.map} +1 -1
- package/dist/{serverBaseTypes-DDzfBA1a.d.ts → serverBaseTypes-DKCLDn3x.d.ts} +2 -2
- package/dist/{serverBaseTypes-DDzfBA1a.d.ts.map → serverBaseTypes-DKCLDn3x.d.ts.map} +1 -1
- package/dist/{serverExecuteTypes-DrxK2r7m.d.ts → serverExecuteTypes-DKG1mqy1.d.ts} +3 -3
- package/dist/{serverExecuteTypes-DrxK2r7m.d.ts.map → serverExecuteTypes-DKG1mqy1.d.ts.map} +1 -1
- package/dist/{serverExecuteTypes-DamHfu25.d.cts → serverExecuteTypes-TPX0GCgv.d.cts} +3 -3
- package/dist/{serverExecuteTypes-DamHfu25.d.cts.map → serverExecuteTypes-TPX0GCgv.d.cts.map} +1 -1
- package/dist/serverModelTypes-MlqdaMRd.d.cts +490 -0
- package/dist/serverModelTypes-MlqdaMRd.d.cts.map +1 -0
- package/dist/serverModelTypes-MlqdaMRd.d.ts +490 -0
- package/dist/serverModelTypes-MlqdaMRd.d.ts.map +1 -0
- package/dist/serverQueryTypes-BLUe10AI.d.ts +152 -0
- package/dist/serverQueryTypes-BLUe10AI.d.ts.map +1 -0
- package/dist/serverQueryTypes-BZOoJBpb.d.cts +152 -0
- package/dist/serverQueryTypes-BZOoJBpb.d.cts.map +1 -0
- package/dist/{serverRequestTypes-BylecTUn.d.cts → serverRequestTypes-BULjZnnz.d.ts} +69 -4
- package/dist/serverRequestTypes-BULjZnnz.d.ts.map +1 -0
- package/dist/{serverRequestTypes-DcdmGfTu.d.ts → serverRequestTypes-XbnLUsXT.d.cts} +69 -4
- package/dist/serverRequestTypes-XbnLUsXT.d.cts.map +1 -0
- package/dist/{serverResponseGuards-CjR1tv7G.d.cts → serverResponseGuards-DIj9MIrJ.d.cts} +2 -2
- package/dist/{serverResponseGuards-CjR1tv7G.d.cts.map → serverResponseGuards-DIj9MIrJ.d.cts.map} +1 -1
- package/dist/{serverResponseGuards-BspbRjOM.d.ts → serverResponseGuards-DY_8lAo7.d.ts} +2 -2
- package/dist/{serverResponseGuards-BspbRjOM.d.ts.map → serverResponseGuards-DY_8lAo7.d.ts.map} +1 -1
- package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
- package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
- package/dist/signing/canonicalize.d.cts +1 -1
- package/dist/signing/canonicalize.d.ts +1 -1
- package/dist/signing/eip712MethodByType.d.cts +1 -1
- package/dist/signing/eip712MethodByType.d.ts +1 -1
- package/dist/signing/index.d.cts +5 -5
- package/dist/signing/index.d.ts +5 -5
- package/dist/signing/payloadHash.d.cts +1 -1
- package/dist/signing/payloadHash.d.ts +1 -1
- package/dist/signing/types.d.cts +1 -1
- package/dist/signing/types.d.ts +1 -1
- package/dist/types/MobileServerFailureError.d.cts +1 -1
- package/dist/types/MobileServerFailureError.d.ts +1 -1
- package/dist/types/clientTypes.d.cts +2 -2
- package/dist/types/clientTypes.d.ts +2 -2
- package/dist/types/index.d.cts +9 -9
- package/dist/types/index.d.ts +9 -9
- package/dist/types/mobileErrorCodes.cjs +13 -1
- package/dist/types/mobileErrorCodes.cjs.map +1 -1
- package/dist/types/mobileErrorCodes.d.cts +1 -1
- package/dist/types/mobileErrorCodes.d.ts +1 -1
- package/dist/types/mobileErrorCodes.js +13 -1
- package/dist/types/mobileErrorCodes.js.map +1 -1
- package/dist/types/serverBaseTypes.d.cts +1 -1
- package/dist/types/serverBaseTypes.d.ts +1 -1
- package/dist/types/serverExecuteTypes.d.cts +1 -1
- package/dist/types/serverExecuteTypes.d.ts +1 -1
- package/dist/types/serverModelTypes.cjs.map +1 -1
- package/dist/types/serverModelTypes.d.cts +2 -2
- package/dist/types/serverModelTypes.d.ts +2 -2
- package/dist/types/serverModelTypes.js.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +2 -2
- package/dist/types/serverQueryTypes.d.ts +2 -2
- package/dist/types/serverRequestTypes.d.cts +2 -2
- package/dist/types/serverRequestTypes.d.ts +2 -2
- package/dist/{types-BG321aOe.d.ts → types-B_4veFLc.d.ts} +3 -3
- package/dist/{types-BG321aOe.d.ts.map → types-B_4veFLc.d.ts.map} +1 -1
- package/dist/{types-D30luCKT.d.cts → types-CwpXP7xM.d.cts} +3 -3
- package/dist/{types-D30luCKT.d.cts.map → types-CwpXP7xM.d.cts.map} +1 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/serverResponseGuards.d.cts +1 -1
- package/dist/utils/serverResponseGuards.d.ts +1 -1
- package/package.json +3 -3
- package/src/MobileClient.ts +192 -2
- package/src/dataMappers.ts +503 -1
- package/src/socialFeed.test.ts +723 -0
- package/src/types/clientTypes.ts +467 -0
- package/src/types/mobileErrorCodes.ts +12 -0
- package/src/types/serverModelTypes.ts +388 -0
- package/src/types/serverQueryTypes.ts +74 -0
- package/src/types/serverRequestTypes.ts +94 -1
- package/dist/MobileClient-CEVEYnV1.cjs.map +0 -1
- package/dist/canonicalize-OYR35XMP.d.cts.map +0 -1
- package/dist/canonicalize-T4ShepBu.d.ts.map +0 -1
- package/dist/clientTypes-FQTkDfq3.d.cts +0 -349
- package/dist/clientTypes-FQTkDfq3.d.cts.map +0 -1
- package/dist/clientTypes-FaHdWkNu.d.ts +0 -349
- package/dist/clientTypes-FaHdWkNu.d.ts.map +0 -1
- package/dist/eip712MethodByType-BAqld4fP.d.cts.map +0 -1
- package/dist/eip712MethodByType-D6edRSIs.d.ts.map +0 -1
- package/dist/payloadHash-B7Nmf64N.d.cts.map +0 -1
- package/dist/payloadHash-RxkbwgTH.d.ts.map +0 -1
- package/dist/serverModelTypes-YmHqfxc8.d.cts +0 -173
- package/dist/serverModelTypes-YmHqfxc8.d.cts.map +0 -1
- package/dist/serverModelTypes-YmHqfxc8.d.ts +0 -173
- package/dist/serverModelTypes-YmHqfxc8.d.ts.map +0 -1
- package/dist/serverQueryTypes-C-_h9awN.d.ts +0 -89
- package/dist/serverQueryTypes-C-_h9awN.d.ts.map +0 -1
- package/dist/serverQueryTypes-CuVsrzGV.d.cts +0 -89
- package/dist/serverQueryTypes-CuVsrzGV.d.cts.map +0 -1
- package/dist/serverRequestTypes-BylecTUn.d.cts.map +0 -1
- package/dist/serverRequestTypes-DcdmGfTu.d.ts.map +0 -1
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import { BalanceSide } from "@nadohq/shared";
|
|
2
|
+
import { Hex } from "viem";
|
|
3
|
+
|
|
4
|
+
//#region src/types/serverModelTypes.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Platform of a device registered for push notifications.
|
|
7
|
+
*/
|
|
8
|
+
type MobileNotificationPlatform = 'ios' | 'android';
|
|
9
|
+
/**
|
|
10
|
+
* Category of push notification.
|
|
11
|
+
*/
|
|
12
|
+
type MobileNotificationCategory = 'order_fill' | 'order_update' | 'liquidation' | 'funding' | 'product_listing' | 'announcement';
|
|
13
|
+
/**
|
|
14
|
+
* Server-side identity summary (snake_case): the read-time identity fields the backend attaches to a
|
|
15
|
+
* subaccount wherever it surfaces one alongside other data. Name fields are `null` until the subaccount
|
|
16
|
+
* claims a username, and a rename shows up on the next read without any change to the surrounding record.
|
|
17
|
+
*/
|
|
18
|
+
interface MobileServerIdentitySummary {
|
|
19
|
+
subaccount: Hex;
|
|
20
|
+
username: string | null;
|
|
21
|
+
display_name: string | null;
|
|
22
|
+
/** Reserved for a future avatar source; `null` until one is implemented. */
|
|
23
|
+
avatar_url: string | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Server-side follow summary (snake_case), nested in a `profiles` entry when the `follow_summary` include is
|
|
27
|
+
* requested. `is_following` is the direct `view_as -> this profile` relationship; every `followed_by` entry
|
|
28
|
+
* satisfies both `view_as -> entry` and `entry -> this profile`, so each one is already familiar to the
|
|
29
|
+
* viewer and carries no `is_following` of its own.
|
|
30
|
+
*/
|
|
31
|
+
interface MobileServerFollowSummary {
|
|
32
|
+
is_following: boolean;
|
|
33
|
+
/** Exact size of the two-edge intersection, independent of how many previews came back. */
|
|
34
|
+
followed_by_count: number;
|
|
35
|
+
/** Capped at `MOBILE_FOLLOWED_BY_PREVIEW_LIMIT` (2) by the backend; not client-configurable. */
|
|
36
|
+
followed_by: MobileServerIdentitySummary[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Server-side public profile shape (snake_case), shared by the singular `profile` and batched `profiles`
|
|
40
|
+
* queries. Name fields are `null` until the subaccount claims a username; a subaccount with no identity row
|
|
41
|
+
* still yields an entry, with `null` names and `private_mode: false`.
|
|
42
|
+
*
|
|
43
|
+
* The three optional fields are omitted from the wire entirely unless the matching `profiles` include asked
|
|
44
|
+
* for them, which is why they are optional rather than nullable — absent means "not requested", not "none".
|
|
45
|
+
* The singular `profile` query never returns any of them.
|
|
46
|
+
*/
|
|
47
|
+
interface MobileServerProfile {
|
|
48
|
+
subaccount: Hex;
|
|
49
|
+
username: string | null;
|
|
50
|
+
display_name: string | null;
|
|
51
|
+
private_mode: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Exact count at query time — the backend counts rather than reading a cached counter. Unnamed and private
|
|
54
|
+
* accounts are included: Private Mode hides activity, not relationships. Requires `follow_counts`.
|
|
55
|
+
*/
|
|
56
|
+
follower_count?: number;
|
|
57
|
+
following_count?: number;
|
|
58
|
+
/** Requires the `follow_summary` include, and is relative to that include's `view_as`. */
|
|
59
|
+
follow_summary?: MobileServerFollowSummary;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Server-side row of a Followers or Following page (snake_case).
|
|
63
|
+
*/
|
|
64
|
+
interface MobileServerFollowListAccount {
|
|
65
|
+
identity: MobileServerIdentitySummary;
|
|
66
|
+
/**
|
|
67
|
+
* The `view_as` Viewer's relationship to this account, not the listed relationship that put it in the
|
|
68
|
+
* page, so it is `false` on the Viewer's own row. Omitted entirely when the request named no `view_as`,
|
|
69
|
+
* rather than being sent as a misleading `false`.
|
|
70
|
+
*/
|
|
71
|
+
is_following?: boolean;
|
|
72
|
+
/** The listed account's own follower count, exact at query time. */
|
|
73
|
+
follower_count: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Direction of the position a feed trade resulted in — for `closed`, the direction that was closed. This is
|
|
77
|
+
* NOT the execution buy/sell side, which the feed does not expose. Aliases {@link BalanceSide} so the feed's
|
|
78
|
+
* direction values stay in lockstep with the rest of the SDK.
|
|
79
|
+
*/
|
|
80
|
+
type MobileFeedTradePositionDirection = BalanceSide;
|
|
81
|
+
/**
|
|
82
|
+
* Every {@link MobileFeedTradePositionDirection} the feed can report, for callers that need the values at
|
|
83
|
+
* runtime (validation, filters, UI enumeration).
|
|
84
|
+
*/
|
|
85
|
+
declare const MOBILE_FEED_TRADE_POSITION_DIRECTIONS: readonly ["long", "short"];
|
|
86
|
+
/**
|
|
87
|
+
* Every {@link MobileFeedTradePositionEffect} the feed can report, for callers that need the values at
|
|
88
|
+
* runtime (validation, filters, UI enumeration).
|
|
89
|
+
*/
|
|
90
|
+
declare const MOBILE_FEED_TRADE_POSITION_EFFECTS: readonly ["opened", "increased", "reduced", "closed", "flipped"];
|
|
91
|
+
/**
|
|
92
|
+
* How a feed trade changed the trader's position in the product.
|
|
93
|
+
*/
|
|
94
|
+
type MobileFeedTradePositionEffect = (typeof MOBILE_FEED_TRADE_POSITION_EFFECTS)[number];
|
|
95
|
+
/**
|
|
96
|
+
* Position change of a feed trade. Both keys are single words, so the wire and client shapes are identical
|
|
97
|
+
* and this type is shared by {@link MobileServerFeedTrade} and the client-side `MobileFeedTrade`.
|
|
98
|
+
*/
|
|
99
|
+
interface MobileFeedTradePosition {
|
|
100
|
+
direction: MobileFeedTradePositionDirection;
|
|
101
|
+
effect: MobileFeedTradePositionEffect;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Every {@link MobileFeedMarginMode} the feed can report, for callers that need the values at runtime
|
|
105
|
+
* (validation, filters, UI enumeration).
|
|
106
|
+
*/
|
|
107
|
+
declare const MOBILE_FEED_MARGIN_MODES: readonly ["cross", "isolated"];
|
|
108
|
+
/**
|
|
109
|
+
* Margin mode a feed trade was executed under. Shared by the wire and client margin shapes.
|
|
110
|
+
*/
|
|
111
|
+
type MobileFeedMarginMode = (typeof MOBILE_FEED_MARGIN_MODES)[number];
|
|
112
|
+
/**
|
|
113
|
+
* Server-side margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:
|
|
114
|
+
* `estimated_leverage` (a rounded whole-number estimate, not exact submitted leverage) is omitted on `cross`,
|
|
115
|
+
* and also omitted inside `isolated` when no estimate is available.
|
|
116
|
+
*/
|
|
117
|
+
interface MobileServerFeedMargin {
|
|
118
|
+
mode: MobileFeedMarginMode;
|
|
119
|
+
estimated_leverage?: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Server-side feed trade shape (snake_case): one row per order digest, enriched at read time with the
|
|
123
|
+
* trader's current identity. Amounts are display-oriented human-unit JSON numbers — do not use them for
|
|
124
|
+
* accounting, order construction, or exact threshold decisions.
|
|
125
|
+
*/
|
|
126
|
+
interface MobileServerFeedTrade extends MobileServerIdentitySummary {
|
|
127
|
+
/** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */
|
|
128
|
+
order_digest: Hex;
|
|
129
|
+
product_id: number;
|
|
130
|
+
/** Executed quantity in human units. */
|
|
131
|
+
quantity: number;
|
|
132
|
+
/** Trade notional in whole-dollar human units. */
|
|
133
|
+
notional: number;
|
|
134
|
+
/** Average execution price in human units. */
|
|
135
|
+
average_price: number;
|
|
136
|
+
margin: MobileServerFeedMargin;
|
|
137
|
+
position: MobileFeedTradePosition;
|
|
138
|
+
/** Realized PnL of the trade in human units; can be negative. */
|
|
139
|
+
realized_pnl: number;
|
|
140
|
+
/** Fill time as JavaScript-safe integer Unix milliseconds. */
|
|
141
|
+
filled_at_ms: number;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Server-side scope limiting a notification category preference. Scopes are rejected by the backend for the
|
|
145
|
+
* MVP (`scopes` must be empty) but are part of the wire format.
|
|
146
|
+
*/
|
|
147
|
+
type MobileServerNotificationPreferenceScope = {
|
|
148
|
+
type: 'subaccount';
|
|
149
|
+
subaccount: Hex;
|
|
150
|
+
} | {
|
|
151
|
+
type: 'product';
|
|
152
|
+
product_id: number;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Server-side per-category notification preference (snake_case).
|
|
156
|
+
*/
|
|
157
|
+
interface MobileServerNotificationCategoryPreference {
|
|
158
|
+
category: MobileNotificationCategory;
|
|
159
|
+
enabled: boolean;
|
|
160
|
+
scopes: MobileServerNotificationPreferenceScope[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Server-side notification preferences shape (snake_case), used in both the `update_preferences` public
|
|
164
|
+
* execute and the `notification_preferences` public query response.
|
|
165
|
+
*/
|
|
166
|
+
interface MobileServerNotificationPreferences {
|
|
167
|
+
/** Only `1` is accepted by the backend for the MVP. */
|
|
168
|
+
schema_version: 1;
|
|
169
|
+
categories: MobileServerNotificationCategoryPreference[];
|
|
170
|
+
}
|
|
171
|
+
/** Content filters accepted by the six social feed lists. Empty or omitted means all. */
|
|
172
|
+
type MobileSocialFeedType = 'open' | 'close' | 'size_change' | 'thoughts' | 'analysis' | 'comments';
|
|
173
|
+
/** Market category used by the social feed. */
|
|
174
|
+
type MobileSocialFeedMarketCategory = 'crypto' | 'finance';
|
|
175
|
+
/** Qualification tier for an account-level PnL badge. */
|
|
176
|
+
type MobileSocialFeedTraderBadgeCode = 'shark' | 'whale';
|
|
177
|
+
/** Availability of the current or last successful qualification snapshot. */
|
|
178
|
+
type MobileSocialFeedCohortStatus = 'ready' | 'stale';
|
|
179
|
+
/** Availability of an author's qualification data. */
|
|
180
|
+
type MobileSocialFeedTraderDataStatus = MobileSocialFeedCohortStatus | 'unavailable';
|
|
181
|
+
/** Category from the authoritative market source. */
|
|
182
|
+
type MobileSocialFeedSourceCategory = 'crypto' | 'stocks' | 'forex' | 'commodities';
|
|
183
|
+
/** Accounting basis used for position PnL. */
|
|
184
|
+
type MobileSocialFeedPnlBasis = 'unrealized_excl_fees_funding' | 'realized_incl_fees_funding';
|
|
185
|
+
/** Whether position PnL is live or frozen at close. */
|
|
186
|
+
type MobileSocialFeedPnlMode = 'live' | 'frozen';
|
|
187
|
+
/** Completeness of position PnL accounting. */
|
|
188
|
+
type MobileSocialFeedPnlQuality = 'ready' | 'pending' | 'unavailable';
|
|
189
|
+
/** Source of the displayed position size and entry price. */
|
|
190
|
+
type MobileSocialFeedPositionDisplayBasis = 'current_position' | 'closing_snapshot';
|
|
191
|
+
/** Current state of a position lifecycle. */
|
|
192
|
+
type MobileSocialFeedPositionState = 'open' | 'closed';
|
|
193
|
+
/** Completeness of the available position history. */
|
|
194
|
+
type MobileSocialFeedHistoryQuality = 'complete' | 'partial';
|
|
195
|
+
/** Trading action represented by an ordinary size-change row. */
|
|
196
|
+
type MobileSocialFeedTradeSizeChangeAction = 'increased' | 'reduced';
|
|
197
|
+
/** Trading action represented by an automatic trade card. */
|
|
198
|
+
type MobileSocialFeedTradeCardAction = 'opened' | 'closed' | MobileSocialFeedTradeSizeChangeAction;
|
|
199
|
+
/** Whether a reading session was created for a list or a direct item. */
|
|
200
|
+
type MobileSocialFeedReadSessionMode = 'feed' | 'item';
|
|
201
|
+
/** Kind of feed update target. */
|
|
202
|
+
type MobileSocialFeedTargetType = 'item' | 'position';
|
|
203
|
+
/** Official account-level 30-day PnL badge, independent of position PnL. */
|
|
204
|
+
interface MobileServerSocialFeedTraderBadge {
|
|
205
|
+
/** Qualification tier. */
|
|
206
|
+
code: MobileSocialFeedTraderBadgeCode;
|
|
207
|
+
/** Signed integer in x18 units. */
|
|
208
|
+
pnl_x18: string;
|
|
209
|
+
/** Stable compatibility identifier for the official Portfolio month result. */
|
|
210
|
+
metric_key: 'account_pnl_30d_equity';
|
|
211
|
+
/** PnL window label. */
|
|
212
|
+
window: '30d';
|
|
213
|
+
/** Official source timestamp in Unix milliseconds. */
|
|
214
|
+
source_as_of_ms: number;
|
|
215
|
+
/** Fetch completion timestamp in Unix milliseconds. */
|
|
216
|
+
fetched_at_ms: number;
|
|
217
|
+
/** Qualification snapshot UUID. */
|
|
218
|
+
snapshot_id: string;
|
|
219
|
+
}
|
|
220
|
+
/** Public author identity and the selected viewing account's follow state. */
|
|
221
|
+
interface MobileServerSocialFeedAuthor extends MobileServerIdentitySummary {
|
|
222
|
+
/** Selected view_as account's follow state; null without a viewing account. */
|
|
223
|
+
is_following: boolean | null;
|
|
224
|
+
/** Null when no qualifying badge is available. */
|
|
225
|
+
trader_badge: MobileServerSocialFeedTraderBadge | null;
|
|
226
|
+
/** Stale means the last successful cohort is used after a refresh failure. */
|
|
227
|
+
trader_data_status: MobileSocialFeedTraderDataStatus;
|
|
228
|
+
}
|
|
229
|
+
/** Market metadata from the service's authoritative market source. */
|
|
230
|
+
interface MobileServerSocialFeedMarket {
|
|
231
|
+
/** Market product ID. */
|
|
232
|
+
product_id: number;
|
|
233
|
+
/** Market symbol. */
|
|
234
|
+
symbol: string;
|
|
235
|
+
/** Logo URL when available. */
|
|
236
|
+
logo_url: string | null;
|
|
237
|
+
/** Social feed category when known. */
|
|
238
|
+
category: MobileSocialFeedMarketCategory | null;
|
|
239
|
+
/** Original market categories. */
|
|
240
|
+
source_categories: MobileSocialFeedSourceCategory[];
|
|
241
|
+
}
|
|
242
|
+
/** Leverage display value; unknown isolated leverage differs from inapplicable cross leverage. */
|
|
243
|
+
interface MobileSocialFeedLeverage {
|
|
244
|
+
/** Rounded whole-number string, or null. Never an estimated replacement. */
|
|
245
|
+
value: string | null;
|
|
246
|
+
/** Cross margin uses not_applicable. */
|
|
247
|
+
basis: 'effective' | 'unknown' | 'not_applicable';
|
|
248
|
+
}
|
|
249
|
+
/** Position PnL with explicit accounting basis and data quality. */
|
|
250
|
+
interface MobileServerSocialFeedPnl {
|
|
251
|
+
/** Signed x18 integer; null means unknown, not zero. */
|
|
252
|
+
amount_x18: string | null;
|
|
253
|
+
/** Open positions exclude fees/funding; closed results include them. */
|
|
254
|
+
basis: MobileSocialFeedPnlBasis;
|
|
255
|
+
/** Closed positions use frozen results. */
|
|
256
|
+
mode: MobileSocialFeedPnlMode;
|
|
257
|
+
/** Source timestamp in Unix milliseconds. */
|
|
258
|
+
as_of_ms: number;
|
|
259
|
+
/** Whether accounting is complete, pending, or unavailable. */
|
|
260
|
+
quality: MobileSocialFeedPnlQuality;
|
|
261
|
+
}
|
|
262
|
+
/** Complete mutable position fields delivered together at one version. */
|
|
263
|
+
interface MobileServerSocialFeedPositionPatch {
|
|
264
|
+
/** Position lifecycle UUID. */
|
|
265
|
+
position_id: string;
|
|
266
|
+
/** Positive integer string; compare as integers without Number conversion. */
|
|
267
|
+
position_version: string;
|
|
268
|
+
/** Position state timestamp in Unix milliseconds. */
|
|
269
|
+
state_as_of_ms: number;
|
|
270
|
+
/** Remaining average entry cost, frozen on close; x18 or null. */
|
|
271
|
+
entry_price_x18: string | null;
|
|
272
|
+
/** Basis of the displayed size and entry price. */
|
|
273
|
+
display_basis: MobileSocialFeedPositionDisplayBasis;
|
|
274
|
+
/** Closing snapshot reference time, or null. */
|
|
275
|
+
snapshot_at_ms: number | null;
|
|
276
|
+
/** Absolute quantity in x18 units. */
|
|
277
|
+
quantity_x18: string;
|
|
278
|
+
/** Notional value in x18 units. */
|
|
279
|
+
notional_x18: string;
|
|
280
|
+
/** Current lifecycle state. */
|
|
281
|
+
state: MobileSocialFeedPositionState;
|
|
282
|
+
/** Completeness of the available historical facts. */
|
|
283
|
+
history_quality: MobileSocialFeedHistoryQuality;
|
|
284
|
+
/** Margin mode. */
|
|
285
|
+
margin_mode: MobileFeedMarginMode;
|
|
286
|
+
/** Current or closing leverage. */
|
|
287
|
+
leverage: MobileSocialFeedLeverage;
|
|
288
|
+
/** Leverage reference time; null when unknown or inapplicable. */
|
|
289
|
+
leverage_at_ms: number | null;
|
|
290
|
+
/** Current remaining PnL or the closed lifecycle's net result. */
|
|
291
|
+
pnl: MobileServerSocialFeedPnl;
|
|
292
|
+
}
|
|
293
|
+
/** Position displayed inside an automatic trade card. */
|
|
294
|
+
interface MobileServerSocialFeedPositionCard extends MobileServerSocialFeedPositionPatch {
|
|
295
|
+
/** Market product ID. */
|
|
296
|
+
product_id: number;
|
|
297
|
+
/** Market display metadata. */
|
|
298
|
+
market: MobileServerSocialFeedMarket;
|
|
299
|
+
/** Position direction. */
|
|
300
|
+
direction: MobileFeedTradePositionDirection;
|
|
301
|
+
}
|
|
302
|
+
/** Interaction counters; interaction writes are not currently available. */
|
|
303
|
+
interface MobileServerSocialFeedInteraction {
|
|
304
|
+
/** Number of likes. */
|
|
305
|
+
like_count: number;
|
|
306
|
+
/** Number of comments. */
|
|
307
|
+
comment_count: number;
|
|
308
|
+
/** Number of recorded views. */
|
|
309
|
+
view_count: number;
|
|
310
|
+
/** Null while likes are unavailable, including with a viewing account. */
|
|
311
|
+
liked_by_me: boolean | null;
|
|
312
|
+
}
|
|
313
|
+
/** Capability flags for a social feed item. */
|
|
314
|
+
interface MobileServerSocialFeedCapabilities {
|
|
315
|
+
/** Whether liking is available. */
|
|
316
|
+
can_like: boolean;
|
|
317
|
+
/** Whether commenting is available. */
|
|
318
|
+
can_comment: boolean;
|
|
319
|
+
/** Whether exposure recording is available. */
|
|
320
|
+
can_record_view: boolean;
|
|
321
|
+
}
|
|
322
|
+
/** Comment preview metadata for a social trade card. */
|
|
323
|
+
interface MobileServerSocialFeedCommentPreview {
|
|
324
|
+
/** Currently empty. */
|
|
325
|
+
items: never[];
|
|
326
|
+
/** Comment count. */
|
|
327
|
+
total_count: number;
|
|
328
|
+
/** Comment cursor, if available. */
|
|
329
|
+
next_cursor: string | null;
|
|
330
|
+
}
|
|
331
|
+
/** Exposure requirements associated with a reading session. */
|
|
332
|
+
interface MobileServerSocialFeedViewTracking {
|
|
333
|
+
/** Required visible fraction. */
|
|
334
|
+
min_visible_ratio: number;
|
|
335
|
+
/** Required visible duration in milliseconds. */
|
|
336
|
+
min_duration_ms: number;
|
|
337
|
+
}
|
|
338
|
+
/** Coverage of the candidate authors in a qualification snapshot. */
|
|
339
|
+
interface MobileServerSocialFeedCohortCoverage {
|
|
340
|
+
/** Coverage domain. */
|
|
341
|
+
scope: 'eligible_content_candidates';
|
|
342
|
+
/** Candidate author count. */
|
|
343
|
+
total_authors: number;
|
|
344
|
+
/** Authors queried for this snapshot. */
|
|
345
|
+
queried_authors: number;
|
|
346
|
+
/** A successful response requires complete coverage. */
|
|
347
|
+
complete: true;
|
|
348
|
+
}
|
|
349
|
+
/** Shared qualification snapshot used for Top Traders eligibility and badges. */
|
|
350
|
+
interface MobileServerSocialFeedCohort {
|
|
351
|
+
/** Cohort UUID. */
|
|
352
|
+
snapshot_id: string;
|
|
353
|
+
/** Ready or the previous successful snapshot after a refresh failure. */
|
|
354
|
+
status: MobileSocialFeedCohortStatus;
|
|
355
|
+
/** Coverage of all eligible candidate authors. */
|
|
356
|
+
coverage: MobileServerSocialFeedCohortCoverage;
|
|
357
|
+
}
|
|
358
|
+
/** Metadata shared by the automatic trade cards and rows available from the social feed. */
|
|
359
|
+
interface MobileServerSocialFeedItemBase {
|
|
360
|
+
/** Item UUID. */
|
|
361
|
+
id: string;
|
|
362
|
+
/** Whether authored analysis exists. */
|
|
363
|
+
has_analysis: boolean;
|
|
364
|
+
/** Drawings are not currently available. */
|
|
365
|
+
drawing: null;
|
|
366
|
+
/** Author identity, badge, and follow perspective. */
|
|
367
|
+
author: MobileServerSocialFeedAuthor;
|
|
368
|
+
/** Creation time in Unix milliseconds. */
|
|
369
|
+
created_at_ms: number;
|
|
370
|
+
/** Sorting time in Unix milliseconds. */
|
|
371
|
+
display_at_ms: number;
|
|
372
|
+
/** Positive integer version string. */
|
|
373
|
+
version: string;
|
|
374
|
+
/** Market metadata. */
|
|
375
|
+
market: MobileServerSocialFeedMarket;
|
|
376
|
+
/** Server capability flags; currently all false. */
|
|
377
|
+
capabilities: MobileServerSocialFeedCapabilities;
|
|
378
|
+
}
|
|
379
|
+
/** Automatic trade card returned by the social feed. */
|
|
380
|
+
interface MobileServerSocialFeedTradeCard extends MobileServerSocialFeedItemBase {
|
|
381
|
+
/** Card discriminant. */
|
|
382
|
+
kind: 'trade_card';
|
|
383
|
+
/** Trading action. */
|
|
384
|
+
action: MobileSocialFeedTradeCardAction;
|
|
385
|
+
/** Card text, empty for automatic cards. */
|
|
386
|
+
text: string;
|
|
387
|
+
/** Automatic cards have no mentions. */
|
|
388
|
+
mentions: never[];
|
|
389
|
+
/** Current or frozen position display. */
|
|
390
|
+
position: MobileServerSocialFeedPositionCard;
|
|
391
|
+
/** Interaction counters. */
|
|
392
|
+
interaction: MobileServerSocialFeedInteraction;
|
|
393
|
+
/** Comment content is not currently available. */
|
|
394
|
+
comment_preview: MobileServerSocialFeedCommentPreview;
|
|
395
|
+
}
|
|
396
|
+
/** Fields shared by size-change and liquidation trade rows. */
|
|
397
|
+
interface MobileServerSocialFeedTradeRowBase extends MobileServerSocialFeedItemBase {
|
|
398
|
+
/** Row discriminant. */
|
|
399
|
+
kind: 'trade_row';
|
|
400
|
+
/** Associated lifecycle UUID. */
|
|
401
|
+
position_id: string;
|
|
402
|
+
/** Position direction. */
|
|
403
|
+
direction: MobileFeedTradePositionDirection;
|
|
404
|
+
/** Historical margin mode. */
|
|
405
|
+
margin_mode: MobileFeedMarginMode;
|
|
406
|
+
/** Historical action leverage, not the position's current leverage. */
|
|
407
|
+
leverage: MobileSocialFeedLeverage;
|
|
408
|
+
/** Historical leverage reference time. */
|
|
409
|
+
leverage_at_ms: number | null;
|
|
410
|
+
/** Number of aggregated trades. */
|
|
411
|
+
trade_count: number;
|
|
412
|
+
/** Absolute traded quantity in x18 units. */
|
|
413
|
+
quantity_x18: string;
|
|
414
|
+
/** Actual execution price in x18 units, never an Oracle substitution. */
|
|
415
|
+
average_price_x18: string | null;
|
|
416
|
+
}
|
|
417
|
+
/** A size-change row or liquidation row with independently nullable financial facts. */
|
|
418
|
+
type MobileServerSocialFeedTradeRow = MobileServerSocialFeedTradeRowBase & ({
|
|
419
|
+
/** Ordinary size-change action. */action: MobileSocialFeedTradeSizeChangeAction; /** Executed notional in x18 units. */
|
|
420
|
+
notional_x18: string;
|
|
421
|
+
} | {
|
|
422
|
+
/** Liquidation discriminant. */action: 'liquidated'; /** Quantity times event Oracle; null if that Oracle is unknown. */
|
|
423
|
+
notional_x18: string | null; /** Entry cost immediately before the event, in x18 units. */
|
|
424
|
+
entry_price_x18: string | null; /** Event Oracle used for display and size filtering. */
|
|
425
|
+
liquidation_oracle_price_x18: string | null; /** Actual execution price, independent of Oracle. */
|
|
426
|
+
liquidation_execution_price_x18: string | null; /** Signed action PnL excluding ordinary fees/funding, or null. */
|
|
427
|
+
realized_pnl_delta_x18: string | null;
|
|
428
|
+
});
|
|
429
|
+
/** Automatic feed content; excludes posts, replies, drawings, and interaction writes. */
|
|
430
|
+
type MobileServerSocialFeedItem = MobileServerSocialFeedTradeCard | MobileServerSocialFeedTradeRow;
|
|
431
|
+
/** Fixed-duration social feed reading session. Credentials and cursors must be returned unchanged. */
|
|
432
|
+
interface MobileServerSocialFeedReadSession {
|
|
433
|
+
/** Session identifier. */
|
|
434
|
+
session_id: string;
|
|
435
|
+
/** Feed or direct item session. */
|
|
436
|
+
mode: MobileSocialFeedReadSessionMode;
|
|
437
|
+
/** Fixed expiration time in Unix milliseconds; pagination does not extend it. */
|
|
438
|
+
expires_at_ms: number;
|
|
439
|
+
/** Exposure metadata only; recording is not available from the social feed. */
|
|
440
|
+
view_tracking: MobileServerSocialFeedViewTracking;
|
|
441
|
+
/** Initial update baseline, distinct from the page cursor. */
|
|
442
|
+
update_cursor: string | null;
|
|
443
|
+
/** Credential for this reading session. Do not log or cache publicly. */
|
|
444
|
+
viewer_token: string;
|
|
445
|
+
}
|
|
446
|
+
/** Item delta: omitted means unchanged; explicit null clears a prior value. */
|
|
447
|
+
interface MobileServerSocialFeedItemPatch {
|
|
448
|
+
/** Current author identity, follow state, and qualification badge. */
|
|
449
|
+
author: MobileServerSocialFeedAuthor;
|
|
450
|
+
/** Target item UUID. */
|
|
451
|
+
item_id: string;
|
|
452
|
+
/** Positive integer version string. */
|
|
453
|
+
version: string;
|
|
454
|
+
/** Updated interaction counters. */
|
|
455
|
+
interaction?: MobileServerSocialFeedInteraction;
|
|
456
|
+
/** Updated display timestamp; does not reorder the current list. */
|
|
457
|
+
display_at_ms: number;
|
|
458
|
+
/** Updated aggregate count. */
|
|
459
|
+
trade_count?: number;
|
|
460
|
+
/** Updated quantity in x18 units. */
|
|
461
|
+
quantity_x18?: string;
|
|
462
|
+
/** Updated notional; liquidation Oracle may be unknown. */
|
|
463
|
+
notional_x18?: string | null;
|
|
464
|
+
/** Updated actual execution price. */
|
|
465
|
+
average_price_x18?: string | null;
|
|
466
|
+
/** Historical liquidation entry cost. */
|
|
467
|
+
entry_price_x18?: string | null;
|
|
468
|
+
/** Updated liquidation Oracle. */
|
|
469
|
+
liquidation_oracle_price_x18?: string | null;
|
|
470
|
+
/** Updated actual liquidation execution price. */
|
|
471
|
+
liquidation_execution_price_x18?: string | null;
|
|
472
|
+
/** Updated signed action PnL. */
|
|
473
|
+
realized_pnl_delta_x18?: string | null;
|
|
474
|
+
/** Updated historical row leverage. */
|
|
475
|
+
leverage?: MobileSocialFeedLeverage;
|
|
476
|
+
/** Updated historical leverage reference time. */
|
|
477
|
+
leverage_at_ms?: number | null;
|
|
478
|
+
}
|
|
479
|
+
/** A previously authorized target that can no longer be read; shared by wire and client responses. */
|
|
480
|
+
interface MobileSocialFeedUnavailableTarget {
|
|
481
|
+
/** Target kind. */
|
|
482
|
+
type: MobileSocialFeedTargetType;
|
|
483
|
+
/** Target UUID. */
|
|
484
|
+
id: string;
|
|
485
|
+
/** Uniform reason prevents leaking inaccessible content. */
|
|
486
|
+
reason: 'unavailable';
|
|
487
|
+
}
|
|
488
|
+
//#endregion
|
|
489
|
+
export { MobileSocialFeedTraderDataStatus as $, MobileServerSocialFeedPositionCard as A, MobileSocialFeedLeverage as B, MobileServerSocialFeedCommentPreview as C, MobileServerSocialFeedItemPatch as D, MobileServerSocialFeedItemBase as E, MobileServerSocialFeedTradeRowBase as F, MobileSocialFeedPositionDisplayBasis as G, MobileSocialFeedPnlBasis as H, MobileServerSocialFeedTraderBadge as I, MobileSocialFeedSourceCategory as J, MobileSocialFeedPositionState as K, MobileServerSocialFeedViewTracking as L, MobileServerSocialFeedReadSession as M, MobileServerSocialFeedTradeCard as N, MobileServerSocialFeedMarket as O, MobileServerSocialFeedTradeRow as P, MobileSocialFeedTraderBadgeCode as Q, MobileSocialFeedCohortStatus as R, MobileServerSocialFeedCohortCoverage as S, MobileServerSocialFeedItem as T, MobileSocialFeedPnlMode as U, MobileSocialFeedMarketCategory as V, MobileSocialFeedPnlQuality as W, MobileSocialFeedTradeCardAction as X, MobileSocialFeedTargetType as Y, MobileSocialFeedTradeSizeChangeAction as Z, MobileServerNotificationPreferences as _, MobileFeedTradePosition as a, MobileServerSocialFeedCapabilities as b, MobileNotificationCategory as c, MobileServerFeedTrade as d, MobileSocialFeedType as et, MobileServerFollowListAccount as f, MobileServerNotificationPreferenceScope as g, MobileServerNotificationCategoryPreference as h, MobileFeedMarginMode as i, MobileServerSocialFeedPositionPatch as j, MobileServerSocialFeedPnl as k, MobileNotificationPlatform as l, MobileServerIdentitySummary as m, MOBILE_FEED_TRADE_POSITION_DIRECTIONS as n, MobileFeedTradePositionDirection as o, MobileServerFollowSummary as p, MobileSocialFeedReadSessionMode as q, MOBILE_FEED_TRADE_POSITION_EFFECTS as r, MobileFeedTradePositionEffect as s, MOBILE_FEED_MARGIN_MODES as t, MobileSocialFeedUnavailableTarget as tt, MobileServerFeedMargin as u, MobileServerProfile as v, MobileServerSocialFeedInteraction as w, MobileServerSocialFeedCohort as x, MobileServerSocialFeedAuthor as y, MobileSocialFeedHistoryQuality as z };
|
|
490
|
+
//# sourceMappingURL=serverModelTypes-MlqdaMRd.d.ts.map
|
|
@@ -0,0 +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Ed,aAAA;EAvEa;EAyEb,WAAA;EAjF0D;EAmF1D,YAAA;EAnFwF;EAqFxF,YAAA;EAnFA;EAqFA,iBAAA;EAjFA;EAmFA,eAAA;EAjFA;EAmFA,4BAAA;EAjFA;EAmFA,+BAAA;EAjFA;EAmFA,sBAAA;EA/EA;EAiFA,QAAA,GAAW,wBAAA;EA/EM;EAiFjB,cAAA;AAAA;;UAIe,iCAAA;EA5EsC;EA8ErD,IAAA,EAAM,0BAA0B;EA9ExB;EAgFR,EAAA;EA9EQ;EAgFR,MAAA;AAAA"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { D as MobileServerSocialFeedItemPatch, M as MobileServerSocialFeedReadSession, T as MobileServerSocialFeedItem, _ as MobileServerNotificationPreferences, d as MobileServerFeedTrade, f as MobileServerFollowListAccount, j as MobileServerSocialFeedPositionPatch, l as MobileNotificationPlatform, tt as MobileSocialFeedUnavailableTarget, v as MobileServerProfile, x as MobileServerSocialFeedCohort } from "./serverModelTypes-MlqdaMRd.js";
|
|
2
|
+
import { o as MobileServerPublicQueryRequestByType, s as MobileServerPublicQueryRequestType } from "./serverRequestTypes-BULjZnnz.js";
|
|
3
|
+
import { n as MobileServerSuccessResponse } from "./serverBaseTypes-DKCLDn3x.js";
|
|
4
|
+
import { Hex } from "viem";
|
|
5
|
+
|
|
6
|
+
//#region src/types/serverQueryTypes.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Unsigned `public_query` request body: a `type` discriminant flattened with its params.
|
|
9
|
+
*/
|
|
10
|
+
type MobileServerPublicQueryRequest<T extends MobileServerPublicQueryRequestType = MobileServerPublicQueryRequestType> = { [K in MobileServerPublicQueryRequestType]: {
|
|
11
|
+
type: K;
|
|
12
|
+
} & MobileServerPublicQueryRequestByType[K] }[T];
|
|
13
|
+
/**
|
|
14
|
+
* Payload of the `username_availability` public query success response.
|
|
15
|
+
*/
|
|
16
|
+
interface MobileServerUsernameAvailabilityResponse {
|
|
17
|
+
username: string;
|
|
18
|
+
available: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Payload of the `profiles` public query success response. One entry per requested subaccount, in the exact
|
|
22
|
+
* order they were requested, so callers can correlate positionally as well as by `subaccount`.
|
|
23
|
+
*/
|
|
24
|
+
interface MobileServerProfilesResponse {
|
|
25
|
+
profiles: MobileServerProfile[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Payload of the `followers` and `following` public query success responses. Both list directions share one
|
|
29
|
+
* shape; only the relationship that selected the rows differs.
|
|
30
|
+
*/
|
|
31
|
+
interface MobileServerFollowListResponse {
|
|
32
|
+
accounts: MobileServerFollowListAccount[];
|
|
33
|
+
/** `null` means the list is complete. */
|
|
34
|
+
next_cursor: string | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Payload of the `feed` public query success response.
|
|
38
|
+
*/
|
|
39
|
+
interface MobileServerFeedResponse {
|
|
40
|
+
trades: MobileServerFeedTrade[];
|
|
41
|
+
/**
|
|
42
|
+
* `null` when there was no additional candidate at query time; a page may contain fewer than `limit` trades
|
|
43
|
+
* (or none) with a non-null cursor because invalid enrichment rows are omitted and pagination is live
|
|
44
|
+
* rather than snapshot.
|
|
45
|
+
*/
|
|
46
|
+
next_cursor: string | null;
|
|
47
|
+
}
|
|
48
|
+
/** Fixed-window list response; an empty page can still have a next cursor. */
|
|
49
|
+
interface MobileServerSocialFeedResponse {
|
|
50
|
+
/** Reading session and its browser credential. */
|
|
51
|
+
read_session: MobileServerSocialFeedReadSession;
|
|
52
|
+
/** Visible items in server order; deduplicate by ID without local reordering. */
|
|
53
|
+
items: MobileServerSocialFeedItem[];
|
|
54
|
+
/** Opaque cursor; null only when pagination is complete. */
|
|
55
|
+
next_cursor: string | null;
|
|
56
|
+
/** New-content baseline, not a pagination or update cursor. */
|
|
57
|
+
watermark: string;
|
|
58
|
+
}
|
|
59
|
+
/** Main-feed page with its ordering version. */
|
|
60
|
+
interface MobileServerSocialFeedRankedResponse extends MobileServerSocialFeedResponse {
|
|
61
|
+
/** Current ordering contract: chronological-v1. */
|
|
62
|
+
ranking_version: string;
|
|
63
|
+
}
|
|
64
|
+
/** Top Traders page, with one shared qualification snapshot for eligibility and badges. */
|
|
65
|
+
interface MobileServerSocialFeedTopTradersResponse extends MobileServerSocialFeedRankedResponse {
|
|
66
|
+
/** Author eligibility snapshot. */
|
|
67
|
+
cohort: MobileServerSocialFeedCohort;
|
|
68
|
+
}
|
|
69
|
+
/** Item details with either a new item session or the reused authorized session. */
|
|
70
|
+
interface MobileServerSocialFeedItemResponse {
|
|
71
|
+
/** Full visible item. */
|
|
72
|
+
item: MobileServerSocialFeedItem;
|
|
73
|
+
/** Session authorized for subsequent updates. */
|
|
74
|
+
read_session: MobileServerSocialFeedReadSession;
|
|
75
|
+
}
|
|
76
|
+
/** Batched viewport updates; apply only the current viewport's latest request sequence. */
|
|
77
|
+
interface MobileServerSocialFeedUpdatesResponse {
|
|
78
|
+
/** Item deltas, independent of current-position patches. */
|
|
79
|
+
item_patches: MobileServerSocialFeedItemPatch[];
|
|
80
|
+
/** Complete mutable position facts at one version. */
|
|
81
|
+
position_patches: MobileServerSocialFeedPositionPatch[];
|
|
82
|
+
/** Previously authorized targets that can no longer be read. */
|
|
83
|
+
unavailable_targets: MobileSocialFeedUnavailableTarget[];
|
|
84
|
+
/** New-content hint; always zero for directly created item sessions. */
|
|
85
|
+
new_items_count: number;
|
|
86
|
+
/** Baseline to use for the next update call with the same viewport. */
|
|
87
|
+
update_cursor: string;
|
|
88
|
+
/** Full snapshot of applicable mutable fields; currently always true. Apply author updates even when the item version is unchanged. */
|
|
89
|
+
reset: boolean;
|
|
90
|
+
/** Echoed viewport revision. */
|
|
91
|
+
viewport_revision: number;
|
|
92
|
+
/** Echoed request sequence. */
|
|
93
|
+
request_seq: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Payload of the `notification_preferences` public query success response.
|
|
97
|
+
*/
|
|
98
|
+
interface MobileServerNotificationPreferencesResponse {
|
|
99
|
+
preferences: MobileServerNotificationPreferences;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Payload of the `registered_wallet` public query success response. Inlined into the envelope rather than
|
|
103
|
+
* nested under a key, matching the backend's `RegisteredWalletResponse`.
|
|
104
|
+
*/
|
|
105
|
+
interface MobileServerRegisteredWalletResponse {
|
|
106
|
+
wallet: Hex;
|
|
107
|
+
platform: MobileNotificationPlatform;
|
|
108
|
+
locale: string | null;
|
|
109
|
+
app_version: string | null;
|
|
110
|
+
token_fingerprint_prefix: string;
|
|
111
|
+
last_seen_at: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Success payloads for each unsigned `public_query`, keyed by request `type`. Counterpart to
|
|
115
|
+
* {@link MobileServerPublicQueryRequestByType} so a query's request params and response share one lookup,
|
|
116
|
+
* matching engine's `EngineServerQueryResponseByType`. Holds the unwrapped payload; the envelope is applied
|
|
117
|
+
* by {@link MobileServerPublicQuerySuccessResponse}.
|
|
118
|
+
*/
|
|
119
|
+
interface MobileServerPublicQueryResponseByType {
|
|
120
|
+
/** For You recommendations. */
|
|
121
|
+
for_you_feed: MobileServerSocialFeedRankedResponse;
|
|
122
|
+
/** Qualified authors and cohort metadata. */
|
|
123
|
+
top_traders_feed: MobileServerSocialFeedTopTradersResponse;
|
|
124
|
+
/** Public content from followed authors. */
|
|
125
|
+
friends_feed: MobileServerSocialFeedRankedResponse;
|
|
126
|
+
/** Published author content. */
|
|
127
|
+
profile_feed: MobileServerSocialFeedResponse;
|
|
128
|
+
/** Published market content. */
|
|
129
|
+
market_feed: MobileServerSocialFeedResponse;
|
|
130
|
+
/** Published position activity. */
|
|
131
|
+
position_feed: MobileServerSocialFeedResponse;
|
|
132
|
+
/** Item details and reading session. */
|
|
133
|
+
feed_item: MobileServerSocialFeedItemResponse;
|
|
134
|
+
/** Authorized viewport changes. */
|
|
135
|
+
feed_updates: MobileServerSocialFeedUpdatesResponse;
|
|
136
|
+
username_availability: MobileServerUsernameAvailabilityResponse;
|
|
137
|
+
profiles: MobileServerProfilesResponse;
|
|
138
|
+
followers: MobileServerFollowListResponse;
|
|
139
|
+
following: MobileServerFollowListResponse;
|
|
140
|
+
feed: MobileServerFeedResponse;
|
|
141
|
+
notification_preferences: MobileServerNotificationPreferencesResponse;
|
|
142
|
+
registered_wallet: MobileServerRegisteredWalletResponse;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Full success response for an unsigned `public_query`: the {@link MobileServerSuccessResponse} envelope with
|
|
146
|
+
* the query's payload inlined alongside `status`. Derived from {@link MobileServerPublicQueryResponseByType},
|
|
147
|
+
* mirroring engine's `EngineServerQuerySuccessResponse` (inlined here instead of nested under `data`).
|
|
148
|
+
*/
|
|
149
|
+
type MobileServerPublicQuerySuccessResponse<T extends MobileServerPublicQueryRequestType = MobileServerPublicQueryRequestType> = MobileServerSuccessResponse & MobileServerPublicQueryResponseByType[T];
|
|
150
|
+
//#endregion
|
|
151
|
+
export { MobileServerPublicQueryRequest as a, MobileServerRegisteredWalletResponse as c, MobileServerSocialFeedResponse as d, MobileServerSocialFeedTopTradersResponse as f, MobileServerProfilesResponse as i, MobileServerSocialFeedItemResponse as l, MobileServerUsernameAvailabilityResponse as m, MobileServerFollowListResponse as n, MobileServerPublicQueryResponseByType as o, MobileServerSocialFeedUpdatesResponse as p, MobileServerNotificationPreferencesResponse as r, MobileServerPublicQuerySuccessResponse as s, MobileServerFeedResponse as t, MobileServerSocialFeedRankedResponse as u };
|
|
152
|
+
//# sourceMappingURL=serverQueryTypes-BLUe10AI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverQueryTypes-BLUe10AI.d.ts","names":[],"sources":["../src/types/src/types/serverQueryTypes.ts"],"mappings":";;;;;;;;AAuBA;KAAY,8BAAA,WACA,kCAAA,GACR,kCAAA,YAEI,kCAAA;EACJ,IAAA,EAAM,CAAA;AAAA,IACJ,oCAAA,CAAqC,CAAA,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