@nadohq/mobile-client 0.65.0 → 0.67.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 (211) hide show
  1. package/README.md +202 -10
  2. package/dist/{MobileClient-CfVZXTcz.cjs → MobileClient-vuI5wlB_.cjs} +303 -21
  3. package/dist/MobileClient-vuI5wlB_.cjs.map +1 -0
  4. package/dist/MobileClient.cjs +1 -1
  5. package/dist/MobileClient.d.cts +175 -20
  6. package/dist/MobileClient.d.cts.map +1 -1
  7. package/dist/MobileClient.d.ts +175 -20
  8. package/dist/MobileClient.d.ts.map +1 -1
  9. package/dist/MobileClient.js +303 -21
  10. package/dist/MobileClient.js.map +1 -1
  11. package/dist/{MobileServerFailureError-BZVwlsMg.d.ts → MobileServerFailureError-BeCCNShj.d.cts} +2 -3
  12. package/dist/MobileServerFailureError-BeCCNShj.d.cts.map +1 -0
  13. package/dist/{MobileServerFailureError-CbtK8kD4.d.cts → MobileServerFailureError-hHv28weI.d.ts} +2 -3
  14. package/dist/MobileServerFailureError-hHv28weI.d.ts.map +1 -0
  15. package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.cts +15 -0
  16. package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.cts.map +1 -0
  17. package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.ts +15 -0
  18. package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.ts.map +1 -0
  19. package/dist/{buildSignedMobileRequest-C1v0flCR.d.cts → buildSignedMobileRequest-DcEMKU_4.d.cts} +2 -2
  20. package/dist/{buildSignedMobileRequest-C1v0flCR.d.cts.map → buildSignedMobileRequest-DcEMKU_4.d.cts.map} +1 -1
  21. package/dist/{buildSignedMobileRequest-UeeWdYGU.d.ts → buildSignedMobileRequest-DlTMvoXR.d.ts} +2 -2
  22. package/dist/{buildSignedMobileRequest-UeeWdYGU.d.ts.map → buildSignedMobileRequest-DlTMvoXR.d.ts.map} +1 -1
  23. package/dist/{canonicalize-5eeZrkzQ.d.ts → canonicalize-BOZlflI3.d.ts} +2 -2
  24. package/dist/canonicalize-BOZlflI3.d.ts.map +1 -0
  25. package/dist/{canonicalize-CBaZprTo.d.cts → canonicalize-BvCozzvJ.d.cts} +2 -2
  26. package/dist/canonicalize-BvCozzvJ.d.cts.map +1 -0
  27. package/dist/{clientTypes-_mEgzmNs.d.cts → clientTypes-KpHlCDGZ.d.cts} +341 -38
  28. package/dist/clientTypes-KpHlCDGZ.d.cts.map +1 -0
  29. package/dist/{clientTypes-C9dJufxk.d.ts → clientTypes-XRI41VdC.d.ts} +341 -38
  30. package/dist/clientTypes-XRI41VdC.d.ts.map +1 -0
  31. package/dist/dataMappers.cjs +257 -20
  32. package/dist/dataMappers.cjs.map +1 -1
  33. package/dist/dataMappers.d.cts +98 -15
  34. package/dist/dataMappers.d.cts.map +1 -1
  35. package/dist/dataMappers.d.ts +98 -15
  36. package/dist/dataMappers.d.ts.map +1 -1
  37. package/dist/dataMappers.js +242 -20
  38. package/dist/dataMappers.js.map +1 -1
  39. package/dist/{eip712MethodByType-D8jLoxDu.d.cts → eip712MethodByType-DyAmzH7b.d.cts} +2 -2
  40. package/dist/eip712MethodByType-DyAmzH7b.d.cts.map +1 -0
  41. package/dist/{eip712MethodByType-DcUh8h-l.d.ts → eip712MethodByType-qSSAF6i2.d.ts} +2 -2
  42. package/dist/eip712MethodByType-qSSAF6i2.d.ts.map +1 -0
  43. package/dist/feed-BrgkFqP3.d.cts +23 -0
  44. package/dist/feed-BrgkFqP3.d.cts.map +1 -0
  45. package/dist/feed-DcbhLoo1.d.ts +23 -0
  46. package/dist/feed-DcbhLoo1.d.ts.map +1 -0
  47. package/dist/index-BVVgDSdq.d.cts +1 -0
  48. package/dist/index-BVVgDSdq.d.ts +1 -0
  49. package/dist/index.cjs +8 -2
  50. package/dist/index.d.cts +14 -16
  51. package/dist/index.d.ts +14 -16
  52. package/dist/index.js +4 -3
  53. package/dist/{mobileErrorCodes-CmjYEIYm.d.ts → mobileErrorCodes-CdwX6QTO.d.cts} +8 -3
  54. package/dist/mobileErrorCodes-CdwX6QTO.d.cts.map +1 -0
  55. package/dist/{mobileErrorCodes-CmjYEIYm.d.cts → mobileErrorCodes-CdwX6QTO.d.ts} +8 -3
  56. package/dist/mobileErrorCodes-CdwX6QTO.d.ts.map +1 -0
  57. package/dist/{payloadHash-DhHmgRqL.d.cts → payloadHash-BgGSZock.d.cts} +2 -2
  58. package/dist/payloadHash-BgGSZock.d.cts.map +1 -0
  59. package/dist/{payloadHash-E1_8fpLW.d.ts → payloadHash-Bi6upCLQ.d.ts} +2 -2
  60. package/dist/payloadHash-Bi6upCLQ.d.ts.map +1 -0
  61. package/dist/{serverExecuteTypes-BwWGspOg.d.ts → serverExecuteTypes-DuCWe_H_.d.cts} +23 -14
  62. package/dist/serverExecuteTypes-DuCWe_H_.d.cts.map +1 -0
  63. package/dist/{serverExecuteTypes-B-OJok19.d.cts → serverExecuteTypes-usJ6HMJv.d.ts} +23 -14
  64. package/dist/serverExecuteTypes-usJ6HMJv.d.ts.map +1 -0
  65. package/dist/{serverModelTypes-CiA-dy1R.d.ts → serverModelTypes-CTHMNIQS.d.cts} +170 -13
  66. package/dist/serverModelTypes-CTHMNIQS.d.cts.map +1 -0
  67. package/dist/{serverModelTypes-CiA-dy1R.d.cts → serverModelTypes-CTHMNIQS.d.ts} +170 -13
  68. package/dist/serverModelTypes-CTHMNIQS.d.ts.map +1 -0
  69. package/dist/{serverResponseGuards-CShiXpHT.d.ts → serverResponseGuards-CzmldAad.d.cts} +2 -2
  70. package/dist/{serverResponseGuards-BW69PS7O.d.cts.map → serverResponseGuards-CzmldAad.d.cts.map} +1 -1
  71. package/dist/{serverResponseGuards-BW69PS7O.d.cts → serverResponseGuards-Dvkbjp2_.d.ts} +2 -2
  72. package/dist/{serverResponseGuards-CShiXpHT.d.ts.map → serverResponseGuards-Dvkbjp2_.d.ts.map} +1 -1
  73. package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
  74. package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
  75. package/dist/signing/canonicalize.cjs +53 -2
  76. package/dist/signing/canonicalize.cjs.map +1 -1
  77. package/dist/signing/canonicalize.d.cts +1 -1
  78. package/dist/signing/canonicalize.d.ts +1 -1
  79. package/dist/signing/canonicalize.js +53 -2
  80. package/dist/signing/canonicalize.js.map +1 -1
  81. package/dist/signing/eip712MethodByType.cjs +7 -0
  82. package/dist/signing/eip712MethodByType.cjs.map +1 -1
  83. package/dist/signing/eip712MethodByType.d.cts +1 -1
  84. package/dist/signing/eip712MethodByType.d.ts +1 -1
  85. package/dist/signing/eip712MethodByType.js +7 -0
  86. package/dist/signing/eip712MethodByType.js.map +1 -1
  87. package/dist/signing/index.d.cts +5 -5
  88. package/dist/signing/index.d.ts +5 -5
  89. package/dist/signing/payloadHash.cjs +1 -1
  90. package/dist/signing/payloadHash.d.cts +1 -1
  91. package/dist/signing/payloadHash.d.ts +1 -1
  92. package/dist/signing/payloadHash.js +1 -1
  93. package/dist/signing/types.d.cts +1 -1
  94. package/dist/signing/types.d.ts +1 -1
  95. package/dist/types/MobileServerFailureError.d.cts +1 -1
  96. package/dist/types/MobileServerFailureError.d.ts +1 -1
  97. package/dist/types/MobileUnsupportedNotificationRouteError.cjs +19 -0
  98. package/dist/types/MobileUnsupportedNotificationRouteError.cjs.map +1 -0
  99. package/dist/types/MobileUnsupportedNotificationRouteError.d.cts +2 -0
  100. package/dist/types/MobileUnsupportedNotificationRouteError.d.ts +2 -0
  101. package/dist/types/MobileUnsupportedNotificationRouteError.js +18 -0
  102. package/dist/types/MobileUnsupportedNotificationRouteError.js.map +1 -0
  103. package/dist/types/clientTypes.d.cts +2 -2
  104. package/dist/types/clientTypes.d.ts +2 -2
  105. package/dist/types/index.cjs +4 -0
  106. package/dist/types/index.d.cts +8 -9
  107. package/dist/types/index.d.ts +8 -9
  108. package/dist/types/index.js +3 -2
  109. package/dist/types/mobileErrorCodes.cjs +11 -1
  110. package/dist/types/mobileErrorCodes.cjs.map +1 -1
  111. package/dist/types/mobileErrorCodes.d.cts +1 -1
  112. package/dist/types/mobileErrorCodes.d.ts +1 -1
  113. package/dist/types/mobileErrorCodes.js +11 -1
  114. package/dist/types/mobileErrorCodes.js.map +1 -1
  115. package/dist/types/serverBaseTypes.d.cts +1 -1
  116. package/dist/types/serverBaseTypes.d.ts +1 -1
  117. package/dist/types/serverExecuteTypes.d.cts +2 -2
  118. package/dist/types/serverExecuteTypes.d.ts +2 -2
  119. package/dist/types/serverModelTypes.cjs +15 -0
  120. package/dist/types/serverModelTypes.cjs.map +1 -1
  121. package/dist/types/serverModelTypes.d.cts +2 -2
  122. package/dist/types/serverModelTypes.d.ts +2 -2
  123. package/dist/types/serverModelTypes.js +14 -1
  124. package/dist/types/serverModelTypes.js.map +1 -1
  125. package/dist/types/serverQueryTypes.d.cts +2 -2
  126. package/dist/types/serverQueryTypes.d.ts +2 -2
  127. package/dist/types/serverRequestTypes.d.cts +2 -2
  128. package/dist/types/serverRequestTypes.d.ts +2 -2
  129. package/dist/types-CByl_NyJ.d.ts +825 -0
  130. package/dist/types-CByl_NyJ.d.ts.map +1 -0
  131. package/dist/types-CR5iaKR4.d.cts +825 -0
  132. package/dist/types-CR5iaKR4.d.cts.map +1 -0
  133. package/dist/utils/buildMobileFeedImageMultipart.cjs +31 -0
  134. package/dist/utils/buildMobileFeedImageMultipart.cjs.map +1 -0
  135. package/dist/utils/buildMobileFeedImageMultipart.d.cts +15 -0
  136. package/dist/utils/buildMobileFeedImageMultipart.d.cts.map +1 -0
  137. package/dist/utils/buildMobileFeedImageMultipart.d.ts +15 -0
  138. package/dist/utils/buildMobileFeedImageMultipart.d.ts.map +1 -0
  139. package/dist/utils/buildMobileFeedImageMultipart.js +30 -0
  140. package/dist/utils/buildMobileFeedImageMultipart.js.map +1 -0
  141. package/dist/utils/feed.cjs +12 -0
  142. package/dist/utils/feed.cjs.map +1 -1
  143. package/dist/utils/feed.d.cts +2 -2
  144. package/dist/utils/feed.d.ts +2 -2
  145. package/dist/utils/feed.js +11 -1
  146. package/dist/utils/feed.js.map +1 -1
  147. package/dist/utils/index.cjs +3 -1
  148. package/dist/utils/index.d.cts +3 -3
  149. package/dist/utils/index.d.ts +3 -3
  150. package/dist/utils/index.js +2 -2
  151. package/dist/utils/serverResponseGuards.d.cts +1 -1
  152. package/dist/utils/serverResponseGuards.d.ts +1 -1
  153. package/package.json +3 -3
  154. package/src/MobileClient.ts +444 -19
  155. package/src/dataMappers.test.ts +511 -6
  156. package/src/dataMappers.ts +325 -24
  157. package/src/feedImages.test.ts +309 -0
  158. package/src/notifications.test.ts +950 -0
  159. package/src/signing/canonicalize.ts +72 -0
  160. package/src/signing/eip712MethodByType.ts +10 -0
  161. package/src/signing/signing.test.ts +67 -1
  162. package/src/signing/types.ts +55 -9
  163. package/src/socialFeed.test.ts +63 -2
  164. package/src/types/MobileUnsupportedNotificationRouteError.ts +16 -0
  165. package/src/types/clientTypes.ts +427 -36
  166. package/src/types/index.ts +1 -0
  167. package/src/types/mobileErrorCodes.ts +10 -0
  168. package/src/types/serverExecuteTypes.ts +22 -10
  169. package/src/types/serverModelTypes.ts +216 -11
  170. package/src/types/serverQueryTypes.ts +106 -9
  171. package/src/types/serverRequestTypes.ts +114 -17
  172. package/src/utils/buildMobileFeedImageMultipart.test.ts +45 -0
  173. package/src/utils/buildMobileFeedImageMultipart.ts +36 -0
  174. package/src/utils/feed.ts +16 -0
  175. package/dist/MobileClient-CfVZXTcz.cjs.map +0 -1
  176. package/dist/MobileServerFailureError-BZVwlsMg.d.ts.map +0 -1
  177. package/dist/MobileServerFailureError-CbtK8kD4.d.cts.map +0 -1
  178. package/dist/canonicalize-5eeZrkzQ.d.ts.map +0 -1
  179. package/dist/canonicalize-CBaZprTo.d.cts.map +0 -1
  180. package/dist/clientTypes-C9dJufxk.d.ts.map +0 -1
  181. package/dist/clientTypes-_mEgzmNs.d.cts.map +0 -1
  182. package/dist/eip712MethodByType-D8jLoxDu.d.cts.map +0 -1
  183. package/dist/eip712MethodByType-DcUh8h-l.d.ts.map +0 -1
  184. package/dist/feed-DTJlsg8W.d.cts +0 -14
  185. package/dist/feed-DTJlsg8W.d.cts.map +0 -1
  186. package/dist/feed-DTJlsg8W.d.ts +0 -14
  187. package/dist/feed-DTJlsg8W.d.ts.map +0 -1
  188. package/dist/mobileErrorCodes-CmjYEIYm.d.cts.map +0 -1
  189. package/dist/mobileErrorCodes-CmjYEIYm.d.ts.map +0 -1
  190. package/dist/payloadHash-DhHmgRqL.d.cts.map +0 -1
  191. package/dist/payloadHash-E1_8fpLW.d.ts.map +0 -1
  192. package/dist/serverBaseTypes-B5J1_TyC.d.cts +0 -25
  193. package/dist/serverBaseTypes-B5J1_TyC.d.cts.map +0 -1
  194. package/dist/serverBaseTypes-DnLzsdm-.d.ts +0 -25
  195. package/dist/serverBaseTypes-DnLzsdm-.d.ts.map +0 -1
  196. package/dist/serverExecuteTypes-B-OJok19.d.cts.map +0 -1
  197. package/dist/serverExecuteTypes-BwWGspOg.d.ts.map +0 -1
  198. package/dist/serverModelTypes-CiA-dy1R.d.cts.map +0 -1
  199. package/dist/serverModelTypes-CiA-dy1R.d.ts.map +0 -1
  200. package/dist/serverQueryTypes-CJcjLB7n.d.ts +0 -283
  201. package/dist/serverQueryTypes-CJcjLB7n.d.ts.map +0 -1
  202. package/dist/serverQueryTypes-V1f9yE7L.d.cts +0 -283
  203. package/dist/serverQueryTypes-V1f9yE7L.d.cts.map +0 -1
  204. package/dist/serverRequestTypes-CRlkNSu5.d.cts +0 -270
  205. package/dist/serverRequestTypes-CRlkNSu5.d.cts.map +0 -1
  206. package/dist/serverRequestTypes-DZoOhV2o.d.ts +0 -270
  207. package/dist/serverRequestTypes-DZoOhV2o.d.ts.map +0 -1
  208. package/dist/types-BiRmH5Iv.d.cts +0 -108
  209. package/dist/types-BiRmH5Iv.d.cts.map +0 -1
  210. package/dist/types-DoJuq0Ij.d.ts +0 -108
  211. package/dist/types-DoJuq0Ij.d.ts.map +0 -1
