@nadohq/mobile-client 0.64.0 → 0.66.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.
Files changed (225) hide show
  1. package/README.md +124 -7
  2. package/dist/MobileClient-M4oC4lrX.cjs +1101 -0
  3. package/dist/MobileClient-M4oC4lrX.cjs.map +1 -0
  4. package/dist/MobileClient.cjs +1 -1
  5. package/dist/MobileClient.d.cts +306 -10
  6. package/dist/MobileClient.d.cts.map +1 -1
  7. package/dist/MobileClient.d.ts +306 -10
  8. package/dist/MobileClient.d.ts.map +1 -1
  9. package/dist/MobileClient.js +544 -5
  10. package/dist/MobileClient.js.map +1 -1
  11. package/dist/{MobileServerFailureError-Dd3c6P_Z.d.ts → MobileServerFailureError-C9iqNsxI.d.ts} +2 -3
  12. package/dist/MobileServerFailureError-C9iqNsxI.d.ts.map +1 -0
  13. package/dist/{MobileServerFailureError-Bpa_WA9f.d.cts → MobileServerFailureError-MtS2reel.d.cts} +2 -3
  14. package/dist/MobileServerFailureError-MtS2reel.d.cts.map +1 -0
  15. package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.cts +15 -0
  16. package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.cts.map +1 -0
  17. package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.ts +15 -0
  18. package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.ts.map +1 -0
  19. package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.cts +15 -0
  20. package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.cts.map +1 -0
  21. package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.ts +15 -0
  22. package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.ts.map +1 -0
  23. package/dist/{buildSignedMobileRequest-Cb1T74xV.d.ts → buildSignedMobileRequest-BR-KJhIF.d.ts} +2 -2
  24. package/dist/{buildSignedMobileRequest-Cb1T74xV.d.ts.map → buildSignedMobileRequest-BR-KJhIF.d.ts.map} +1 -1
  25. package/dist/{buildSignedMobileRequest-NHbMAPzd.d.cts → buildSignedMobileRequest-DyKCK34Y.d.cts} +2 -2
  26. package/dist/{buildSignedMobileRequest-NHbMAPzd.d.cts.map → buildSignedMobileRequest-DyKCK34Y.d.cts.map} +1 -1
  27. package/dist/{canonicalize-BBYGh17w.d.ts → canonicalize-Bv6UIAbR.d.ts} +2 -2
  28. package/dist/canonicalize-Bv6UIAbR.d.ts.map +1 -0
  29. package/dist/{canonicalize-BF_SiNvO.d.cts → canonicalize-CWh3XZzj.d.cts} +2 -2
  30. package/dist/canonicalize-CWh3XZzj.d.cts.map +1 -0
  31. package/dist/clientTypes-BUn5_OzK.d.ts +1665 -0
  32. package/dist/clientTypes-BUn5_OzK.d.ts.map +1 -0
  33. package/dist/clientTypes-DOpUcu80.d.cts +1665 -0
  34. package/dist/clientTypes-DOpUcu80.d.cts.map +1 -0
  35. package/dist/dataMappers.cjs +691 -14
  36. package/dist/dataMappers.cjs.map +1 -1
  37. package/dist/dataMappers.d.cts +254 -8
  38. package/dist/dataMappers.d.cts.map +1 -1
  39. package/dist/dataMappers.d.ts +254 -8
  40. package/dist/dataMappers.d.ts.map +1 -1
  41. package/dist/dataMappers.js +651 -15
  42. package/dist/dataMappers.js.map +1 -1
  43. package/dist/{eip712MethodByType-BSx11xG-.d.cts → eip712MethodByType-CJ6BoayT.d.cts} +2 -2
  44. package/dist/eip712MethodByType-CJ6BoayT.d.cts.map +1 -0
  45. package/dist/{eip712MethodByType-DkiAjCLs.d.ts → eip712MethodByType-Dx4mvgni.d.ts} +2 -2
  46. package/dist/eip712MethodByType-Dx4mvgni.d.ts.map +1 -0
  47. package/dist/{feed-DTJlsg8W.d.ts → feed-DErOLaoY.d.cts} +4 -2
  48. package/dist/feed-DErOLaoY.d.cts.map +1 -0
  49. package/dist/{feed-DTJlsg8W.d.cts → feed-DErOLaoY.d.ts} +4 -2
  50. package/dist/feed-DErOLaoY.d.ts.map +1 -0
  51. package/dist/index.cjs +9 -2
  52. package/dist/index.d.cts +15 -16
  53. package/dist/index.d.ts +15 -16
  54. package/dist/index.js +5 -3
  55. package/dist/{mobileErrorCodes-3LtreeZM.d.ts → mobileErrorCodes-vD6rbFuF.d.cts} +25 -6
  56. package/dist/mobileErrorCodes-vD6rbFuF.d.cts.map +1 -0
  57. package/dist/{mobileErrorCodes-3LtreeZM.d.cts → mobileErrorCodes-vD6rbFuF.d.ts} +25 -6
  58. package/dist/mobileErrorCodes-vD6rbFuF.d.ts.map +1 -0
  59. package/dist/{payloadHash-BOWGjqdb.d.cts → payloadHash-CdkF2Ocr.d.cts} +2 -2
  60. package/dist/payloadHash-CdkF2Ocr.d.cts.map +1 -0
  61. package/dist/{payloadHash-Bzf4CtjV.d.ts → payloadHash-HD29K77M.d.ts} +2 -2
  62. package/dist/payloadHash-HD29K77M.d.ts.map +1 -0
  63. package/dist/serverExecuteTypes-5JyyIXRK.d.ts +178 -0
  64. package/dist/serverExecuteTypes-5JyyIXRK.d.ts.map +1 -0
  65. package/dist/serverExecuteTypes-CHrQ9Rtq.d.cts +178 -0
  66. package/dist/serverExecuteTypes-CHrQ9Rtq.d.cts.map +1 -0
  67. package/dist/serverModelTypes-CGUZCi0y.d.cts +938 -0
  68. package/dist/serverModelTypes-CGUZCi0y.d.cts.map +1 -0
  69. package/dist/serverModelTypes-CGUZCi0y.d.ts +938 -0
  70. package/dist/serverModelTypes-CGUZCi0y.d.ts.map +1 -0
  71. package/dist/{serverResponseGuards-BU1Xv_tG.d.ts → serverResponseGuards-Bvw8ltYJ.d.ts} +2 -2
  72. package/dist/{serverResponseGuards-BU1Xv_tG.d.ts.map → serverResponseGuards-Bvw8ltYJ.d.ts.map} +1 -1
  73. package/dist/{serverResponseGuards-Dkdok0Sm.d.cts → serverResponseGuards-i1njcYKN.d.cts} +2 -2
  74. package/dist/{serverResponseGuards-Dkdok0Sm.d.cts.map → serverResponseGuards-i1njcYKN.d.cts.map} +1 -1
  75. package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
  76. package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
  77. package/dist/signing/canonicalize.cjs +86 -0
  78. package/dist/signing/canonicalize.cjs.map +1 -1
  79. package/dist/signing/canonicalize.d.cts +1 -1
  80. package/dist/signing/canonicalize.d.ts +1 -1
  81. package/dist/signing/canonicalize.js +86 -0
  82. package/dist/signing/canonicalize.js.map +1 -1
  83. package/dist/signing/eip712MethodByType.cjs +12 -0
  84. package/dist/signing/eip712MethodByType.cjs.map +1 -1
  85. package/dist/signing/eip712MethodByType.d.cts +1 -1
  86. package/dist/signing/eip712MethodByType.d.ts +1 -1
  87. package/dist/signing/eip712MethodByType.js +12 -0
  88. package/dist/signing/eip712MethodByType.js.map +1 -1
  89. package/dist/signing/index.d.cts +5 -5
  90. package/dist/signing/index.d.ts +5 -5
  91. package/dist/signing/payloadHash.cjs +1 -1
  92. package/dist/signing/payloadHash.d.cts +1 -1
  93. package/dist/signing/payloadHash.d.ts +1 -1
  94. package/dist/signing/payloadHash.js +1 -1
  95. package/dist/signing/types.d.cts +1 -1
  96. package/dist/signing/types.d.ts +1 -1
  97. package/dist/types/MobileServerFailureError.d.cts +1 -1
  98. package/dist/types/MobileServerFailureError.d.ts +1 -1
  99. package/dist/types/MobileUnsupportedFeedItemError.cjs +19 -0
  100. package/dist/types/MobileUnsupportedFeedItemError.cjs.map +1 -0
  101. package/dist/types/MobileUnsupportedFeedItemError.d.cts +2 -0
  102. package/dist/types/MobileUnsupportedFeedItemError.d.ts +2 -0
  103. package/dist/types/MobileUnsupportedFeedItemError.js +18 -0
  104. package/dist/types/MobileUnsupportedFeedItemError.js.map +1 -0
  105. package/dist/types/MobileUnsupportedNotificationRouteError.cjs +19 -0
  106. package/dist/types/MobileUnsupportedNotificationRouteError.cjs.map +1 -0
  107. package/dist/types/MobileUnsupportedNotificationRouteError.d.cts +2 -0
  108. package/dist/types/MobileUnsupportedNotificationRouteError.d.ts +2 -0
  109. package/dist/types/MobileUnsupportedNotificationRouteError.js +18 -0
  110. package/dist/types/MobileUnsupportedNotificationRouteError.js.map +1 -0
  111. package/dist/types/clientTypes.d.cts +2 -2
  112. package/dist/types/clientTypes.d.ts +2 -2
  113. package/dist/types/index.cjs +6 -0
  114. package/dist/types/index.d.cts +9 -9
  115. package/dist/types/index.d.ts +9 -9
  116. package/dist/types/index.js +4 -2
  117. package/dist/types/mobileErrorCodes.cjs +39 -1
  118. package/dist/types/mobileErrorCodes.cjs.map +1 -1
  119. package/dist/types/mobileErrorCodes.d.cts +1 -1
  120. package/dist/types/mobileErrorCodes.d.ts +1 -1
  121. package/dist/types/mobileErrorCodes.js +39 -1
  122. package/dist/types/mobileErrorCodes.js.map +1 -1
  123. package/dist/types/serverBaseTypes.d.cts +1 -1
  124. package/dist/types/serverBaseTypes.d.ts +1 -1
  125. package/dist/types/serverExecuteTypes.d.cts +2 -2
  126. package/dist/types/serverExecuteTypes.d.ts +2 -2
  127. package/dist/types/serverModelTypes.cjs +15 -0
  128. package/dist/types/serverModelTypes.cjs.map +1 -1
  129. package/dist/types/serverModelTypes.d.cts +2 -2
  130. package/dist/types/serverModelTypes.d.ts +2 -2
  131. package/dist/types/serverModelTypes.js +14 -1
  132. package/dist/types/serverModelTypes.js.map +1 -1
  133. package/dist/types/serverQueryTypes.d.cts +2 -2
  134. package/dist/types/serverQueryTypes.d.ts +2 -2
  135. package/dist/types/serverRequestTypes.d.cts +2 -2
  136. package/dist/types/serverRequestTypes.d.ts +2 -2
  137. package/dist/types-C9YE4EIt.d.cts +794 -0
  138. package/dist/types-C9YE4EIt.d.cts.map +1 -0
  139. package/dist/types-Cwy1y_9x.d.ts +794 -0
  140. package/dist/types-Cwy1y_9x.d.ts.map +1 -0
  141. package/dist/utils/buildMobileFeedImageMultipart.cjs +31 -0
  142. package/dist/utils/buildMobileFeedImageMultipart.cjs.map +1 -0
  143. package/dist/utils/buildMobileFeedImageMultipart.d.cts +15 -0
  144. package/dist/utils/buildMobileFeedImageMultipart.d.cts.map +1 -0
  145. package/dist/utils/buildMobileFeedImageMultipart.d.ts +15 -0
  146. package/dist/utils/buildMobileFeedImageMultipart.d.ts.map +1 -0
  147. package/dist/utils/buildMobileFeedImageMultipart.js +30 -0
  148. package/dist/utils/buildMobileFeedImageMultipart.js.map +1 -0
  149. package/dist/utils/feed.cjs +3 -0
  150. package/dist/utils/feed.cjs.map +1 -1
  151. package/dist/utils/feed.d.cts +2 -2
  152. package/dist/utils/feed.d.ts +2 -2
  153. package/dist/utils/feed.js +3 -1
  154. package/dist/utils/feed.js.map +1 -1
  155. package/dist/utils/index.cjs +2 -1
  156. package/dist/utils/index.d.cts +3 -3
  157. package/dist/utils/index.d.ts +3 -3
  158. package/dist/utils/index.js +2 -2
  159. package/dist/utils/serverResponseGuards.d.cts +1 -1
  160. package/dist/utils/serverResponseGuards.d.ts +1 -1
  161. package/package.json +3 -3
  162. package/src/MobileClient.ts +789 -7
  163. package/src/dataMappers.test.ts +848 -0
  164. package/src/dataMappers.ts +924 -17
  165. package/src/feedImages.test.ts +309 -0
  166. package/src/notifications.test.ts +950 -0
  167. package/src/signing/canonicalize.ts +119 -0
  168. package/src/signing/eip712MethodByType.ts +15 -0
  169. package/src/signing/signing.test.ts +362 -0
  170. package/src/signing/types.ts +108 -13
  171. package/src/socialFeed.test.ts +38 -2
  172. package/src/types/MobileUnsupportedFeedItemError.ts +18 -0
  173. package/src/types/MobileUnsupportedNotificationRouteError.ts +16 -0
  174. package/src/types/clientTypes.ts +1012 -34
  175. package/src/types/index.ts +2 -0
  176. package/src/types/mobileErrorCodes.ts +38 -0
  177. package/src/types/serverExecuteTypes.ts +112 -3
  178. package/src/types/serverModelTypes.ts +581 -28
  179. package/src/types/serverQueryTypes.ts +212 -5
  180. package/src/types/serverRequestTypes.ts +213 -13
  181. package/src/utils/buildMobileFeedImageMultipart.test.ts +45 -0
  182. package/src/utils/buildMobileFeedImageMultipart.ts +36 -0
  183. package/src/utils/feed.ts +3 -0
  184. package/dist/MobileClient-aDxiM_Kf.cjs +0 -562
  185. package/dist/MobileClient-aDxiM_Kf.cjs.map +0 -1
  186. package/dist/MobileServerFailureError-Bpa_WA9f.d.cts.map +0 -1
  187. package/dist/MobileServerFailureError-Dd3c6P_Z.d.ts.map +0 -1
  188. package/dist/canonicalize-BBYGh17w.d.ts.map +0 -1
  189. package/dist/canonicalize-BF_SiNvO.d.cts.map +0 -1
  190. package/dist/clientTypes-BWFKo9oE.d.cts +0 -844
  191. package/dist/clientTypes-BWFKo9oE.d.cts.map +0 -1
  192. package/dist/clientTypes-DCTiUV0H.d.ts +0 -844
  193. package/dist/clientTypes-DCTiUV0H.d.ts.map +0 -1
  194. package/dist/eip712MethodByType-BSx11xG-.d.cts.map +0 -1
  195. package/dist/eip712MethodByType-DkiAjCLs.d.ts.map +0 -1
  196. package/dist/feed-DTJlsg8W.d.cts.map +0 -1
  197. package/dist/feed-DTJlsg8W.d.ts.map +0 -1
  198. package/dist/mobileErrorCodes-3LtreeZM.d.cts.map +0 -1
  199. package/dist/mobileErrorCodes-3LtreeZM.d.ts.map +0 -1
  200. package/dist/payloadHash-BOWGjqdb.d.cts.map +0 -1
  201. package/dist/payloadHash-Bzf4CtjV.d.ts.map +0 -1
  202. package/dist/serverBaseTypes-DWf3iGWy.d.ts +0 -25
  203. package/dist/serverBaseTypes-DWf3iGWy.d.ts.map +0 -1
  204. package/dist/serverBaseTypes-KREDe2M9.d.cts +0 -25
  205. package/dist/serverBaseTypes-KREDe2M9.d.cts.map +0 -1
  206. package/dist/serverExecuteTypes-DVRa6ifu.d.cts +0 -89
  207. package/dist/serverExecuteTypes-DVRa6ifu.d.cts.map +0 -1
  208. package/dist/serverExecuteTypes-DlYZCp1f.d.ts +0 -89
  209. package/dist/serverExecuteTypes-DlYZCp1f.d.ts.map +0 -1
  210. package/dist/serverModelTypes-DAqEyYtB.d.cts +0 -508
  211. package/dist/serverModelTypes-DAqEyYtB.d.cts.map +0 -1
  212. package/dist/serverModelTypes-DAqEyYtB.d.ts +0 -508
  213. package/dist/serverModelTypes-DAqEyYtB.d.ts.map +0 -1
  214. package/dist/serverQueryTypes-BFdwq0Z2.d.ts +0 -171
  215. package/dist/serverQueryTypes-BFdwq0Z2.d.ts.map +0 -1
  216. package/dist/serverQueryTypes-DNdMpmDr.d.cts +0 -171
  217. package/dist/serverQueryTypes-DNdMpmDr.d.cts.map +0 -1
  218. package/dist/serverRequestTypes-BNA7FCY6.d.ts +0 -200
  219. package/dist/serverRequestTypes-BNA7FCY6.d.ts.map +0 -1
  220. package/dist/serverRequestTypes-CxDRFKfv.d.cts +0 -200
  221. package/dist/serverRequestTypes-CxDRFKfv.d.cts.map +0 -1
  222. package/dist/types-BCr2G5gS.d.cts +0 -84
  223. package/dist/types-BCr2G5gS.d.cts.map +0 -1
  224. package/dist/types-C18k-9Vy.d.ts +0 -84
  225. package/dist/types-C18k-9Vy.d.ts.map +0 -1