@@ -0,0 +1,825 @@
1
+ import { $t as MobileSocialFeedUnavailableTarget, A as MobileServerNotificationPreferences, B as MobileServerSocialFeedChartRange, Bt as MobileSocialFeedPositionResolution, D as MobileServerNotificationInboxItem, E as MobileServerNotificationDeviceMetadata, F as MobileServerSocialFeedActionCandidate, Ft as MobileSocialFeedMention, I as MobileServerSocialFeedActionMarker, J as MobileServerSocialFeedEstimatedLiquidationLine, L as MobileServerSocialFeedAuthor, M as MobileServerNotificationSettings, N as MobileServerProductEvent, Ot as MobileSocialFeedChartDataQuality, P as MobileServerProfile, Pt as MobileSocialFeedMarketCategory, Q as MobileServerSocialFeedHistoryTake, Qt as MobileSocialFeedType, R as MobileServerSocialFeedCandle, Tt as MobileSocialFeedActionResolution, U as MobileServerSocialFeedCommentGroup, Ut as MobileSocialFeedPresenceState, V as MobileServerSocialFeedCohort, Vt as MobileSocialFeedPositionResolutionReason, Z as MobileServerSocialFeedHistorySummary, _ as MobileServerAvatarPreset, at as MobileServerSocialFeedMarket, b as MobileServerFeedTrade, bt as MobileServerSocialFeedTradingContext, ft as MobileServerSocialFeedPublishablePosition, h as MobileNotificationTypeId, ht as MobileServerSocialFeedTimelineEntry, it as MobileServerSocialFeedItemPatch, jt as MobileSocialFeedHistoryQuality, kt as MobileSocialFeedChartInterval, lt as MobileServerSocialFeedPositionHistoryCard, m as MobileNotificationRouteName, nt as MobileServerSocialFeedItem, pt as MobileServerSocialFeedReadSession, q as MobileServerSocialFeedDrawing, ut as MobileServerSocialFeedPositionPatch, v as MobileServerAvatarSelection, w as MobileServerNotificationCapabilities, x as MobileServerFollowListAccount } from "./serverModelTypes-CTHMNIQS.js";
2
+ import { Tt as MobileSignedRequestParams } from "./clientTypes-XRI41VdC.js";
3
+ import { WalletClientWithAccount } from "@nadohq/shared";
4
+ import { Hex } from "viem";
5
+
6
+ //#region src/types/serverBaseTypes.d.ts
7
+ /**
8
+ * Base success envelope shared by every mobile service API route: just the `status` discriminant. Query
9
+ * routes intersect this with their payload (see {@link MobileServerPublicQuerySuccessResponse}), inlining the
10
+ * payload fields alongside `status` rather than nesting them under a `data` key like the engine does; execute
11
+ * routes return it as-is because they carry no payload.
12
+ */
13
+ interface MobileServerSuccessResponse {
14
+ status: 'success';
15
+ }
16
+ /**
17
+ * Failure envelope returned by any mobile service API route. A response missing this envelope shape
18
+ * (e.g. a malformed body, or a non-JSON response) is a transport-level error, not a domain error.
19
+ */
20
+ interface MobileServerFailureResponse {
21
+ status: 'failure';
22
+ error: string;
23
+ error_code: number;
24
+ request_type: MobileServerRequestType;
25
+ }
26
+ //#endregion
27
+ //#region src/types/serverQueryTypes.d.ts
28
+ /**
29
+ * Success payloads for each signed `query`, keyed by request `type`.
30
+ */
31
+ interface MobileServerSignedQueryResponseByType {
32
+ /** Wallet subscriptions and the signing Identity's bells. */
33
+ notification_subscriptions: MobileServerNotificationSubscriptionsResponse;
34
+ /** Private notification page. */
35
+ notification_inbox_v2: MobileServerNotificationInboxV2Response;
36
+ }
37
+ /**
38
+ * Full success response for a signed `query`, with its payload inlined alongside `status`.
39
+ */
40
+ type MobileServerSignedQuerySuccessResponse<T extends MobileServerSignedQueryRequestType = MobileServerSignedQueryRequestType> = MobileServerSuccessResponse & MobileServerSignedQueryResponseByType[T];
41
+ /**
42
+ * Unsigned `public_query` request body: a `type` discriminant flattened with its params.
43
+ */
44
+ type MobileServerPublicQueryRequest<T extends MobileServerPublicQueryRequestType = MobileServerPublicQueryRequestType> = { [K in MobileServerPublicQueryRequestType]: {
45
+ type: K;
46
+ } & MobileServerPublicQueryRequestByType[K] }[T];
47
+ /**
48
+ * Payload of the `username_availability` public query success response.
49
+ */
50
+ interface MobileServerUsernameAvailabilityResponse {
51
+ username: string;
52
+ available: boolean;
53
+ }
54
+ /**
55
+ * Payload of the `avatar_presets` public query success response.
56
+ */
57
+ interface MobileServerAvatarPresetsResponse {
58
+ /** Available presets in display order. */
59
+ presets: MobileServerAvatarPreset[];
60
+ }
61
+ /**
62
+ * Payload of the `profiles` public query success response. One entry per requested subaccount, in the exact
63
+ * order they were requested, so callers can correlate positionally as well as by `subaccount`.
64
+ */
65
+ interface MobileServerProfilesResponse {
66
+ profiles: MobileServerProfile[];
67
+ }
68
+ /**
69
+ * Payload of the `search_profiles` public query success response. Matches come in ascending bytewise
70
+ * username order, an exact match first, and carry the same include-gated fields as a `profiles` entry.
71
+ */
72
+ interface MobileServerSearchProfilesResponse {
73
+ profiles: MobileServerProfile[];
74
+ /** `null` means there are no further matches. */
75
+ next_cursor: string | null;
76
+ }
77
+ /**
78
+ * Payload of the `followers` and `following` public query success responses. Both list directions share one
79
+ * shape; only the relationship that selected the rows differs.
80
+ */
81
+ interface MobileServerFollowListResponse {
82
+ accounts: MobileServerFollowListAccount[];
83
+ /** `null` means the list is complete. */
84
+ next_cursor: string | null;
85
+ }
86
+ /**
87
+ * Payload of the `feed` public query success response.
88
+ */
89
+ interface MobileServerFeedResponse {
90
+ trades: MobileServerFeedTrade[];
91
+ /**
92
+ * `null` when there was no additional candidate at query time; a page may contain fewer than `limit` trades
93
+ * (or none) with a non-null cursor because invalid enrichment rows are omitted and pagination is live
94
+ * rather than snapshot.
95
+ */
96
+ next_cursor: string | null;
97
+ }
98
+ /** Fixed-window list response; an empty page can still have a next cursor. */
99
+ interface MobileServerSocialFeedResponse {
100
+ /** Reading session and its browser credential. */
101
+ read_session: MobileServerSocialFeedReadSession;
102
+ /** Visible items in server order; deduplicate by ID without local reordering. */
103
+ items: MobileServerSocialFeedItem[];
104
+ /** Opaque cursor; null only when pagination is complete. */
105
+ next_cursor: string | null;
106
+ /** New-content baseline, not a pagination or update cursor. */
107
+ watermark: string;
108
+ }
109
+ /** Main-feed page with its ordering version. */
110
+ interface MobileServerSocialFeedRankedResponse extends MobileServerSocialFeedResponse {
111
+ /** Current ordering contract: chronological-v1. */
112
+ ranking_version: string;
113
+ }
114
+ /** Top Traders page, with one shared qualification snapshot for eligibility and badges. */
115
+ interface MobileServerSocialFeedTopTradersResponse extends MobileServerSocialFeedRankedResponse {
116
+ /** Author eligibility snapshot. */
117
+ cohort: MobileServerSocialFeedCohort;
118
+ }
119
+ /** Item details with either a new item session or the reused authorized session. */
120
+ interface MobileServerSocialFeedItemResponse {
121
+ /** Full visible item. */
122
+ item: MobileServerSocialFeedItem;
123
+ /** Session authorized for subsequent updates. */
124
+ read_session: MobileServerSocialFeedReadSession;
125
+ }
126
+ /** Batched viewport updates; apply only the current viewport's latest request sequence. */
127
+ interface MobileServerSocialFeedUpdatesResponse {
128
+ /** Item deltas, independent of current-position patches. */
129
+ item_patches: MobileServerSocialFeedItemPatch[];
130
+ /** Complete mutable position facts at one version. */
131
+ position_patches: MobileServerSocialFeedPositionPatch[];
132
+ /** Previously authorized targets that can no longer be read. */
133
+ unavailable_targets: MobileSocialFeedUnavailableTarget[];
134
+ /** New-content hint; always zero for directly created item sessions. */
135
+ new_items_count: number;
136
+ /** Baseline to use for the next update call with the same viewport. */
137
+ update_cursor: string;
138
+ /** Full snapshot of applicable mutable fields; currently always true. Apply author updates even when the item version is unchanged. */
139
+ reset: boolean;
140
+ /** Echoed viewport revision. */
141
+ viewport_revision: number;
142
+ /** Echoed request sequence. */
143
+ request_seq: number;
144
+ }
145
+ /**
146
+ * Payload of the `notification_preferences` public query success response.
147
+ */
148
+ interface MobileServerNotificationPreferencesResponse {
149
+ preferences: MobileServerNotificationPreferences;
150
+ }
151
+ /**
152
+ * Payload of the `notification_registration_v2` public query, including legacy registrations.
153
+ */
154
+ interface MobileServerNotificationRegistrationV2Response {
155
+ /** Opaque decimal string; do not convert to a JavaScript number. */
156
+ registration_generation: string;
157
+ /** Persisted capabilities of the most recent registration; legacy type/route arrays are empty. */
158
+ capabilities: MobileServerNotificationCapabilities;
159
+ }
160
+ /**
161
+ * Full settings document returned by both `notification_settings_v2` and `update_notification_settings_v2`.
162
+ */
163
+ interface MobileServerNotificationSettingsV2Response {
164
+ /** Settings schema version. */
165
+ schema_version: 2;
166
+ /** Settings revision, independent of the subscription revision. */
167
+ revision: number;
168
+ /** Full saved settings. */
169
+ settings: MobileServerNotificationSettings;
170
+ }
171
+ /**
172
+ * Payload of the `notification_subscriptions` signed query.
173
+ */
174
+ interface MobileServerNotificationSubscriptionsResponse {
175
+ /** Wallet-level subscription revision; read again after every mutation. */
176
+ revision: number;
177
+ /** Whether the one-time local favorites import has completed. */
178
+ favorites_imported: boolean;
179
+ /** Subscribed market IDs in ascending order. */
180
+ market_ids: number[];
181
+ /** Followed subaccounts with bells enabled for the signing Identity. */
182
+ trader_bells: Hex[];
183
+ }
184
+ /**
185
+ * Payload of the `notification_inbox_v2` signed query, ordered newest first.
186
+ */
187
+ interface MobileServerNotificationInboxV2Response {
188
+ /** Accepted intents owned by the signing wallet. */
189
+ notifications: MobileServerNotificationInboxItem[];
190
+ /** Pass unchanged to the next request, or null when pagination is complete. */
191
+ next_cursor: string | null;
192
+ }
193
+ /**
194
+ * Payload of the `registered_wallet` public query success response. Inlined into the envelope rather than
195
+ * nested under a key, matching the backend's `RegisteredWalletResponse`.
196
+ */
197
+ interface MobileServerRegisteredWalletResponse extends MobileServerNotificationDeviceMetadata {
198
+ wallet: Hex;
199
+ token_fingerprint_prefix: string;
200
+ last_seen_at: number;
201
+ }
202
+ /**
203
+ * Success payloads for each unsigned `public_query`, keyed by request `type`. Counterpart to
204
+ * {@link MobileServerPublicQueryRequestByType} so a query's request params and response share one lookup,
205
+ * matching engine's `EngineServerQueryResponseByType`. Holds the unwrapped payload; the envelope is applied
206
+ * by {@link MobileServerPublicQuerySuccessResponse}.
207
+ */
208
+ interface MobileServerPublicQueryResponseByType {
209
+ /** Latest saved device generation and v1/v2 capabilities. */
210
+ notification_registration_v2: MobileServerNotificationRegistrationV2Response;
211
+ /** Full settings document with its revision. */
212
+ notification_settings_v2: MobileServerNotificationSettingsV2Response;
213
+ /** Open position candidates. */
214
+ self_feed_positions: MobileServerSocialFeedPositionsResponse;
215
+ /** Position command resolution. */
216
+ resolve_feed_position: MobileServerSocialFeedPositionResolutionResponse;
217
+ /** Trusted order action resolution. */
218
+ resolve_feed_action: MobileServerSocialFeedActionResolutionResponse;
219
+ /** Parent drawing and version. */
220
+ feed_chart_drawing: MobileServerSocialFeedDrawingResponse;
221
+ /** Comment thread page. */
222
+ feed_comments: MobileServerSocialFeedCommentsResponse;
223
+ /** Full lifecycle history. */
224
+ position_history: MobileServerSocialFeedPositionHistoryResponse;
225
+ /** Most recent 500 actions, without pagination or authored content. */
226
+ position_history_all: MobileServerSocialFeedPositionHistoryResponse;
227
+ /** Published nonblank text with complete drawings. */
228
+ position_thoughts: MobileServerSocialFeedPositionThoughtsResponse;
229
+ /** Candle page and markers. */
230
+ position_chart: MobileServerSocialFeedPositionChartResponse;
231
+ /** Read-only watcher observation. */
232
+ position_watchers: MobileServerSocialFeedWatchersResponse;
233
+ /** Preset IDs and public image URLs in display order. */
234
+ avatar_presets: MobileServerAvatarPresetsResponse;
235
+ /** For You recommendations. */
236
+ for_you_feed: MobileServerSocialFeedRankedResponse;
237
+ /** Qualified authors and cohort metadata. */
238
+ top_traders_feed: MobileServerSocialFeedTopTradersResponse;
239
+ /** Public content from followed authors. */
240
+ friends_feed: MobileServerSocialFeedRankedResponse;
241
+ /** Published author content. */
242
+ profile_feed: MobileServerSocialFeedResponse;
243
+ /** Published market content. */
244
+ market_feed: MobileServerSocialFeedResponse;
245
+ /** Published position activity. */
246
+ position_feed: MobileServerSocialFeedResponse;
247
+ /** Item details and reading session. */
248
+ feed_item: MobileServerSocialFeedItemResponse;
249
+ /** Authorized viewport changes. */
250
+ feed_updates: MobileServerSocialFeedUpdatesResponse;
251
+ username_availability: MobileServerUsernameAvailabilityResponse;
252
+ profiles: MobileServerProfilesResponse;
253
+ search_profiles: MobileServerSearchProfilesResponse;
254
+ followers: MobileServerFollowListResponse;
255
+ following: MobileServerFollowListResponse;
256
+ feed: MobileServerFeedResponse;
257
+ notification_preferences: MobileServerNotificationPreferencesResponse;
258
+ registered_wallet: MobileServerRegisteredWalletResponse;
259
+ }
260
+ /**
261
+ * Full success response for an unsigned `public_query`: the {@link MobileServerSuccessResponse} envelope with
262
+ * the query's payload inlined alongside `status`. Derived from {@link MobileServerPublicQueryResponseByType},
263
+ * mirroring engine's `EngineServerQuerySuccessResponse` (inlined here instead of nested under `data`).
264
+ */
265
+ type MobileServerPublicQuerySuccessResponse<T extends MobileServerPublicQueryRequestType = MobileServerPublicQueryRequestType> = MobileServerSuccessResponse & MobileServerPublicQueryResponseByType[T];
266
+ /** Selected account's current candidates. */
267
+ interface MobileServerSocialFeedPositionsResponse {
268
+ /** Position eligibility hints. */
269
+ positions: MobileServerSocialFeedPublishablePosition[];
270
+ /** Next bound cursor, or null. */
271
+ next_cursor: string | null;
272
+ /** Observation time. */
273
+ as_of_ms: number;
274
+ }
275
+ /** Slash-command resolution, including normal empty outcomes. */
276
+ interface MobileServerSocialFeedPositionResolutionResponse {
277
+ /** Resolution status. */
278
+ resolution: MobileSocialFeedPositionResolution;
279
+ /** Resolved market, or null. */
280
+ product: MobileServerSocialFeedMarket | null;
281
+ /** Current candidates. */
282
+ candidates: MobileServerSocialFeedPublishablePosition[];
283
+ /** Explanation for empty candidates. */
284
+ reason: MobileSocialFeedPositionResolutionReason | null;
285
+ }
286
+ /** Authoritative order segments, not an inferred latest trade. */
287
+ interface MobileServerSocialFeedActionResolutionResponse {
288
+ /** Requested order. */
289
+ order_digest: Hex;
290
+ /** Pending until all confirmed segments are projected. */
291
+ resolution: MobileSocialFeedActionResolution;
292
+ /** Trusted actions, empty when pending. */
293
+ actions: MobileServerSocialFeedActionCandidate[];
294
+ /** Observation time. */
295
+ as_of_ms: number;
296
+ }
297
+ /** Drawing read result; a readable parent without a drawing succeeds with null. */
298
+ interface MobileServerSocialFeedDrawingResponse {
299
+ /** Parent UUID. */
300
+ item_id: string;
301
+ /** Display version. */
302
+ item_version: string;
303
+ /** Parsed drawing, or null. */
304
+ drawing: MobileServerSocialFeedDrawing | null;
305
+ }
306
+ /** Comment thread, including bidirectional pagination around an optional anchor. */
307
+ interface MobileServerSocialFeedCommentsResponse {
308
+ /** Top-level comments, newest first, each with all readable descendants in the snapshot. */
309
+ comments: MobileServerSocialFeedCommentGroup[];
310
+ /** All readable replies across the thread snapshot, including descendants. */
311
+ total_count: number;
312
+ /** All readable top-level comments across the thread snapshot. */
313
+ top_level_count: number;
314
+ /** Forward cursor. */
315
+ next_cursor: string | null;
316
+ /** Backward cursor. */
317
+ previous_cursor: string | null;
318
+ /** Requested anchor, or null. */
319
+ anchor_reply_id: string | null;
320
+ /** Original or new session. */
321
+ read_session: MobileServerSocialFeedReadSession;
322
+ }
323
+ /** Full position history with additional metrics and trusted trading hints. */
324
+ interface MobileServerSocialFeedPositionHistoryResponse {
325
+ /** Current position owner. */
326
+ owner: MobileServerSocialFeedAuthor;
327
+ /** Current or frozen position and history metrics. */
328
+ position: MobileServerSocialFeedPositionHistoryCard;
329
+ /** Counts across the authorized history. */
330
+ summary: MobileServerSocialFeedHistorySummary;
331
+ /** Ordered action and take entries. */
332
+ timeline: MobileServerSocialFeedTimelineEntry[];
333
+ /** Next history cursor. */
334
+ next_cursor: string | null;
335
+ /** History completeness. */
336
+ history_quality: MobileSocialFeedHistoryQuality;
337
+ /** Position-mode session. */
338
+ read_session: MobileServerSocialFeedReadSession;
339
+ /** Viewing-account state, not authentication. */
340
+ trading_context: MobileServerSocialFeedTradingContext;
341
+ }
342
+ /** Candles and actions, with separate estimated risk-price line. */
343
+ interface MobileServerSocialFeedPositionChartResponse {
344
+ /** Descending candle page. */
345
+ candles: MobileServerSocialFeedCandle[];
346
+ /** Action markers with explicit price bases. */
347
+ action_markers: MobileServerSocialFeedActionMarker[];
348
+ /** Estimated line, if applicable and available. */
349
+ estimated_liquidation_line: MobileServerSocialFeedEstimatedLiquidationLine | null;
350
+ /** Exclusive next-page bound. */
351
+ next_before_ms: number | null;
352
+ /** Observation time. */
353
+ as_of_ms: number;
354
+ /** Overall source quality. */
355
+ data_quality: MobileSocialFeedChartDataQuality;
356
+ }
357
+ /** Read-only watcher observation; account previews are self-reported. */
358
+ interface MobileServerSocialFeedWatchersResponse {
359
+ /** Distinct active browsing credentials. */
360
+ watcher_count: number;
361
+ /** Deduplicated public account previews. */
362
+ watcher_preview: MobileServerSocialFeedAuthor[];
363
+ /** Observation time. */
364
+ as_of_ms: number;
365
+ }
366
+ /** Published position thought with nonblank text and a complete saved drawing. */
367
+ type MobileServerSocialFeedPositionThought = MobileServerSocialFeedHistoryTake & {
368
+ /** Always true for this endpoint; uploaded or external images alone do not qualify. */has_analysis: true; /** Parsed current drawing; saved data does not necessarily contain visible strokes. */
369
+ drawing: MobileServerSocialFeedDrawing;
370
+ };
371
+ /** Thoughts in descending drawing creation time and item UUID order; no 500-item total cap. */
372
+ interface MobileServerSocialFeedPositionThoughtsResponse {
373
+ /** Complete content in server order; never reorder by display time. */
374
+ items: MobileServerSocialFeedPositionThought[];
375
+ /** Null only at the directory end; an empty page can still have a cursor. */
376
+ next_cursor: string | null;
377
+ /** Independent position session; newly published content requires a refresh. */
378
+ read_session: MobileServerSocialFeedReadSession;
379
+ }
380
+ //#endregion
381
+ //#region src/types/serverRequestTypes.d.ts
382
+ /**
383
+ * Common wire-format credential for token-authenticated notification requests.
384
+ * Unregistration also accepts an inactive or unknown well-formed token.
385
+ */
386
+ interface MobileServerWithExpoTokenParams {
387
+ /** Expo push token; never expose it to another user. */
388
+ expo_token: string;
389
+ }
390
+ /**
391
+ * Registration fields shared by v1 and v2 signed inner payloads.
392
+ * Nullable metadata keys remain present when signing so the MessagePack hash matches the backend.
393
+ */
394
+ interface MobileServerRegisterExpoTokenParams extends MobileServerWithExpoTokenParams, MobileServerNotificationDeviceMetadata {}
395
+ /** Registration request with a v2-only capability declaration. */
396
+ interface MobileServerRegisterExpoTokenV2Params extends MobileServerRegisterExpoTokenParams {
397
+ /** Actual notification features supported by the device. */
398
+ capabilities: {
399
+ /** Registration accepts only the v2 protocol. */payload_versions: [2]; /** Supported notification types. */
400
+ type_ids: MobileNotificationTypeId[]; /** Supported navigation destinations. */
401
+ routes: MobileNotificationRouteName[];
402
+ };
403
+ }
404
+ /**
405
+ * One subscription operation; exactly one operation is non-null and unused operations must be null.
406
+ */
407
+ interface MobileServerNotificationSubscriptionsUpdate {
408
+ /** Latest subscription revision, not the settings revision. */
409
+ expected_revision: number;
410
+ /** Set one bell; enabling requires an existing follow relationship. */
411
+ trader_bell: {
412
+ /** Target non-isolated subaccount belonging to another wallet. */subaccount: Hex; /** Desired bell state. */
413
+ enabled: boolean;
414
+ } | null;
415
+ /** Subscribe or unsubscribe one known market. */
416
+ market: {
417
+ /** Positive market product ID. */product_id: number; /** Desired subscription state. */
418
+ subscribed: boolean;
419
+ } | null;
420
+ /** One-time merge of up to 500 local market IDs; mutually exclusive with the other operations. */
421
+ import_markets: number[] | null;
422
+ }
423
+ /**
424
+ * Opt-in extras for a `profiles` query. Each one costs extra rate-limit weight per profile and adds fields
425
+ * that are otherwise absent from the response, so the backend gates them behind an explicit request rather
426
+ * than always resolving the follow graph on a public route.
427
+ */
428
+ interface MobileServerProfilesInclude {
429
+ /** Adds `follower_count` and `following_count` to every entry. Omitted or `false` leaves both absent. */
430
+ follow_counts?: boolean;
431
+ /**
432
+ * Adds `follow_summary` to every entry, relative to the `view_as` subaccount. As on every public route,
433
+ * `view_as` is an unauthenticated claim.
434
+ */
435
+ follow_summary?: {
436
+ view_as: Hex;
437
+ };
438
+ }
439
+ /**
440
+ * Params shared by the `followers` and `following` public queries: only the relationship that selects the
441
+ * rows differs between the two.
442
+ */
443
+ interface MobileServerFollowListRequest {
444
+ /** The viewed Profile, i.e. the account whose Followers or Following are being listed. */
445
+ subaccount: Hex;
446
+ /**
447
+ * Viewer perspective the rows are resolved against. Omitted asks for no perspective, which drops
448
+ * `is_following` from every row and falls back to plain recency order. Like the `profiles` query's
449
+ * `view_as`, this is an unauthenticated claim on an unsigned route.
450
+ */
451
+ view_as?: Hex;
452
+ /** Opaque keyset cursor from a prior page's `next_cursor`. Omitted requests the first page. */
453
+ cursor?: string;
454
+ /** Page size, 1–50; the backend defaults to 25 when omitted. */
455
+ limit?: number;
456
+ }
457
+ /**
458
+ * Params of the `search_profiles` public query.
459
+ */
460
+ interface MobileServerSearchProfilesRequest {
461
+ /**
462
+ * Username prefix, 1-20 ASCII bytes: a letter or digit first, then letters, digits, `_` or `.`. The
463
+ * backend lowercases letters and trims nothing.
464
+ */
465
+ query: string;
466
+ /** Same opt-in extras as the `profiles` query, applied to every match on the page. */
467
+ include?: MobileServerProfilesInclude;
468
+ /** Opaque keyset cursor from a prior page's `next_cursor`. Omitted requests the first page. */
469
+ cursor?: string;
470
+ /** Page size, 1-50, or 1-25 when `include` asks for follow data; the backend defaults to 25 when omitted. */
471
+ limit?: number;
472
+ }
473
+ /** Common filters and pagination for social feed lists. */
474
+ interface MobileServerSocialFeedListParams {
475
+ /** OR-ed content filters; combined with other filters using AND. */
476
+ feed_types?: MobileSocialFeedType[];
477
+ /** Strict lower bound in whole dollars, 1 through Number.MAX_SAFE_INTEGER. */
478
+ minimum_notional?: number;
479
+ /** Page size, 1–50; defaults to 20. */
480
+ limit?: number;
481
+ /** Original reading session; required with cursor. Legitimate requests renew its idle expiration. */
482
+ session_id?: string;
483
+ /** Opaque pagination cursor, distinct from update_cursor and watermark. */
484
+ cursor?: string;
485
+ }
486
+ /** List fields for main feeds and author feeds. */
487
+ interface MobileServerSocialFeedCategorizedParams extends MobileServerSocialFeedListParams {
488
+ /** Omit to read all market categories. */
489
+ market_category?: MobileSocialFeedMarketCategory;
490
+ }
491
+ /** Unsigned browsing context; the viewing account is not proof of wallet ownership. */
492
+ interface MobileServerSocialFeedReadParams {
493
+ /**
494
+ * Complete non-isolated viewing account. Profile, position, and item reads include this account's
495
+ * own hidden content under account_view, in addition to resolving relationship state.
496
+ */
497
+ view_as?: Hex;
498
+ /** Original browsing credential when reusing a session. */
499
+ viewer_token?: string;
500
+ }
501
+ /**
502
+ * Params for each unsigned `public_query`, keyed by request `type`.
503
+ */
504
+ interface MobileServerPublicQueryRequestByType {
505
+ /** Selected account's open position candidates. */
506
+ self_feed_positions: {
507
+ /** Full identity. */view_as: Hex; /** Market filter. */
508
+ product_id?: number; /** Bound pagination cursor. */
509
+ cursor?: string; /** Page size, 1-50. */
510
+ limit?: number;
511
+ };
512
+ /** Resolve a position command without signing. */
513
+ resolve_feed_position: {
514
+ /** Full identity. */view_as: Hex; /** Unmodified command text. */
515
+ input: string; /** Optional market disambiguation. */
516
+ product_id?: number;
517
+ };
518
+ /** Resolve an order's complete trusted lifecycle segments. */
519
+ resolve_feed_action: {
520
+ /** Order-owning identity. */view_as: Hex; /** Trading order digest. */
521
+ order_digest: Hex;
522
+ };
523
+ /** Read a drawing within the parent item's visibility. */
524
+ feed_chart_drawing: MobileServerSocialFeedReadParams & {
525
+ /** Parent UUID. */item_id: string; /** Original session, paired with viewer_token. */
526
+ session_id?: string;
527
+ };
528
+ /** Read or navigate a comment thread. */
529
+ feed_comments: MobileServerSocialFeedReadParams & {
530
+ /** Root UUID. */root_item_id: string; /** Thread cursor. */
531
+ cursor?: string; /** Top-level group count, 1-50; descendants do not consume the limit. */
532
+ limit?: number; /** Anchor at any depth selecting its top-level group; mutually exclusive with cursor. */
533
+ anchor_reply_id?: string; /** Original reading session. */
534
+ session_id?: string;
535
+ };
536
+ /** Full lifecycle history rather than published feed items alone. */
537
+ position_history: MobileServerSocialFeedReadParams & {
538
+ /** Lifecycle UUID. */position_id: string; /** Filter to published takes. */
539
+ takes_only?: boolean; /** History cursor. */
540
+ cursor?: string; /** Page size, 1-50. */
541
+ limit?: number; /** Original position-mode session. */
542
+ session_id?: string;
543
+ };
544
+ /** Recent actions only, capped at 500; creates a new session and does not paginate. */
545
+ position_history_all: MobileServerSocialFeedReadParams & {
546
+ /** Lifecycle UUID. */position_id: string;
547
+ };
548
+ /** Published nonblank text with a saved drawing, newest first by drawing creation time. */
549
+ position_thoughts: MobileServerSocialFeedReadParams & {
550
+ /** Lifecycle UUID. */position_id: string; /** Page size, 1-50; defaults to 20 and must remain unchanged across pages. */
551
+ limit?: number; /** Original thoughts session; cannot be reused from history or feed queries. */
552
+ session_id?: string; /** Previous next_cursor; requires the original session and viewer_token. */
553
+ cursor?: string;
554
+ };
555
+ /** Market candles and independently priced action markers. */
556
+ position_chart: MobileServerSocialFeedReadParams & {
557
+ /** Lifecycle UUID. */position_id: string; /** Original session, paired with viewer_token. */
558
+ session_id?: string; /** Candle interval. */
559
+ interval: MobileSocialFeedChartInterval; /** Half-open time interval. */
560
+ range: MobileServerSocialFeedChartRange; /** Exclusive next-page bound. */
561
+ before_ms?: number; /** Page size, 1-500. */
562
+ limit?: number;
563
+ };
564
+ /** Watcher query; does not register presence. */
565
+ position_watchers: {
566
+ /** Lifecycle UUID. */position_id: string; /** Relationship perspective only. */
567
+ view_as?: Hex;
568
+ };
569
+ /** Ordered server-owned avatar catalogue. */
570
+ avatar_presets: Record<never, never>;
571
+ /** Public recommendations with optional relationship perspective. */
572
+ for_you_feed: MobileServerSocialFeedCategorizedParams & MobileServerSocialFeedReadParams;
573
+ /** Public content from qualified authors. */
574
+ top_traders_feed: MobileServerSocialFeedCategorizedParams & MobileServerSocialFeedReadParams;
575
+ /** Public content from authors followed by view_as. */
576
+ friends_feed: MobileServerSocialFeedCategorizedParams & MobileServerSocialFeedReadParams & {
577
+ /** Complete non-isolated identity subaccount; required on every request. */view_as: Hex;
578
+ };
579
+ /** Author content visible to view_as; the target is separate from the viewing account. */
580
+ profile_feed: MobileServerSocialFeedCategorizedParams & MobileServerSocialFeedReadParams & {
581
+ /** Target author identity, independent of view_as. */subaccount: Hex;
582
+ };
583
+ /** Public market content. */
584
+ market_feed: MobileServerSocialFeedListParams & MobileServerSocialFeedReadParams & {
585
+ /** Target product. */product_id: number;
586
+ };
587
+ /** Published activity in one lifecycle, including hidden content owned by view_as. */
588
+ position_feed: MobileServerSocialFeedListParams & MobileServerSocialFeedReadParams & {
589
+ /** Target position UUID. */position_id: string;
590
+ };
591
+ /** Item details visible to view_as, optionally reusing a reading session. */
592
+ feed_item: MobileServerSocialFeedReadParams & {
593
+ /** Target item UUID. */item_id: string; /** Preview size, 0-3. */
594
+ comment_preview_limit?: number; /** Omit to create a new reading session. */
595
+ session_id?: string;
596
+ };
597
+ /** Updates inherit the original public session's viewing account. */
598
+ feed_updates: {
599
+ /** Original reading session. */session_id: string; /** Previously delivered item UUIDs. */
600
+ visible_item_ids: string[]; /** Authorized position UUIDs. */
601
+ visible_position_ids: string[]; /** Baseline from the last accepted update. */
602
+ update_cursor?: string | null; /** Current viewport version. */
603
+ viewport_revision: number; /** Request sequence increasing across the entire session, including viewport changes. */
604
+ request_seq: number; /** Original public browsing credential. */
605
+ viewer_token: string; /** The viewing account cannot be changed by an update. */
606
+ view_as?: never;
607
+ };
608
+ username_availability: {
609
+ display_name: string;
610
+ };
611
+ profiles: {
612
+ /**
613
+ * 1–`MOBILE_PROFILES_MAX_BATCH_SIZE` (25) distinct subaccounts. Results come back in this exact order,
614
+ * one entry per request slot.
615
+ */
616
+ subaccounts: Hex[];
617
+ include?: MobileServerProfilesInclude;
618
+ };
619
+ search_profiles: MobileServerSearchProfilesRequest;
620
+ followers: MobileServerFollowListRequest;
621
+ following: MobileServerFollowListRequest;
622
+ feed: {
623
+ /**
624
+ * Minimum notional as a whole-dollar JSON integer (NOT an x18 string), at least $1,000. Omitted or
625
+ * `null` means unfiltered.
626
+ */
627
+ minimum_notional?: number; /** Page size, 1–50; the backend defaults to `MOBILE_FEED_MAX_PAGE_SIZE` (50) when omitted. */
628
+ limit?: number;
629
+ /**
630
+ * Opaque keyset cursor from a prior page's `next_cursor`. Bound to the exact `minimum_notional` it was
631
+ * issued for (including the unfiltered state) — reusing it with a different filter fails.
632
+ */
633
+ cursor?: string;
634
+ };
635
+ notification_preferences: MobileServerWithExpoTokenParams;
636
+ /** Persisted device generation and capabilities. */
637
+ notification_registration_v2: MobileServerWithExpoTokenParams;
638
+ /** Versioned notification settings. */
639
+ notification_settings_v2: MobileServerWithExpoTokenParams;
640
+ registered_wallet: MobileServerWithExpoTokenParams;
641
+ }
642
+ /**
643
+ * Discriminant `type` values for unsigned `public_query` requests.
644
+ */
645
+ type MobileServerPublicQueryRequestType = keyof MobileServerPublicQueryRequestByType;
646
+ /**
647
+ * Params for each unsigned `public_execute`, keyed by request `type`. No signature, sender, or nonce is sent.
648
+ * `record_feed_views` and `position_presence` are authorized by the original reading session (`session_id`)
649
+ * and browser credential (`viewer_token`), not an Expo push token.
650
+ * For `unregister_expo_token` and `update_preferences`, possession of an active Expo push token authorizes
651
+ * the notification mutation: the backend resolves the token's owning wallet and mutates its state. These
652
+ * notification writes use the backend's last-write-wins commit order, so callers must serialize them.
653
+ */
654
+ interface MobileServerPublicExecuteRequestByType {
655
+ /** Full settings replacement with optimistic concurrency control. */
656
+ update_notification_settings_v2: MobileServerWithExpoTokenParams & {
657
+ /** Latest settings revision. */expected_revision: number; /** Complete settings document. */
658
+ settings: MobileServerNotificationSettings;
659
+ };
660
+ /** Independent unsigned batch view report; repeat requests increment again. */
661
+ record_feed_views: {
662
+ /** 1–50 canonical lowercase item UUIDs before deduplication; duplicates count once in this request. */item_ids: string[];
663
+ };
664
+ /** Per-page visitor lease; no wallet signature. */
665
+ position_presence: {
666
+ /** Lifecycle UUID. */position_id: string; /** Original reading session. */
667
+ session_id: string; /** Page-scoped UUID. */
668
+ view_session_id: string; /** Lease lifecycle state. */
669
+ state: MobileSocialFeedPresenceState; /** Original browsing credential. */
670
+ viewer_token: string; /** Omission preserves the display account; null clears it. */
671
+ watcher_subaccount?: Hex | null;
672
+ };
673
+ unregister_expo_token: {
674
+ expo_token: string;
675
+ };
676
+ update_preferences: {
677
+ expo_token: string;
678
+ preferences: MobileServerNotificationPreferences;
679
+ };
680
+ }
681
+ /**
682
+ * Discriminant `type` values for unsigned `public_execute` requests.
683
+ */
684
+ type MobileServerPublicExecuteRequestType = keyof MobileServerPublicExecuteRequestByType;
685
+ /**
686
+ * Discriminant `type` values for signed `execute` requests, excluding signed queries. Unlike the public
687
+ * queries these carry no separate params map — a signed request body is its inner payload flattened with the envelope, so
688
+ * {@link MobileSignedInner} is the single source of truth for both the fields and their significant order.
689
+ */
690
+ type MobileServerExecuteRequestType = Exclude<MobileSignedInner['type'], MobileServerSignedQueryRequestType>;
691
+ /**
692
+ * Discriminant `type` values for signed `query` requests, distinct from unsigned `public_query` requests.
693
+ */
694
+ type MobileServerSignedQueryRequestType = keyof MobileServerSignedQueryResponseByType;
695
+ /**
696
+ * Wire `request_type` the backend echoes on failure envelopes, prefixed by the route that produced it:
697
+ * `public_query_*` for unsigned queries, `public_execute_*` for unsigned writes, and `execute_*` for signed
698
+ * writes (e.g. `execute_set_username`), or `query_*` for signed reads. Unlike the EIP-712 method,
699
+ * these values never carry the `mobile:` prefix. Protected image reads use `feed_image` or
700
+ * `feed_comment_image` without a route prefix; malformed multipart uploads use `execute_image_upload`.
701
+ */
702
+ type MobileServerRequestType = 'feed_image' | 'feed_comment_image' | 'execute_image_upload' | `query_${MobileServerSignedQueryRequestType}` | `public_query_${MobileServerPublicQueryRequestType}` | `public_execute_${MobileServerPublicExecuteRequestType}` | `execute_${MobileServerExecuteRequestType}`;
703
+ //#endregion
704
+ //#region src/signing/types.d.ts
705
+ /**
706
+ * Unsigned inner payloads that can be authenticated against the mobile service API.
707
+ *
708
+ * Key order is significant: the payload hash is `keccak256(msgpack(inner))`, and msgpack encodes object keys
709
+ * in insertion order, so every field of every sub-type must be serialized in the exact order the backend
710
+ * declares its structs — `type` first, then the remaining fields — or the hash won't match and signature
711
+ * verification fails. This type only describes the shape; the authoritative runtime key order is enforced by
712
+ * {@link canonicalizeMobileInner}, which is the source of truth. Keep the field order here in sync with it.
713
+ *
714
+ * Every bytes32 field must be lowercase hex. The backend decodes them case-insensitively but hashes its own
715
+ * re-serialization, which is always lowercase, so a mixed-case value is accepted on the wire and then fails
716
+ * authentication against a hash the client never reproduced. Build them with `subaccountToHex`, which
717
+ * lowercases; unlike bytes32, string fields such as `display_name` are hashed as-is and keep their casing.
718
+ */
719
+ type MobileSignedInner = ({
720
+ /** Capability-aware device registration. */type: 'register_expo_token_v2';
721
+ } & MobileServerRegisterExpoTokenV2Params) | {
722
+ /** Signed query for wallet markets and Identity bells. */type: 'notification_subscriptions';
723
+ } | ({
724
+ /** One revision-guarded subscription operation. */type: 'update_notification_subscriptions';
725
+ } & MobileServerNotificationSubscriptionsUpdate) | {
726
+ /** Signed query for the wallet's private notification page. */type: 'notification_inbox_v2'; /** Previous page cursor, or nil for the first page. */
727
+ cursor: string | null; /** Page size, or nil for the server default. */
728
+ limit: number | null;
729
+ } | {
730
+ /** Atomic product analytics batch. */type: 'record_product_events'; /** Events in caller order. */
731
+ events: MobileServerProductEvent[];
732
+ } | {
733
+ /** Atomic post publication. */type: 'create_feed_post'; /** Author-scoped idempotency UUID. */
734
+ client_request_id: string; /** Owned position UUID. */
735
+ position_id: string; /** Optional trusted action UUID, omitted rather than encoded as nil. */
736
+ action_id?: string; /** Unmodified original text. */
737
+ text: string; /** Ordered mentions into the original text. */
738
+ mentions: MobileSocialFeedMention[]; /** Original JSON text; omitted when absent. */
739
+ drawing_data_json?: string; /** Ordered ready image UUIDs; omitted when absent. */
740
+ image_ids?: string[]; /** Up to ten original HTTP/HTTPS URLs in order; omission differs from an empty array. */
741
+ image_urls?: string[];
742
+ } | {
743
+ /** Atomic comment publication. */type: 'create_feed_comment'; /** Author-scoped idempotency UUID. */
744
+ client_request_id: string; /** Root UUID. */
745
+ root_item_id: string; /** Optional same-thread reply UUID. */
746
+ reply_to_item_id?: string; /** Unmodified original text. */
747
+ text: string; /** Ordered mentions. */
748
+ mentions: MobileSocialFeedMention[]; /** Optional owned position UUID. */
749
+ attached_position_id?: string; /** Ordered ready image UUIDs; omitted when absent. */
750
+ image_ids?: string[]; /** Up to ten original HTTP/HTTPS URLs in order; omission differs from an empty array. */
751
+ image_urls?: string[];
752
+ } | {
753
+ /** Direct multipart post-image upload; content_hash is Keccak256 of the raw file bytes. */type: 'create_feed_post_image_uploads'; /** `0x`-prefixed lowercase Keccak256 of the original file bytes. */
754
+ content_hash: Hex;
755
+ } | {
756
+ /** Direct multipart comment-image upload; content_hash is Keccak256 of the raw file bytes. */type: 'create_feed_comment_image_uploads'; /** `0x`-prefixed lowercase Keccak256 of the original file bytes. */
757
+ content_hash: Hex;
758
+ } | {
759
+ /** First attachment. */type: 'create_feed_chart_drawing'; /** Parent UUID. */
760
+ item_id: string; /** Original JSON text, not parsed or reformatted before hashing. */
761
+ data_json: string;
762
+ } | {
763
+ /** Full replacement of an existing drawing. */type: 'update_feed_chart_drawing'; /** Parent UUID. */
764
+ item_id: string; /** Original JSON text. */
765
+ data_json: string;
766
+ } | {
767
+ /** Idempotent relationship mutation. */type: 'set_feed_like'; /** Item UUID. */
768
+ item_id: string; /** Desired relationship state. */
769
+ is_liked: boolean;
770
+ } | {
771
+ type: 'set_bio';
772
+ bio: string;
773
+ } | {
774
+ type: 'create_avatar_upload';
775
+ content_length: number;
776
+ } | {
777
+ type: 'set_avatar';
778
+ avatar: MobileServerAvatarSelection | null;
779
+ } | {
780
+ type: 'set_username';
781
+ display_name: string;
782
+ } | {
783
+ type: 'set_private_mode';
784
+ private_mode: boolean;
785
+ } | ({
786
+ /** Legacy device registration without a capability declaration. */type: 'register_expo_token';
787
+ } & MobileServerRegisterExpoTokenParams) | {
788
+ type: 'set_follow';
789
+ subaccount: Hex; /** `true` follows the target, `false` unfollows it. Both directions are idempotent. */
790
+ is_following: boolean;
791
+ } | {
792
+ type: 'set_follow_batch'; /** Distinct targets in request order; the response keeps this order. */
793
+ subaccounts: Hex[]; /** `true` follows every target, `false` unfollows every target. Both directions are idempotent. */
794
+ is_following: boolean;
795
+ };
796
+ /**
797
+ * The single {@link MobileSignedInner} member carrying the given `type` tag.
798
+ */
799
+ type MobileSignedInnerByType<T extends MobileSignedInner['type']> = Extract<MobileSignedInner, {
800
+ type: T;
801
+ }>;
802
+ /**
803
+ * Type-specific payload fields for a signed inner request of a given `type` (the inner payload without its
804
+ * `type` tag). Derived from {@link MobileSignedInner} so the two never drift apart.
805
+ */
806
+ type MobileSignedInnerParams<T extends MobileSignedInner['type']> = Omit<MobileSignedInnerByType<T>, 'type'>;
807
+ /**
808
+ * A signed mobile service API request body: the inner payload flattened with its signature, sender, and
809
+ * nonce (unlike the engine client, which wraps params under a `{ [type]: params }` key).
810
+ */
811
+ type MobileSignedRequest<T extends MobileSignedInner = MobileSignedInner> = T & {
812
+ signature: Hex;
813
+ sender: Hex;
814
+ nonce: string;
815
+ };
816
+ /**
817
+ * Params for {@link buildSignedMobileRequest}.
818
+ */
819
+ interface BuildSignedMobileRequestParams extends MobileSignedRequestParams {
820
+ walletClient: WalletClientWithAccount;
821
+ inner: MobileSignedInner;
822
+ }
823
+ //#endregion
824
+ export { MobileServerSocialFeedWatchersResponse as $, MobileServerNotificationSubscriptionsResponse as A, MobileServerSocialFeedCommentsResponse as B, MobileServerAvatarPresetsResponse as C, MobileServerNotificationPreferencesResponse as D, MobileServerNotificationInboxV2Response as E, MobileServerRegisteredWalletResponse as F, MobileServerSocialFeedPositionResolutionResponse as G, MobileServerSocialFeedItemResponse as H, MobileServerSearchProfilesResponse as I, MobileServerSocialFeedPositionsResponse as J, MobileServerSocialFeedPositionThought as K, MobileServerSignedQueryResponseByType as L, MobileServerPublicQueryRequest as M, MobileServerPublicQueryResponseByType as N, MobileServerNotificationRegistrationV2Response as O, MobileServerPublicQuerySuccessResponse as P, MobileServerSocialFeedUpdatesResponse as Q, MobileServerSignedQuerySuccessResponse as R, MobileServerWithExpoTokenParams as S, MobileServerFollowListResponse as T, MobileServerSocialFeedPositionChartResponse as U, MobileServerSocialFeedDrawingResponse as V, MobileServerSocialFeedPositionHistoryResponse as W, MobileServerSocialFeedResponse as X, MobileServerSocialFeedRankedResponse as Y, MobileServerSocialFeedTopTradersResponse as Z, MobileServerSearchProfilesRequest as _, MobileSignedRequest as a, MobileServerSocialFeedListParams as b, MobileServerNotificationSubscriptionsUpdate as c, MobileServerPublicExecuteRequestType as d, MobileServerUsernameAvailabilityResponse as et, MobileServerPublicQueryRequestByType as f, MobileServerRequestType as g, MobileServerRegisterExpoTokenV2Params as h, MobileSignedInnerParams as i, MobileServerProfilesResponse as j, MobileServerNotificationSettingsV2Response as k, MobileServerProfilesInclude as l, MobileServerRegisterExpoTokenParams as m, MobileSignedInner as n, MobileServerSuccessResponse as nt, MobileServerExecuteRequestType as o, MobileServerPublicQueryRequestType as p, MobileServerSocialFeedPositionThoughtsResponse as q, MobileSignedInnerByType as r, MobileServerFollowListRequest as s, BuildSignedMobileRequestParams as t, MobileServerFailureResponse as tt, MobileServerPublicExecuteRequestByType as u, MobileServerSignedQueryRequestType as v, MobileServerFeedResponse as w, MobileServerSocialFeedReadParams as x, MobileServerSocialFeedCategorizedParams as y, MobileServerSocialFeedActionResolutionResponse as z };
825
+ //# sourceMappingURL=types-CByl_NyJ.d.ts.map