@@ -0,0 +1,938 @@
1
+ import { BalanceSide } from "@nadohq/shared";
2
+ import { Hex } from "viem";
3
+
4
+ //#region src/types/serverModelTypes.d.ts
5
+ /**
6
+ * Server-side avatar selection, shared by request mapping and signing.
7
+ */
8
+ type MobileServerAvatarSelection = {
9
+ /** Shared catalogue selection. */type: 'preset'; /** Stable catalogue ID. */
10
+ id: string;
11
+ } | {
12
+ /** Uploaded image awaiting publication. */type: 'upload'; /** Staging key returned by create_avatar_upload. */
13
+ upload_key: string;
14
+ };
15
+ /**
16
+ * Server-owned avatar preset in catalogue order.
17
+ */
18
+ interface MobileServerAvatarPreset {
19
+ /** Stable catalogue ID used when selecting this preset. */
20
+ id: string;
21
+ /** Public image URL. */
22
+ avatar_url: string;
23
+ }
24
+ /**
25
+ * Platform of a device registered for push notifications.
26
+ */
27
+ type MobileNotificationPlatform = 'ios' | 'android';
28
+ /**
29
+ * Notification types supported by the v2 payload protocol.
30
+ */
31
+ type MobileNotificationTypeId = 'new_follower' | 'followed_you_back' | 'order_fill' | 'order_update' | 'liquidation' | 'trader_opened' | 'trader_closed' | 'position_milestone' | 'market_movement' | 'trader_streak' | 'account_drama' | 'weekly_digest';
32
+ /**
33
+ * Named navigation destinations supported by notification payloads.
34
+ */
35
+ type MobileNotificationRouteName = MobileServerNotificationRoute['name'];
36
+ /** Position milestone options supported by notification settings. */
37
+ declare const MOBILE_NOTIFICATION_POSITION_THRESHOLDS: readonly [10, 25, 50];
38
+ /** Minimum trade-size options, in whole USD, supported by notification settings. */
39
+ declare const MOBILE_NOTIFICATION_MIN_TRADE_SIZES_USD: readonly [0, 100, 1000, 10000];
40
+ /** Supported notification position milestone threshold. */
41
+ type MobileNotificationPositionThreshold = (typeof MOBILE_NOTIFICATION_POSITION_THRESHOLDS)[number];
42
+ /** Supported notification minimum trade size, in whole USD. */
43
+ type MobileNotificationMinTradeSizeUsd = (typeof MOBILE_NOTIFICATION_MIN_TRADE_SIZES_USD)[number];
44
+ /** Supported product analytics interaction. */
45
+ type MobileProductEventName = 'notif_opened' | 'market_viewed' | 'chart_opened' | 'search';
46
+ /**
47
+ * Category of push notification.
48
+ */
49
+ type MobileNotificationCategory = 'order_fill' | 'order_update' | 'liquidation' | 'funding' | 'product_listing' | 'announcement';
50
+ /**
51
+ * Server-side identity summary (snake_case): the read-time identity fields the backend attaches to a
52
+ * subaccount wherever it surfaces one alongside other data. Name fields are `null` until the subaccount
53
+ * claims a username, and a rename shows up on the next read without any change to the surrounding record.
54
+ */
55
+ interface MobileServerIdentitySummary {
56
+ subaccount: Hex;
57
+ username: string | null;
58
+ display_name: string | null;
59
+ /** Published avatar URL, or null when the account has no saved avatar. */
60
+ avatar_url: string | null;
61
+ }
62
+ /**
63
+ * Server-side follow summary (snake_case), nested in a `profiles` entry when the `follow_summary` include is
64
+ * requested. `is_following` is the direct `view_as -> this profile` relationship; every `followed_by` entry
65
+ * satisfies both `view_as -> entry` and `entry -> this profile`, so each one is already familiar to the
66
+ * viewer and carries no `is_following` of its own.
67
+ */
68
+ interface MobileServerFollowSummary {
69
+ is_following: boolean;
70
+ /** Exact size of the two-edge intersection, independent of how many previews came back. */
71
+ followed_by_count: number;
72
+ /** Capped at `MOBILE_FOLLOWED_BY_PREVIEW_LIMIT` (2) by the backend; not client-configurable. */
73
+ followed_by: MobileServerIdentitySummary[];
74
+ }
75
+ /**
76
+ * Server-side public profile shape (snake_case), shared by the singular `profile` and batched `profiles`
77
+ * queries. Name fields are `null` until the subaccount claims a username; a subaccount with no identity row
78
+ * still yields an entry, with `null` names and `private_mode: false`.
79
+ *
80
+ * The three optional fields are omitted from the wire entirely unless the matching `profiles` include asked
81
+ * for them, which is why they are optional rather than nullable — absent means "not requested", not "none".
82
+ * The singular `profile` query never returns any of them.
83
+ */
84
+ interface MobileServerProfile extends MobileServerIdentitySummary {
85
+ private_mode: boolean;
86
+ /** Plain-text biography, or null when unset. */
87
+ bio: string | null;
88
+ /**
89
+ * Exact count at query time — the backend counts rather than reading a cached counter. Unnamed and private
90
+ * accounts are included: Private Mode hides activity, not relationships. Requires `follow_counts`.
91
+ */
92
+ follower_count?: number;
93
+ following_count?: number;
94
+ /** Requires the `follow_summary` include, and is relative to that include's `view_as`. */
95
+ follow_summary?: MobileServerFollowSummary;
96
+ }
97
+ /**
98
+ * Server-side row of a Followers or Following page (snake_case).
99
+ */
100
+ interface MobileServerFollowListAccount {
101
+ identity: MobileServerIdentitySummary;
102
+ /**
103
+ * The `view_as` Viewer's relationship to this account, not the listed relationship that put it in the
104
+ * page, so it is `false` on the Viewer's own row. Omitted entirely when the request named no `view_as`,
105
+ * rather than being sent as a misleading `false`.
106
+ */
107
+ is_following?: boolean;
108
+ /** The listed account's own follower count, exact at query time. */
109
+ follower_count: number;
110
+ }
111
+ /**
112
+ * Direction of the position a feed trade resulted in — for `closed`, the direction that was closed. This is
113
+ * NOT the execution buy/sell side, which the feed does not expose. Aliases {@link BalanceSide} so the feed's
114
+ * direction values stay in lockstep with the rest of the SDK.
115
+ */
116
+ type MobileFeedTradePositionDirection = BalanceSide;
117
+ /**
118
+ * Every {@link MobileFeedTradePositionDirection} the feed can report, for callers that need the values at
119
+ * runtime (validation, filters, UI enumeration).
120
+ */
121
+ declare const MOBILE_FEED_TRADE_POSITION_DIRECTIONS: readonly ["long", "short"];
122
+ /**
123
+ * Every {@link MobileFeedTradePositionEffect} the feed can report, for callers that need the values at
124
+ * runtime (validation, filters, UI enumeration).
125
+ */
126
+ declare const MOBILE_FEED_TRADE_POSITION_EFFECTS: readonly ["opened", "increased", "reduced", "closed", "flipped"];
127
+ /**
128
+ * How a feed trade changed the trader's position in the product.
129
+ */
130
+ type MobileFeedTradePositionEffect = (typeof MOBILE_FEED_TRADE_POSITION_EFFECTS)[number];
131
+ /**
132
+ * Position change of a feed trade. Both keys are single words, so the wire and client shapes are identical
133
+ * and this type is shared by {@link MobileServerFeedTrade} and the client-side `MobileFeedTrade`.
134
+ */
135
+ interface MobileFeedTradePosition {
136
+ direction: MobileFeedTradePositionDirection;
137
+ effect: MobileFeedTradePositionEffect;
138
+ }
139
+ /**
140
+ * Every {@link MobileFeedMarginMode} the feed can report, for callers that need the values at runtime
141
+ * (validation, filters, UI enumeration).
142
+ */
143
+ declare const MOBILE_FEED_MARGIN_MODES: readonly ["cross", "isolated"];
144
+ /**
145
+ * Margin mode a feed trade was executed under. Shared by the wire and client margin shapes.
146
+ */
147
+ type MobileFeedMarginMode = (typeof MOBILE_FEED_MARGIN_MODES)[number];
148
+ /**
149
+ * Server-side margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:
150
+ * `estimated_leverage` (a rounded whole-number estimate, not exact submitted leverage) is omitted on `cross`,
151
+ * and also omitted inside `isolated` when no estimate is available.
152
+ */
153
+ interface MobileServerFeedMargin {
154
+ mode: MobileFeedMarginMode;
155
+ estimated_leverage?: number;
156
+ }
157
+ /**
158
+ * Server-side feed trade shape (snake_case): one row per order digest, enriched at read time with the
159
+ * trader's current identity. Amounts are display-oriented human-unit JSON numbers — do not use them for
160
+ * accounting, order construction, or exact threshold decisions.
161
+ */
162
+ interface MobileServerFeedTrade extends MobileServerIdentitySummary {
163
+ /** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */
164
+ order_digest: Hex;
165
+ product_id: number;
166
+ /** Executed quantity in human units. */
167
+ quantity: number;
168
+ /** Trade notional in whole-dollar human units. */
169
+ notional: number;
170
+ /** Average execution price in human units. */
171
+ average_price: number;
172
+ margin: MobileServerFeedMargin;
173
+ position: MobileFeedTradePosition;
174
+ /** Realized PnL of the trade in human units; can be negative. */
175
+ realized_pnl: number;
176
+ /** Fill time as JavaScript-safe integer Unix milliseconds. */
177
+ filled_at_ms: number;
178
+ }
179
+ /**
180
+ * Server-side scope limiting a notification category preference. Scopes are rejected by the backend for the
181
+ * MVP (`scopes` must be empty) but are part of the wire format.
182
+ */
183
+ type MobileServerNotificationPreferenceScope = {
184
+ type: 'subaccount';
185
+ subaccount: Hex;
186
+ } | {
187
+ type: 'product';
188
+ product_id: number;
189
+ };
190
+ /**
191
+ * Server-side per-category notification preference (snake_case).
192
+ */
193
+ interface MobileServerNotificationCategoryPreference {
194
+ category: MobileNotificationCategory;
195
+ enabled: boolean;
196
+ scopes: MobileServerNotificationPreferenceScope[];
197
+ }
198
+ /**
199
+ * Server-side notification preferences shape (snake_case), used in both the `update_preferences` public
200
+ * execute and the `notification_preferences` public query response.
201
+ */
202
+ interface MobileServerNotificationPreferences {
203
+ /** Only `1` is accepted by the backend for the MVP. */
204
+ schema_version: 1;
205
+ categories: MobileServerNotificationCategoryPreference[];
206
+ }
207
+ /**
208
+ * Stored push-device metadata shared by registration requests and token ownership responses.
209
+ */
210
+ interface MobileServerNotificationDeviceMetadata {
211
+ /** Device operating system. */
212
+ platform: MobileNotificationPlatform;
213
+ /** Locale tag, or null when absent; at most 35 UTF-8 bytes. */
214
+ locale: string | null;
215
+ /** App version, or null when absent; at most 64 UTF-8 bytes. */
216
+ app_version: string | null;
217
+ }
218
+ /**
219
+ * Device capabilities shared by v2 registration and v1/v2 registration queries.
220
+ */
221
+ interface MobileServerNotificationCapabilities {
222
+ /** Exactly one supported payload version. */
223
+ payload_versions: [1] | [2];
224
+ /** Supported subset of the registered notification types. */
225
+ type_ids: MobileNotificationTypeId[];
226
+ /** Supported subset of the named destinations. */
227
+ routes: MobileNotificationRouteName[];
228
+ }
229
+ /**
230
+ * Server-side wallet settings; all fields are required on replacement.
231
+ */
232
+ interface MobileServerNotificationSettings {
233
+ /** Own position milestones and the initial weekly digest. */
234
+ my_positions: boolean;
235
+ /** One to three unique values; the minimum selects the starting milestone tier. */
236
+ position_thresholds: MobileNotificationPositionThreshold[];
237
+ /** Combined order fill/update switch; does not control liquidation notifications. */
238
+ my_orders: boolean;
239
+ /** Ordinary followed-trader notifications; enabled bells override this switch. */
240
+ following_trades: boolean;
241
+ /** Notifications about posts by followed traders. */
242
+ following_posts: boolean;
243
+ /** Minimum trade size for trade notifications, in whole USD. */
244
+ min_trade_size_usd: MobileNotificationMinTradeSizeUsd;
245
+ /** New followers and follow-backs. */
246
+ new_followers: boolean;
247
+ /** Maps to the legacy announcement preference. */
248
+ announcements: boolean;
249
+ /** Opt-in trader streak and account drama discovery notifications. */
250
+ discovery: boolean;
251
+ }
252
+ /**
253
+ * Server-side allowlisted destination; notification data must never be interpreted as an arbitrary URL.
254
+ */
255
+ type MobileServerNotificationRoute = {
256
+ /** Public profile destination. */name: 'profile'; /** Profile subaccount as bytes32. */
257
+ subaccount: Hex;
258
+ } | {
259
+ /** Market destination. */name: 'market'; /** Positive product ID. */
260
+ product_id: number;
261
+ } | {
262
+ /** Own portfolio destination. */name: 'portfolio';
263
+ };
264
+ /**
265
+ * Server-side v2 push/inbox navigation data, not a complete historical trade or notification body.
266
+ */
267
+ interface MobileServerNotificationPayloadV2 {
268
+ /** Payload protocol version. */
269
+ payload_version: 2;
270
+ /** Logical notification UUID, used for click deduplication. */
271
+ notification_id: string;
272
+ /** Intended wallet; private navigation must wait for this wallet to connect. */
273
+ recipient_wallet: Hex;
274
+ /** Registered notification type. */
275
+ type_id: MobileNotificationTypeId;
276
+ /** Supported template version. */
277
+ template_version: 1;
278
+ /** Named destination and its parameters. */
279
+ route: MobileServerNotificationRoute;
280
+ }
281
+ /**
282
+ * Server-side accepted logical notification; does not prove device delivery or read status.
283
+ */
284
+ interface MobileServerNotificationInboxItem {
285
+ /** Logical notification UUID. */
286
+ notification_id: string;
287
+ /** Registered notification type. */
288
+ type_id: MobileNotificationTypeId;
289
+ /** Navigation data, without title, body, or read state. */
290
+ data: MobileServerNotificationPayloadV2;
291
+ /** Intent acceptance time in milliseconds. */
292
+ created_at: number;
293
+ /** Backend-computed trade attribution. */
294
+ trade_within_24h: boolean;
295
+ }
296
+ /**
297
+ * Server-side product analytics event; unused nullable fields must be explicitly null.
298
+ */
299
+ interface MobileServerProductEvent {
300
+ /** Stable event UUID; reuse across retries. */
301
+ client_event_id: string;
302
+ /** Supported interaction; notif_opened is not a read-state mutation. */
303
+ event_name: MobileProductEventName;
304
+ /** Required for notif_opened and owned by the signing wallet; otherwise null. */
305
+ notification_id: string | null;
306
+ /** Actual event time in milliseconds, within the past 7 days or next 5 minutes. */
307
+ occurred_at: number;
308
+ /** Required for market_viewed/chart_opened; otherwise null. */
309
+ product_id: number | null;
310
+ /** Required for search, nonblank and at most 80 Unicode characters; otherwise null. */
311
+ query: string | null;
312
+ }
313
+ /** Content filters accepted by the six social feed lists. Empty or omitted means all. */
314
+ type MobileSocialFeedType = 'open' | 'close' | 'size_change' | 'thoughts' | 'analysis' | 'comments';
315
+ /** Market category used by the social feed. */
316
+ type MobileSocialFeedMarketCategory = 'crypto' | 'finance';
317
+ /** Qualification tier for an account-level PnL badge. */
318
+ type MobileSocialFeedTraderBadgeCode = 'shark' | 'whale';
319
+ /** Availability of the current or last successful qualification snapshot. */
320
+ type MobileSocialFeedCohortStatus = 'ready' | 'stale';
321
+ /** Availability of an author's qualification data. */
322
+ type MobileSocialFeedTraderDataStatus = MobileSocialFeedCohortStatus | 'unavailable';
323
+ /** Category from the authoritative market source. */
324
+ type MobileSocialFeedSourceCategory = 'crypto' | 'stocks' | 'forex' | 'commodities';
325
+ /** Accounting basis used for position PnL. */
326
+ type MobileSocialFeedPnlBasis = 'unrealized_excl_fees_funding' | 'realized_incl_fees_funding';
327
+ /** Whether position PnL is live or frozen at close. */
328
+ type MobileSocialFeedPnlMode = 'live' | 'frozen';
329
+ /** Completeness of position PnL accounting. */
330
+ type MobileSocialFeedPnlQuality = 'ready' | 'pending' | 'unavailable';
331
+ /** Source of the displayed position size and entry price. */
332
+ type MobileSocialFeedPositionDisplayBasis = 'current_position' | 'closing_snapshot';
333
+ /** Current state of a position lifecycle. */
334
+ type MobileSocialFeedPositionState = 'open' | 'closed';
335
+ /** Completeness of the available position history. */
336
+ type MobileSocialFeedHistoryQuality = 'complete' | 'partial';
337
+ /** Trading action represented by an ordinary size-change row. */
338
+ type MobileSocialFeedTradeSizeChangeAction = 'increased' | 'reduced';
339
+ /** Trading action represented by an automatic trade card. */
340
+ type MobileSocialFeedTradeCardAction = 'opened' | 'closed' | MobileSocialFeedTradeSizeChangeAction;
341
+ /** Whether a reading session was created for a list or a direct item. */
342
+ type MobileSocialFeedReadSessionMode = 'feed' | 'item' | 'position';
343
+ /** Kind of feed update target. */
344
+ type MobileSocialFeedTargetType = 'item' | 'position';
345
+ /** Official account-level 30-day PnL badge, independent of position PnL. */
346
+ interface MobileServerSocialFeedTraderBadge {
347
+ /** Qualification tier. */
348
+ code: MobileSocialFeedTraderBadgeCode;
349
+ /** Signed integer in x18 units. */
350
+ pnl_x18: string;
351
+ /** Stable compatibility identifier for the official Portfolio month result. */
352
+ metric_key: 'account_pnl_30d_equity';
353
+ /** PnL window label. */
354
+ window: '30d';
355
+ /** Official source timestamp in Unix milliseconds. */
356
+ source_as_of_ms: number;
357
+ /** Fetch completion timestamp in Unix milliseconds. */
358
+ fetched_at_ms: number;
359
+ /** Qualification snapshot UUID. */
360
+ snapshot_id: string;
361
+ }
362
+ /** Public author identity and the selected viewing account's follow state. */
363
+ interface MobileServerSocialFeedAuthor extends MobileServerIdentitySummary {
364
+ /** Selected view_as account's follow state; null without a viewing account. */
365
+ is_following: boolean | null;
366
+ /** Null when no qualifying badge is available. */
367
+ trader_badge: MobileServerSocialFeedTraderBadge | null;
368
+ /** Stale means the last successful cohort is used after a refresh failure. */
369
+ trader_data_status: MobileSocialFeedTraderDataStatus;
370
+ }
371
+ /** Market metadata from the service's authoritative market source. */
372
+ interface MobileServerSocialFeedMarket {
373
+ /** Market product ID. */
374
+ product_id: number;
375
+ /** Market symbol. */
376
+ symbol: string;
377
+ /** Logo URL when available. */
378
+ logo_url: string | null;
379
+ /** Social feed category when known. */
380
+ category: MobileSocialFeedMarketCategory | null;
381
+ /** Original market categories. */
382
+ source_categories: MobileSocialFeedSourceCategory[];
383
+ }
384
+ /** Leverage display value; unknown isolated leverage differs from inapplicable cross leverage. */
385
+ interface MobileSocialFeedLeverage {
386
+ /** Rounded whole-number string, or null. Never an estimated replacement. */
387
+ value: string | null;
388
+ /** Cross margin uses not_applicable. */
389
+ basis: 'effective' | 'unknown' | 'not_applicable';
390
+ }
391
+ /** Position PnL with explicit accounting basis and data quality. */
392
+ interface MobileServerSocialFeedPnl {
393
+ /** Signed x18 integer; null means unknown, not zero. */
394
+ amount_x18: string | null;
395
+ /** Open positions exclude fees/funding; closed results include them. */
396
+ basis: MobileSocialFeedPnlBasis;
397
+ /** Closed positions use frozen results. */
398
+ mode: MobileSocialFeedPnlMode;
399
+ /** Source timestamp in Unix milliseconds. */
400
+ as_of_ms: number;
401
+ /** Whether accounting is complete, pending, or unavailable. */
402
+ quality: MobileSocialFeedPnlQuality;
403
+ }
404
+ /** Complete mutable position fields delivered together at one version. */
405
+ interface MobileServerSocialFeedPositionPatch {
406
+ /** Additional metrics for a position history session, when supplied. */
407
+ current_position?: MobileServerSocialFeedHistoryMetrics;
408
+ /** Position lifecycle UUID. */
409
+ position_id: string;
410
+ /** Positive integer string; compare as integers without Number conversion. */
411
+ position_version: string;
412
+ /** Position state timestamp in Unix milliseconds. */
413
+ state_as_of_ms: number;
414
+ /** Remaining average entry cost, frozen on close; x18 or null. */
415
+ entry_price_x18: string | null;
416
+ /** Basis of the displayed size and entry price. */
417
+ display_basis: MobileSocialFeedPositionDisplayBasis;
418
+ /** Closing snapshot reference time, or null. */
419
+ snapshot_at_ms: number | null;
420
+ /** Absolute quantity in x18 units. */
421
+ quantity_x18: string;
422
+ /** Notional value in x18 units. */
423
+ notional_x18: string;
424
+ /** Current lifecycle state. */
425
+ state: MobileSocialFeedPositionState;
426
+ /** Completeness of the available historical facts. */
427
+ history_quality: MobileSocialFeedHistoryQuality;
428
+ /** Margin mode. */
429
+ margin_mode: MobileFeedMarginMode;
430
+ /** Current or closing leverage. */
431
+ leverage: MobileSocialFeedLeverage;
432
+ /** Leverage reference time; null when unknown or inapplicable. */
433
+ leverage_at_ms: number | null;
434
+ /** Current remaining PnL or the closed lifecycle's net result. */
435
+ pnl: MobileServerSocialFeedPnl;
436
+ }
437
+ /** Position displayed inside an automatic trade card. */
438
+ interface MobileServerSocialFeedPositionCard extends MobileServerSocialFeedPositionPatch {
439
+ /** Market product ID. */
440
+ product_id: number;
441
+ /** Market display metadata. */
442
+ market: MobileServerSocialFeedMarket;
443
+ /** Position direction. */
444
+ direction: MobileFeedTradePositionDirection;
445
+ }
446
+ /** Interaction counters and the viewing account's relationship state. */
447
+ interface MobileServerSocialFeedInteraction {
448
+ /** Number of likes. */
449
+ like_count: number;
450
+ /** Number of comments. */
451
+ comment_count: number;
452
+ /** Number of recorded views. */
453
+ view_count: number;
454
+ /** Null when no viewing account is selected. */
455
+ liked_by_me: boolean | null;
456
+ }
457
+ /** Capability flags for a social feed item. */
458
+ interface MobileServerSocialFeedCapabilities {
459
+ /** Whether liking is available. */
460
+ can_like: boolean;
461
+ /** Whether commenting is available. */
462
+ can_comment: boolean;
463
+ /** Whether exposure recording is available. */
464
+ can_record_view: boolean;
465
+ }
466
+ /** Comment preview metadata for a social trade card. */
467
+ interface MobileServerSocialFeedCommentPreview {
468
+ /** Most recent readable replies. */
469
+ items: MobileServerSocialFeedReply[];
470
+ /** Comment count. */
471
+ total_count: number;
472
+ /** Comment cursor, if available. */
473
+ next_cursor: string | null;
474
+ }
475
+ /** Exposure requirements associated with a reading session. */
476
+ interface MobileServerSocialFeedViewTracking {
477
+ /**
478
+ * Detail-visit exposure: report the primary detail target after it is shown in the foreground.
479
+ * List visible-ratio / dwell thresholds are no longer used.
480
+ */
481
+ mode: 'detail_visit';
482
+ }
483
+ /** Uploaded feed image metadata; bytes are fetched separately with the reading session. */
484
+ interface MobileServerSocialFeedImage {
485
+ /** Image UUID. */
486
+ image_id: string;
487
+ /** Backend path for the original image bytes. */
488
+ url: string;
489
+ /** Display-orientation width in pixels. */
490
+ width: number;
491
+ /** Display-orientation height in pixels. */
492
+ height: number;
493
+ /** Detected content type. */
494
+ content_type: 'image/jpeg' | 'image/png';
495
+ /** Original file size in bytes. */
496
+ byte_size: number;
497
+ /** Always-present thumbnail (longest edge ≤ 512, never upscaled). */
498
+ thumbnail: MobileServerSocialFeedImageThumbnail;
499
+ }
500
+ /** Thumbnail metadata for an uploaded feed image. */
501
+ interface MobileServerSocialFeedImageThumbnail {
502
+ /** Backend path for the thumbnail bytes. */
503
+ url: string;
504
+ /** Thumbnail width in pixels. */
505
+ width: number;
506
+ /** Thumbnail height in pixels. */
507
+ height: number;
508
+ }
509
+ /** Coverage of the candidate authors in a qualification snapshot. */
510
+ interface MobileServerSocialFeedCohortCoverage {
511
+ /** Coverage domain. */
512
+ scope: 'eligible_content_candidates';
513
+ /** Candidate author count. */
514
+ total_authors: number;
515
+ /** Authors queried for this snapshot. */
516
+ queried_authors: number;
517
+ /** A successful response requires complete coverage. */
518
+ complete: true;
519
+ }
520
+ /** Shared qualification snapshot used for Top Traders eligibility and badges. */
521
+ interface MobileServerSocialFeedCohort {
522
+ /** Cohort UUID. */
523
+ snapshot_id: string;
524
+ /** Ready or the previous successful snapshot after a refresh failure. */
525
+ status: MobileSocialFeedCohortStatus;
526
+ /** Coverage of all eligible candidate authors. */
527
+ coverage: MobileServerSocialFeedCohortCoverage;
528
+ }
529
+ /** Metadata shared by social feed content. */
530
+ interface MobileServerSocialFeedItemBase {
531
+ /** Item UUID. */
532
+ id: string;
533
+ /** Whether authored analysis exists. */
534
+ has_analysis: boolean;
535
+ /** Parsed drawing document, or null when no drawing is readable. */
536
+ drawing: MobileServerSocialFeedDrawing | null;
537
+ /** Author identity, badge, and follow perspective. */
538
+ author: MobileServerSocialFeedAuthor;
539
+ /** Creation time in Unix milliseconds. */
540
+ created_at_ms: number;
541
+ /** Sorting time in Unix milliseconds. */
542
+ display_at_ms: number;
543
+ /** Positive integer version string. */
544
+ version: string;
545
+ /** Market metadata. */
546
+ market: MobileServerSocialFeedMarket;
547
+ /** Server capability flags, subject to the corresponding write switches. */
548
+ capabilities: MobileServerSocialFeedCapabilities;
549
+ }
550
+ /** Content shared by authored posts and trade cards. */
551
+ interface MobileServerSocialFeedContentBase extends MobileServerSocialFeedItemBase {
552
+ /** Bound images in display order; empty when none. */
553
+ images: MobileServerSocialFeedImage[];
554
+ /** Card text, empty for automatic cards. */
555
+ text: string;
556
+ /** Mentions in the original, unmodified text. */
557
+ mentions: MobileSocialFeedMention[];
558
+ /** Current or frozen position display. */
559
+ position: MobileServerSocialFeedPositionCard;
560
+ /** Interaction counters. */
561
+ interaction: MobileServerSocialFeedInteraction;
562
+ /** Readable comment preview. */
563
+ comment_preview: MobileServerSocialFeedCommentPreview;
564
+ }
565
+ /** Trade card with optional authored text and analysis. */
566
+ interface MobileServerSocialFeedTradeCard extends MobileServerSocialFeedContentBase {
567
+ /** Card discriminant. */
568
+ kind: 'trade_card';
569
+ /** Trading action. */
570
+ action: MobileSocialFeedTradeCardAction;
571
+ }
572
+ /** Fields shared by size-change and liquidation trade rows. */
573
+ interface MobileServerSocialFeedTradeRowBase extends MobileServerSocialFeedItemBase {
574
+ /** Row discriminant. */
575
+ kind: 'trade_row';
576
+ /** Associated lifecycle UUID. */
577
+ position_id: string;
578
+ /** Position direction. */
579
+ direction: MobileFeedTradePositionDirection;
580
+ /** Historical margin mode. */
581
+ margin_mode: MobileFeedMarginMode;
582
+ /** Historical action leverage, not the position's current leverage. */
583
+ leverage: MobileSocialFeedLeverage;
584
+ /** Historical leverage reference time. */
585
+ leverage_at_ms: number | null;
586
+ /** Number of aggregated trades. */
587
+ trade_count: number;
588
+ /** Absolute traded quantity in x18 units. */
589
+ quantity_x18: string;
590
+ /** Actual execution price in x18 units, never an Oracle substitution. */
591
+ average_price_x18: string | null;
592
+ }
593
+ /** A size-change row or liquidation row with independently nullable financial facts. */
594
+ type MobileServerSocialFeedTradeRow = MobileServerSocialFeedTradeRowBase & ({
595
+ /** Ordinary size-change action. */action: MobileSocialFeedTradeSizeChangeAction; /** Executed notional in x18 units. */
596
+ notional_x18: string;
597
+ } | {
598
+ /** Liquidation discriminant. */action: 'liquidated'; /** Quantity times event Oracle; null if that Oracle is unknown. */
599
+ notional_x18: string | null; /** Entry cost immediately before the event, in x18 units. */
600
+ entry_price_x18: string | null; /** Event Oracle used for display and size filtering. */
601
+ liquidation_oracle_price_x18: string | null; /** Actual execution price, independent of Oracle. */
602
+ liquidation_execution_price_x18: string | null; /** Signed action PnL excluding ordinary fees/funding, or null. */
603
+ realized_pnl_delta_x18: string | null;
604
+ });
605
+ /** Discriminated social feed content. */
606
+ type MobileServerSocialFeedItem = MobileServerSocialFeedTradeCard | MobileServerSocialFeedTradeRow | MobileServerSocialFeedPost | MobileServerSocialFeedReply;
607
+ /** Idle-renewed social feed reading session. Credentials and cursors must be returned unchanged. */
608
+ interface MobileServerSocialFeedReadSession {
609
+ /** Session identifier. */
610
+ session_id: string;
611
+ /** Feed, item, or full position history session. */
612
+ mode: MobileSocialFeedReadSessionMode;
613
+ /** Current idle expiration in Unix milliseconds; legitimate session requests renew it. */
614
+ expires_at_ms: number;
615
+ /** Visibility requirements for explicit exposure reporting. */
616
+ view_tracking: MobileServerSocialFeedViewTracking;
617
+ /** Initial update baseline, distinct from the page cursor. */
618
+ update_cursor: string | null;
619
+ /** Credential for this reading session. Do not log or cache publicly. */
620
+ viewer_token: string;
621
+ }
622
+ /** Item delta: omitted means unchanged; explicit null clears a prior value. */
623
+ interface MobileServerSocialFeedItemPatch {
624
+ /** Updated reply attachment; null clears it, omission leaves it unchanged. */
625
+ attached_position?: MobileServerSocialFeedPositionCard | null;
626
+ /** Updated reply attachment visibility. */
627
+ attachment_status?: MobileSocialFeedAttachmentStatus;
628
+ /** Current author identity, follow state, and qualification badge. */
629
+ author: MobileServerSocialFeedAuthor;
630
+ /** Target item UUID. */
631
+ item_id: string;
632
+ /** Positive integer version string. */
633
+ version: string;
634
+ /** Updated interaction counters. */
635
+ interaction?: MobileServerSocialFeedInteraction;
636
+ /** Updated display timestamp; does not reorder the current list. */
637
+ display_at_ms: number;
638
+ /** Updated aggregate count. */
639
+ trade_count?: number;
640
+ /** Updated quantity in x18 units. */
641
+ quantity_x18?: string;
642
+ /** Updated notional; liquidation Oracle may be unknown. */
643
+ notional_x18?: string | null;
644
+ /** Updated actual execution price. */
645
+ average_price_x18?: string | null;
646
+ /** Historical liquidation entry cost. */
647
+ entry_price_x18?: string | null;
648
+ /** Updated liquidation Oracle. */
649
+ liquidation_oracle_price_x18?: string | null;
650
+ /** Updated actual liquidation execution price. */
651
+ liquidation_execution_price_x18?: string | null;
652
+ /** Updated signed action PnL. */
653
+ realized_pnl_delta_x18?: string | null;
654
+ /** Updated historical row leverage. */
655
+ leverage?: MobileSocialFeedLeverage;
656
+ /** Updated historical leverage reference time. */
657
+ leverage_at_ms?: number | null;
658
+ }
659
+ /** A previously authorized target that can no longer be read; shared by wire and client responses. */
660
+ interface MobileSocialFeedUnavailableTarget {
661
+ /** Target kind. */
662
+ type: MobileSocialFeedTargetType;
663
+ /** Target UUID. */
664
+ id: string;
665
+ /** Uniform reason prevents leaking inaccessible content. */
666
+ reason: 'unavailable';
667
+ }
668
+ /** Readable state of a reply's position attachment. */
669
+ type MobileSocialFeedAttachmentStatus = 'none' | 'visible' | 'unavailable';
670
+ /** Supported chart candle intervals. */
671
+ type MobileSocialFeedChartInterval = '1m' | '5m' | '15m' | '1h' | '4h' | '1d';
672
+ /** Position lifecycle action. */
673
+ type MobileSocialFeedAction = MobileSocialFeedTradeCardAction | 'liquidated';
674
+ /** Result of resolving a position command. */
675
+ type MobileSocialFeedPositionResolution = 'resolved' | 'choose_position' | 'no_open_position' | 'unknown_market';
676
+ /** Resolution of a viewing account's trading targets. */
677
+ type MobileSocialFeedTradingResolution = 'no_viewing_account' | 'none' | 'unique' | 'choose_position' | 'unavailable';
678
+ /** Price source for a historical action marker. */
679
+ type MobileSocialFeedActionPriceBasis = 'execution' | 'liquidation_oracle';
680
+ /** Chart source completeness; wholly unavailable sources fail the request. */
681
+ type MobileSocialFeedChartDataQuality = 'ready' | 'partial';
682
+ /** Projection state of an order's authoritative action segments. */
683
+ type MobileSocialFeedActionResolution = 'ready' | 'pending';
684
+ /** Explanation for an empty position command result. */
685
+ type MobileSocialFeedPositionResolutionReason = 'no_open_position' | 'unknown_market';
686
+ /** Reason an action cannot be published. */
687
+ type MobileSocialFeedActionUnavailableReason = 'position_closed' | 'already_published' | 'unavailable';
688
+ /** Availability of an estimated liquidation price. */
689
+ type MobileSocialFeedLiquidationPriceQuality = MobileSocialFeedPnlQuality | 'not_applicable';
690
+ /** Presence lifecycle reported by an individual page. */
691
+ type MobileSocialFeedPresenceState = 'watching' | 'heartbeat' | 'left';
692
+ /** Mention offsets refer to Unicode code points in the original text, not UTF-16 indices. */
693
+ interface MobileSocialFeedMention {
694
+ /** Mentioned identity. */
695
+ subaccount: Hex;
696
+ /** Inclusive code point offset. */
697
+ start: number;
698
+ /** Exclusive code point offset. */
699
+ end: number;
700
+ /** Label matching the original text. */
701
+ label: string;
702
+ }
703
+ /** Parsed drawing; data is opaque to the SDK and may legitimately be false or zero. */
704
+ interface MobileServerSocialFeedDrawing {
705
+ /** Already parsed drawing document; do not JSON.parse again. */
706
+ data: unknown;
707
+ /** Original creation time in milliseconds. */
708
+ created_at_ms: number;
709
+ /** Last update time in milliseconds. */
710
+ updated_at_ms: number;
711
+ }
712
+ /** Nonrecursive root-post preview carried by replies. */
713
+ interface MobileServerSocialFeedCompactCard {
714
+ /** Root item UUID. */
715
+ id: string;
716
+ /** Root author. */
717
+ author: MobileServerSocialFeedAuthor;
718
+ /** Original text excerpt. */
719
+ text_excerpt: string;
720
+ /** Visible position summary, or null. */
721
+ position: Pick<MobileServerSocialFeedPositionCard, 'position_id' | 'market' | 'direction' | 'state' | 'notional_x18'> | null;
722
+ /** Whether the root has published analysis. */
723
+ has_analysis: boolean;
724
+ }
725
+ /** Authored position post, including text-only, drawing-only, and combined content. */
726
+ interface MobileServerSocialFeedPost extends MobileServerSocialFeedContentBase {
727
+ /** Post discriminant. */
728
+ kind: 'post';
729
+ }
730
+ /** Reply with independently permissioned position attachment and nonrecursive root preview. */
731
+ interface MobileServerSocialFeedReply extends MobileServerSocialFeedItemBase {
732
+ /** Reply discriminant. */
733
+ kind: 'reply';
734
+ /** Bound images in display order; empty when none. */
735
+ images: MobileServerSocialFeedImage[];
736
+ /** Original text. */
737
+ text: string;
738
+ /** Mentions in the text. */
739
+ mentions: MobileSocialFeedMention[];
740
+ /** Actual root item UUID. */
741
+ root_item_id: string;
742
+ /** Omitted for a direct reply to the root. */
743
+ reply_to_item_id?: string;
744
+ /** Author being replied to, or null. */
745
+ reply_to_author: MobileServerSocialFeedAuthor | null;
746
+ /** Readable attachment; null when absent or unavailable. */
747
+ attached_position: MobileServerSocialFeedPositionCard | null;
748
+ /** Distinguishes an absent attachment from an unreadable one. */
749
+ attachment_status: MobileSocialFeedAttachmentStatus;
750
+ /** Root preview; does not register root exposure. */
751
+ original: MobileServerSocialFeedCompactCard;
752
+ /** Reply interaction state. */
753
+ interaction: MobileServerSocialFeedInteraction;
754
+ }
755
+ /** Current eligibility hints; actual writes still recheck the signed author. */
756
+ interface MobileServerSocialFeedPublishablePosition {
757
+ /** Candidate position. */
758
+ position: MobileServerSocialFeedPositionCard;
759
+ /** Whether this account can publish. */
760
+ can_publish: boolean;
761
+ /** Whether this account can attach the position to a comment. */
762
+ can_attach_to_comment: boolean;
763
+ /** Whether this account can first add analysis. */
764
+ can_draw_analysis: boolean;
765
+ /** Unavailability explanation, or null. */
766
+ unavailable_reason: string | null;
767
+ }
768
+ /** An authoritative lifecycle segment of an order. */
769
+ interface MobileServerSocialFeedActionCandidate {
770
+ /** Action UUID. */
771
+ action_id: string;
772
+ /** Lifecycle UUID. */
773
+ position_id: string;
774
+ /** Lifecycle action. */
775
+ action: MobileSocialFeedAction;
776
+ /** Current publishing eligibility, not proof of caller ownership. */
777
+ can_publish: boolean;
778
+ /** Publication restriction, or null when eligible. */
779
+ unavailable_reason: MobileSocialFeedActionUnavailableReason | null;
780
+ }
781
+ /** Additional history metrics; unavailable values are not zero. */
782
+ interface MobileServerSocialFeedHistoryMetrics {
783
+ /** Estimated liquidation price in x18, independent of event Oracle and execution prices. */
784
+ estimated_liquidation_price_x18: string | null;
785
+ /** Availability of the estimated price. */
786
+ liquidation_price_quality: MobileSocialFeedLiquidationPriceQuality;
787
+ /** Source time in milliseconds. */
788
+ liquidation_price_as_of_ms: number | null;
789
+ /** Signed funding amount in x18. */
790
+ funding_pnl_x18: string | null;
791
+ /** Funding availability. */
792
+ funding_quality: MobileSocialFeedPnlQuality;
793
+ /** Funding source time in milliseconds. */
794
+ funding_as_of_ms: number | null;
795
+ }
796
+ /** Full position card displayed above its historical timeline. */
797
+ interface MobileServerSocialFeedPositionHistoryCard extends MobileServerSocialFeedPositionCard, MobileServerSocialFeedHistoryMetrics {}
798
+ /** Persisted action facts, independent of whether a feed item was published. */
799
+ interface MobileServerSocialFeedPositionAction {
800
+ /** Action UUID. */
801
+ id: string;
802
+ /** Lifecycle UUID. */
803
+ position_id: string;
804
+ /** Lifecycle action. */
805
+ action: MobileSocialFeedAction;
806
+ /** Position direction. */
807
+ direction: MobileFeedTradePositionDirection;
808
+ /** Historical margin mode. */
809
+ margin_mode: MobileFeedMarginMode;
810
+ /** Quantity before the action, in x18. */
811
+ quantity_before_x18: string;
812
+ /** Quantity after the action, in x18. */
813
+ quantity_after_x18: string;
814
+ /** Executed quantity, in x18. */
815
+ executed_quantity_x18: string;
816
+ /** Actual executed notional in x18; may be unknown for liquidation. */
817
+ executed_notional_x18: string | null;
818
+ /** Actual execution price in x18. */
819
+ average_price_x18: string | null;
820
+ /** Entry price before the action, in x18. */
821
+ entry_price_before_x18: string | null;
822
+ /** Liquidation event Oracle price in x18. */
823
+ liquidation_oracle_price_x18: string | null;
824
+ /** Liquidation Oracle-based notional in x18. */
825
+ liquidation_notional_x18: string | null;
826
+ /** Signed realized trading PnL in x18, excluding ordinary fees and funding. */
827
+ realized_pnl_delta_x18: string | null;
828
+ /** Historical effective leverage. */
829
+ leverage: MobileSocialFeedLeverage;
830
+ /** Leverage source time in milliseconds. */
831
+ leverage_at_ms: number | null;
832
+ /** First event time in milliseconds. */
833
+ first_event_at_ms: number;
834
+ /** Last event time in milliseconds. */
835
+ last_event_at_ms: number;
836
+ /** Decimal-string version. */
837
+ version: string;
838
+ }
839
+ /** Full published content appearing in a position timeline. */
840
+ type MobileServerSocialFeedHistoryTake = MobileServerSocialFeedTradeCard | MobileServerSocialFeedPost;
841
+ /** A historical action or authored take; preserve service ordering. */
842
+ type MobileServerSocialFeedTimelineEntry = {
843
+ /** Action entry. */kind: 'action'; /** Full action facts. */
844
+ action: MobileServerSocialFeedPositionAction; /** Actually associated feed item, or null. */
845
+ related_item_id: string | null; /** Full published trade card, or null. */
846
+ related_take: MobileServerSocialFeedTradeCard | null;
847
+ } | {
848
+ /** Published take entry. */kind: 'take'; /** Full published content. */
849
+ item: MobileServerSocialFeedHistoryTake;
850
+ };
851
+ /** Trusted trading target; this hint does not authorize trading. */
852
+ interface MobileServerSocialFeedTradingTarget {
853
+ /** Lifecycle UUID. */
854
+ position_id: string;
855
+ /** Parent identity. */
856
+ identity_subaccount: Hex;
857
+ /** Actual trading subaccount, possibly isolated. */
858
+ trading_subaccount: Hex;
859
+ /** Market product ID. */
860
+ product_id: number;
861
+ /** Margin mode. */
862
+ margin_mode: MobileFeedMarginMode;
863
+ /** Isolated name, or null for cross margin. */
864
+ iso_subaccount_name: string | null;
865
+ /** Position direction. */
866
+ direction: MobileFeedTradePositionDirection;
867
+ /** Source time in milliseconds. */
868
+ state_as_of_ms: number;
869
+ }
870
+ /** Viewing-account trading hints, not authenticated permissions. */
871
+ interface MobileServerSocialFeedTradingContext {
872
+ /** Market product ID. */
873
+ product_id: number;
874
+ /** Suggested trade direction. */
875
+ suggested_direction: MobileFeedTradePositionDirection;
876
+ /** Resolution of the viewing account's positions. */
877
+ resolution: MobileSocialFeedTradingResolution;
878
+ /** Trusted candidates. */
879
+ candidates: MobileServerSocialFeedTradingTarget[];
880
+ /** Unique candidate, or null. */
881
+ viewer_position_id: string | null;
882
+ /** Whether the selected account has a unique reducible position. */
883
+ can_reduce: boolean;
884
+ }
885
+ /** Historical candle; volume is a quantity, not a price. */
886
+ interface MobileServerSocialFeedCandle {
887
+ /** Candle start time in milliseconds. */
888
+ timestamp_ms: number;
889
+ /** Open price in x18. */
890
+ open_x18: string;
891
+ /** High price in x18. */
892
+ high_x18: string;
893
+ /** Low price in x18. */
894
+ low_x18: string;
895
+ /** Close price in x18. */
896
+ close_x18: string;
897
+ /** Base asset volume in x18. */
898
+ volume_x18: string;
899
+ }
900
+ /** Chart action marker with explicitly identified price basis. */
901
+ interface MobileServerSocialFeedActionMarker {
902
+ /** Action UUID. */
903
+ action_id: string;
904
+ /** Event time in milliseconds. */
905
+ timestamp_ms: number;
906
+ /** Price in x18; null does not remove the action. */
907
+ price_x18: string | null;
908
+ /** Lifecycle action. */
909
+ action: MobileSocialFeedAction;
910
+ /** Direction. */
911
+ direction: MobileFeedTradePositionDirection;
912
+ /** Never substitute actual execution for a liquidation Oracle. */
913
+ price_basis: MobileSocialFeedActionPriceBasis;
914
+ }
915
+ /** Counts across the authorized position history. */
916
+ interface MobileServerSocialFeedHistorySummary {
917
+ /** Action count. */
918
+ action_count: number;
919
+ /** Published take count. */
920
+ take_count: number;
921
+ }
922
+ /** Estimated liquidation price and its source time. */
923
+ interface MobileServerSocialFeedEstimatedLiquidationLine {
924
+ /** Estimated price in x18. */
925
+ price_x18: string;
926
+ /** Source time in milliseconds. */
927
+ as_of_ms: number;
928
+ }
929
+ /** Half-open chart range, preserved across pages. */
930
+ interface MobileServerSocialFeedChartRange {
931
+ /** Inclusive start in milliseconds. */
932
+ from_ms: number;
933
+ /** Exclusive end in milliseconds. */
934
+ to_ms: number;
935
+ }
936
+ //#endregion
937
+ export { MobileServerSocialFeedInteraction as $, MobileServerNotificationPreferences as A, MobileSocialFeedLeverage as At, MobileServerSocialFeedChartRange as B, MobileSocialFeedPositionState as Bt, MobileServerIdentitySummary as C, MobileSocialFeedActionResolution as Ct, MobileServerNotificationInboxItem as D, MobileSocialFeedChartInterval as Dt, MobileServerNotificationDeviceMetadata as E, MobileSocialFeedChartDataQuality as Et, MobileServerSocialFeedActionCandidate as F, MobileSocialFeedPnlMode as Ft, MobileServerSocialFeedContentBase as G, MobileSocialFeedTradeCardAction as Gt, MobileServerSocialFeedCohortCoverage as H, MobileSocialFeedReadSessionMode as Ht, MobileServerSocialFeedActionMarker as I, MobileSocialFeedPnlQuality as It, MobileServerSocialFeedHistoryMetrics as J, MobileSocialFeedTraderDataStatus as Jt, MobileServerSocialFeedDrawing as K, MobileSocialFeedTradeSizeChangeAction as Kt, MobileServerSocialFeedAuthor as L, MobileSocialFeedPositionDisplayBasis as Lt, MobileServerNotificationSettings as M, MobileSocialFeedMarketCategory as Mt, MobileServerProductEvent as N, MobileSocialFeedMention as Nt, MobileServerNotificationPayloadV2 as O, MobileSocialFeedCohortStatus as Ot, MobileServerProfile as P, MobileSocialFeedPnlBasis as Pt, MobileServerSocialFeedImageThumbnail as Q, MobileServerSocialFeedCandle as R, MobileSocialFeedPositionResolution as Rt, MobileServerFollowSummary as S, MobileSocialFeedActionPriceBasis as St, MobileServerNotificationCategoryPreference as T, MobileSocialFeedAttachmentStatus as Tt, MobileServerSocialFeedCommentPreview as U, MobileSocialFeedSourceCategory as Ut, MobileServerSocialFeedCohort as V, MobileSocialFeedPresenceState as Vt, MobileServerSocialFeedCompactCard as W, MobileSocialFeedTargetType as Wt, MobileServerSocialFeedHistoryTake as X, MobileSocialFeedType as Xt, MobileServerSocialFeedHistorySummary as Y, MobileSocialFeedTradingResolution as Yt, MobileServerSocialFeedImage as Z, MobileSocialFeedUnavailableTarget as Zt, MobileServerAvatarPreset as _, MobileServerSocialFeedTraderBadge as _t, MOBILE_NOTIFICATION_POSITION_THRESHOLDS as a, MobileServerSocialFeedPositionAction as at, MobileServerFeedTrade as b, MobileServerSocialFeedViewTracking as bt, MobileFeedTradePositionDirection as c, MobileServerSocialFeedPositionPatch as ct, MobileNotificationMinTradeSizeUsd as d, MobileServerSocialFeedReadSession as dt, MobileServerSocialFeedItem as et, MobileNotificationPlatform as f, MobileServerSocialFeedReply as ft, MobileProductEventName as g, MobileServerSocialFeedTradeRowBase as gt, MobileNotificationTypeId as h, MobileServerSocialFeedTradeRow as ht, MOBILE_NOTIFICATION_MIN_TRADE_SIZES_USD as i, MobileServerSocialFeedPnl as it, MobileServerNotificationRoute as j, MobileSocialFeedLiquidationPriceQuality as jt, MobileServerNotificationPreferenceScope as k, MobileSocialFeedHistoryQuality as kt, MobileFeedTradePositionEffect as l, MobileServerSocialFeedPost as lt, MobileNotificationRouteName as m, MobileServerSocialFeedTradeCard as mt, MOBILE_FEED_TRADE_POSITION_DIRECTIONS as n, MobileServerSocialFeedItemPatch as nt, MobileFeedMarginMode as o, MobileServerSocialFeedPositionCard as ot, MobileNotificationPositionThreshold as p, MobileServerSocialFeedTimelineEntry as pt, MobileServerSocialFeedEstimatedLiquidationLine as q, MobileSocialFeedTraderBadgeCode as qt, MOBILE_FEED_TRADE_POSITION_EFFECTS as r, MobileServerSocialFeedMarket as rt, MobileFeedTradePosition as s, MobileServerSocialFeedPositionHistoryCard as st, MOBILE_FEED_MARGIN_MODES as t, MobileServerSocialFeedItemBase as tt, MobileNotificationCategory as u, MobileServerSocialFeedPublishablePosition as ut, MobileServerAvatarSelection as v, MobileServerSocialFeedTradingContext as vt, MobileServerNotificationCapabilities as w, MobileSocialFeedActionUnavailableReason as wt, MobileServerFollowListAccount as x, MobileSocialFeedAction as xt, MobileServerFeedMargin as y, MobileServerSocialFeedTradingTarget as yt, MobileServerSocialFeedCapabilities as z, MobileSocialFeedPositionResolutionReason as zt };
938
+ //# sourceMappingURL=serverModelTypes-CGUZCi0y.d.cts.map