@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
@@ -6,7 +6,11 @@ import {
6
6
  MobileFeedTradePosition,
7
7
  MobileFeedTradePositionDirection,
8
8
  MobileNotificationCategory,
9
+ MobileNotificationMinTradeSizeUsd,
9
10
  MobileNotificationPlatform,
11
+ MobileNotificationPositionThreshold,
12
+ MobileNotificationRouteName,
13
+ MobileNotificationTypeId,
10
14
  MobileSocialFeedAction,
11
15
  MobileSocialFeedActionPriceBasis,
12
16
  MobileSocialFeedActionResolution,
@@ -300,6 +304,212 @@ export interface MobileRegisteredWallet {
300
304
  lastSeenAt: number;
301
305
  }
302
306
 
307
+ /** Device capabilities declared when registering a v2 device. */
308
+ export interface MobileNotificationCapabilities {
309
+ /** Registration accepts only the v2 protocol. */
310
+ payloadVersions: [2];
311
+ /** Notification types the device can handle. */
312
+ typeIds: MobileNotificationTypeId[];
313
+ /** Supported named navigation destinations. */
314
+ routes: MobileNotificationRouteName[];
315
+ }
316
+
317
+ /** Latest device generation and saved capabilities, including legacy registrations. */
318
+ export interface MobileNotificationRegistrationV2 {
319
+ /** Opaque generation string; do not convert to a JavaScript number. */
320
+ registrationGeneration: string;
321
+ /** Legacy registrations have empty type and route lists. */
322
+ capabilities: {
323
+ /** The single saved protocol version. */
324
+ payloadVersions: [1] | [2];
325
+ /** Supported notification types. */
326
+ typeIds: MobileNotificationTypeId[];
327
+ /** Supported navigation destinations. */
328
+ routes: MobileNotificationRouteName[];
329
+ };
330
+ }
331
+
332
+ /** Complete wallet-level notification settings; every field is required on replacement. */
333
+ export interface MobileNotificationSettings {
334
+ /** Own position milestones and the initial weekly digest. */
335
+ myPositions: boolean;
336
+ /** Unique milestone thresholds; the minimum selects the starting tier. */
337
+ positionThresholds: MobileNotificationPositionThreshold[];
338
+ /** Combined order fill/update switch; does not control liquidation notifications. */
339
+ myOrders: boolean;
340
+ /** Ordinary followed-trader notifications; enabled bells override this switch. */
341
+ followingTrades: boolean;
342
+ /** Notifications about posts by followed traders. */
343
+ followingPosts: boolean;
344
+ /** Minimum trade size for trade notifications, in whole USD. */
345
+ minTradeSizeUsd: MobileNotificationMinTradeSizeUsd;
346
+ /** New followers and follow-backs. */
347
+ newFollowers: boolean;
348
+ /** Maps to the legacy announcement preference. */
349
+ announcements: boolean;
350
+ /** Opt-in trader streak and account drama discovery notifications. */
351
+ discovery: boolean;
352
+ }
353
+
354
+ /** Versioned settings document returned by v2 reads and writes. */
355
+ export interface MobileNotificationSettingsV2 {
356
+ /** Settings schema version. */
357
+ schemaVersion: 2;
358
+ /** Settings revision, independent of subscription revisions. */
359
+ revision: number;
360
+ /** Full saved settings. */
361
+ settings: MobileNotificationSettings;
362
+ }
363
+
364
+ /** Wallet market subscriptions and the signing Identity's enabled trader bells. */
365
+ export interface MobileNotificationSubscriptions {
366
+ /** Wallet-level subscription revision; refresh after every mutation. */
367
+ revision: number;
368
+ /** Whether the one-time local favorites import has completed. */
369
+ favoritesImported: boolean;
370
+ /** Subscribed market IDs in ascending order. */
371
+ marketIds: number[];
372
+ /** Followed subaccounts with enabled bells, encoded as bytes32. */
373
+ traderBells: Hex[];
374
+ }
375
+
376
+ /** Exactly one revision-guarded subscription operation; the SDK fills unused wire fields with null. */
377
+ export type MobileNotificationSubscriptionsUpdate = {
378
+ /** Latest subscription revision, not the settings revision. */
379
+ expectedRevision: number;
380
+ } & (
381
+ | {
382
+ /** Set a bell; enabling requires an existing follow relationship. */
383
+ traderBell: {
384
+ /** Target non-isolated subaccount belonging to another wallet. */
385
+ subaccount: Subaccount;
386
+ /** Desired bell state. */
387
+ enabled: boolean;
388
+ };
389
+ /** Cannot be combined with a trader bell operation. */
390
+ market?: never;
391
+ /** Cannot be combined with a trader bell operation. */
392
+ importMarkets?: never;
393
+ }
394
+ | {
395
+ /** Subscribe or unsubscribe one known market. */
396
+ market: {
397
+ /** Positive product ID. */
398
+ productId: number;
399
+ /** Desired subscription state. */
400
+ subscribed: boolean;
401
+ };
402
+ /** Cannot be combined with a market operation. */
403
+ traderBell?: never;
404
+ /** Cannot be combined with a market operation. */
405
+ importMarkets?: never;
406
+ }
407
+ | {
408
+ /** One-time merge of up to 500 local market IDs. */
409
+ importMarkets: number[];
410
+ /** Cannot be combined with an import operation. */
411
+ traderBell?: never;
412
+ /** Cannot be combined with an import operation. */
413
+ market?: never;
414
+ }
415
+ );
416
+
417
+ /** Allowlisted notification destination; never interpret it as an arbitrary URL. */
418
+ export type MobileNotificationRoute =
419
+ | {
420
+ /** Public profile destination. */
421
+ name: 'profile';
422
+ /** Profile subaccount as bytes32. */
423
+ subaccount: Hex;
424
+ }
425
+ | {
426
+ /** Market destination. */
427
+ name: 'market';
428
+ /** Positive product ID. */
429
+ productId: number;
430
+ }
431
+ | {
432
+ /** Own portfolio destination. */
433
+ name: 'portfolio';
434
+ };
435
+
436
+ /** V2 push/inbox navigation data, not a complete historical trade or notification body. */
437
+ export interface MobileNotificationPayloadV2 {
438
+ /** Payload protocol version. */
439
+ payloadVersion: 2;
440
+ /** Logical notification UUID for click deduplication. */
441
+ notificationId: string;
442
+ /** Intended wallet; private navigation must wait for this wallet to connect. */
443
+ recipientWallet: Hex;
444
+ /** Registered notification type. */
445
+ typeId: MobileNotificationTypeId;
446
+ /** Supported template version. */
447
+ templateVersion: 1;
448
+ /** Named destination and its parameters. */
449
+ route: MobileNotificationRoute;
450
+ }
451
+
452
+ /** Accepted logical notification; does not prove device delivery or read status. */
453
+ export interface MobileNotificationInboxItem {
454
+ /** Logical notification UUID. */
455
+ notificationId: string;
456
+ /** Registered notification type. */
457
+ typeId: MobileNotificationTypeId;
458
+ /** Navigation data, without title, body, or read state. */
459
+ data: MobileNotificationPayloadV2;
460
+ /** Intent acceptance time in milliseconds. */
461
+ createdAt: number;
462
+ /** Backend-computed trade attribution. */
463
+ tradeWithin24h: boolean;
464
+ }
465
+
466
+ /** Private notification page, ordered newest first. */
467
+ export interface MobileNotificationInboxV2 {
468
+ /** Accepted intents owned by the signing wallet. */
469
+ notifications: MobileNotificationInboxItem[];
470
+ /** Pass unchanged to the next request, or null when pagination is complete. */
471
+ nextCursor: string | null;
472
+ }
473
+
474
+ /** Analytics event with the fields required by its interaction; unused wire fields are filled with null. */
475
+ export type MobileProductEvent = {
476
+ /** Stable event UUID; reuse across retries. */
477
+ clientEventId: string;
478
+ /** Actual event time in milliseconds, within the past 7 days or next 5 minutes. */
479
+ occurredAt: number;
480
+ } & (
481
+ | {
482
+ /** Notification open; not a read-state mutation. */
483
+ eventName: 'notif_opened';
484
+ /** Notification owned by the signing wallet. */
485
+ notificationId: string;
486
+ /** Not used for notification opens. */
487
+ productId?: never;
488
+ /** Not used for notification opens. */
489
+ query?: never;
490
+ }
491
+ | {
492
+ /** Market or chart interaction. */
493
+ eventName: 'market_viewed' | 'chart_opened';
494
+ /** Positive product ID. */
495
+ productId: number;
496
+ /** Not used for market/chart interactions. */
497
+ notificationId?: never;
498
+ /** Not used for market/chart interactions. */
499
+ query?: never;
500
+ }
501
+ | {
502
+ /** Search interaction. */
503
+ eventName: 'search';
504
+ /** Nonblank search query, at most 80 Unicode characters. */
505
+ query: string;
506
+ /** Not used for searches. */
507
+ notificationId?: never;
508
+ /** Not used for searches. */
509
+ productId?: never;
510
+ }
511
+ );
512
+
303
513
  /**
304
514
  * Common params for signed requests that authenticate as a given subaccount.
305
515
  */
@@ -504,11 +714,8 @@ export type GetMobileFollowingParams = GetMobileFollowListParams;
504
714
  /**
505
715
  * Params for {@link MobileClient.registerExpoToken}.
506
716
  */
507
- export interface MobileRegisterExpoTokenParams extends MobileSignedRequestParams {
508
- /**
509
- * Expo push token, e.g. `ExponentPushToken[...]`.
510
- */
511
- expoToken: string;
717
+ export interface MobileRegisterExpoTokenParams
718
+ extends MobileSignedRequestParams, MobileWithExpoTokenParams {
512
719
  platform: MobileNotificationPlatform;
513
720
  /**
514
721
  * BCP-47 locale tag, max 35 chars.
@@ -542,6 +749,67 @@ export type GetMobileNotificationPreferencesParams = MobileWithExpoTokenParams;
542
749
  */
543
750
  export type GetMobileRegisteredWalletParams = MobileWithExpoTokenParams;
544
751
 
752
+ /**
753
+ * Params for {@link MobileClient.registerExpoTokenV2}.
754
+ */
755
+ export interface MobileRegisterExpoTokenV2Params extends MobileRegisterExpoTokenParams {
756
+ /** Actual notification types and routes supported by this device. */
757
+ capabilities: MobileNotificationCapabilities;
758
+ }
759
+
760
+ /**
761
+ * Params for {@link MobileClient.getNotificationRegistrationV2}.
762
+ */
763
+ export type GetMobileNotificationRegistrationV2Params =
764
+ MobileWithExpoTokenParams;
765
+
766
+ /**
767
+ * Params for {@link MobileClient.getNotificationSettingsV2}.
768
+ */
769
+ export type GetMobileNotificationSettingsV2Params = MobileWithExpoTokenParams;
770
+
771
+ /**
772
+ * Params for {@link MobileClient.updateNotificationSettingsV2}.
773
+ */
774
+ export interface MobileUpdateNotificationSettingsV2Params extends MobileWithExpoTokenParams {
775
+ /** Latest settings revision; stale values fail with 6203. */
776
+ expectedRevision: number;
777
+ /** Full replacement, not a partial patch. */
778
+ settings: MobileNotificationSettings;
779
+ }
780
+
781
+ /**
782
+ * Params for {@link MobileClient.getNotificationSubscriptions}; no Expo token is needed.
783
+ */
784
+ export type GetMobileNotificationSubscriptionsParams =
785
+ MobileSignedRequestParams;
786
+
787
+ /**
788
+ * Params for {@link MobileClient.updateNotificationSubscriptions}.
789
+ */
790
+ export interface MobileUpdateNotificationSubscriptionsParams extends MobileSignedRequestParams {
791
+ /** Exactly one operation, with the latest subscription revision. */
792
+ update: MobileNotificationSubscriptionsUpdate;
793
+ }
794
+
795
+ /**
796
+ * Params for {@link MobileClient.getNotificationInboxV2}; no Expo token is needed.
797
+ */
798
+ export interface GetMobileNotificationInboxV2Params extends MobileSignedRequestParams {
799
+ /** Previous nextCursor; omit or pass null for the first page. */
800
+ cursor?: string | null;
801
+ /** Page size from 1 to 50; omission/null uses the server default of 20. */
802
+ limit?: number | null;
803
+ }
804
+
805
+ /**
806
+ * Params for {@link MobileClient.recordProductEvents}.
807
+ */
808
+ export interface MobileRecordProductEventsParams extends MobileSignedRequestParams {
809
+ /** One to fifty events, validated and committed atomically. */
810
+ events: MobileProductEvent[];
811
+ }
812
+
545
813
  /** Official account-level 30-day PnL badge, independent of position PnL. */
546
814
  export interface MobileSocialFeedTraderBadge {
547
815
  /** Qualification tier. */
@@ -670,16 +938,47 @@ export interface MobileSocialFeedCommentPreview {
670
938
  items: MobileSocialFeedReply[];
671
939
  /** Comment count. */
672
940
  totalCount: number;
673
- /** Comment cursor, if available. */
941
+ /** Opens the first complete group page in the same snapshot; do not prepend preview items. */
674
942
  nextCursor: string | null;
675
943
  }
676
944
 
677
- /** Exposure requirements associated with a reading session. */
678
- export interface MobileSocialFeedViewTracking {
679
- /** Required visible fraction. */
680
- minVisibleRatio: number;
681
- /** Required visible duration in milliseconds. */
682
- minDurationMs: number;
945
+ /** Uploaded feed image metadata; bytes are fetched separately with the reading session. */
946
+ export interface MobileSocialFeedUploadedImage {
947
+ /** Image UUID. */
948
+ imageId: string;
949
+ /** Backend path for the original image bytes. */
950
+ url: string;
951
+ /** Display-orientation width in pixels. */
952
+ width: number;
953
+ /** Display-orientation height in pixels. */
954
+ height: number;
955
+ /** Detected content type. */
956
+ contentType: 'image/jpeg' | 'image/png';
957
+ /** Original file size in bytes. */
958
+ byteSize: number;
959
+ /** Always-present thumbnail (longest edge ≤ 512, never upscaled). */
960
+ thumbnail: MobileSocialFeedImageThumbnail;
961
+ }
962
+
963
+ /** External image loaded directly from its URL without Mobile session headers. */
964
+ export interface MobileSocialFeedExternalImage {
965
+ /** Original HTTP/HTTPS URL; no upload metadata or thumbnail is provided. */
966
+ url: string;
967
+ }
968
+
969
+ /** Uploaded image metadata or an external URL; uploaded images precede external images. */
970
+ export type MobileSocialFeedImage =
971
+ | MobileSocialFeedUploadedImage
972
+ | MobileSocialFeedExternalImage;
973
+
974
+ /** Thumbnail metadata for an uploaded feed image. */
975
+ export interface MobileSocialFeedImageThumbnail {
976
+ /** Backend path for the thumbnail bytes. */
977
+ url: string;
978
+ /** Thumbnail width in pixels. */
979
+ width: number;
980
+ /** Thumbnail height in pixels. */
981
+ height: number;
683
982
  }
684
983
 
685
984
  /** Coverage of the candidate authors in a qualification snapshot. */
@@ -728,6 +1027,8 @@ export interface MobileSocialFeedItemBase {
728
1027
 
729
1028
  /** Content shared by authored posts and trade cards. */
730
1029
  export interface MobileSocialFeedContentBase extends MobileSocialFeedItemBase {
1030
+ /** Bound images in display order; empty when none. */
1031
+ images: MobileSocialFeedImage[];
731
1032
  /** Card text, empty for automatic cards. */
732
1033
  text: string;
733
1034
  /** Mentions in the original, unmodified text. */
@@ -802,16 +1103,14 @@ export type MobileSocialFeedItem =
802
1103
  | MobileSocialFeedPost
803
1104
  | MobileSocialFeedReply;
804
1105
 
805
- /** Fixed-duration social feed reading session. Credentials and cursors must be returned unchanged. */
1106
+ /** Idle-renewed social feed reading session. Credentials and cursors must be returned unchanged. */
806
1107
  export interface MobileSocialFeedReadSession {
807
1108
  /** Session identifier. */
808
1109
  sessionId: string;
809
1110
  /** Feed, item, or full position history session. */
810
1111
  mode: MobileSocialFeedReadSessionMode;
811
- /** Fixed expiration time in Unix milliseconds; pagination does not extend it. */
1112
+ /** Current idle expiration in Unix milliseconds; legitimate session requests renew it. */
812
1113
  expiresAtMs: number;
813
- /** Visibility requirements for explicit exposure reporting. */
814
- viewTracking: MobileSocialFeedViewTracking;
815
1114
  /** Initial update baseline, distinct from the page cursor. */
816
1115
  updateCursor: string | null;
817
1116
  /** Credential for this reading session. Do not log or cache publicly. */
@@ -1039,6 +1338,8 @@ export interface MobileSocialFeedPost extends MobileSocialFeedContentBase {
1039
1338
  export interface MobileSocialFeedReply extends MobileSocialFeedItemBase {
1040
1339
  /** Reply discriminant. */
1041
1340
  kind: 'reply';
1341
+ /** Bound images in display order; empty when none. */
1342
+ images: MobileSocialFeedImage[];
1042
1343
  /** Original text. */
1043
1344
  text: string;
1044
1345
  /** Mentions in the text. */
@@ -1285,6 +1586,48 @@ export interface MobileCreateFeedPostParams extends MobileSignedRequestParams {
1285
1586
  mentions: MobileSocialFeedMentionParams[];
1286
1587
  /** Original JSON text, at most 256 KiB UTF-8; never reformatted by the SDK. */
1287
1588
  drawingDataJson?: string;
1589
+ /**
1590
+ * Up to nine distinct ready image UUIDs owned by the signer, in display order.
1591
+ * Omit or pass `[]` when none; order participates in the signature and idempotency hash.
1592
+ * Images alone are not enough — nonblank text or a valid drawing is still required.
1593
+ */
1594
+ imageIds?: string[];
1595
+ /**
1596
+ * Up to ten original HTTP/HTTPS URLs in display order, independent of the nine upload slots.
1597
+ * No whitespace or control characters. Omit or pass []; null is invalid. Preserve URL spelling,
1598
+ * order, and field presence for retries: omission and [] produce different signing hashes.
1599
+ */
1600
+ imageUrls?: string[];
1601
+ }
1602
+
1603
+ /**
1604
+ * Direct multipart upload of one static JPEG/PNG (whole request ≤ 2 MiB including signature overhead).
1605
+ * The SDK hashes the bytes as Keccak256 for signing; the service verifies the received file matches.
1606
+ */
1607
+ export interface MobileCreateFeedImageUploadParams extends MobileSignedRequestParams {
1608
+ /** Raw original file bytes; format is validated by the service. */
1609
+ fileBytes: Uint8Array;
1610
+ }
1611
+
1612
+ /** Parameters for preparing a protected feed image request with a reading session. */
1613
+ export interface GetMobileFeedImageRequestParams {
1614
+ /** Uploaded image path from {@link MobileSocialFeedUploadedImage.url} or thumbnail.url; load external URLs directly without session headers. */
1615
+ path: string;
1616
+ /** Reading session that fully delivered the parent item. */
1617
+ sessionId: string;
1618
+ /** Browser credential for that session. */
1619
+ viewerToken: string;
1620
+ }
1621
+
1622
+ /** Parameters for fetching protected feed image bytes with a reading session. */
1623
+ export type GetMobileFeedImageBytesParams = GetMobileFeedImageRequestParams;
1624
+
1625
+ /** URL and authentication headers for native image components or direct image reads. */
1626
+ export interface MobileFeedImageRequest {
1627
+ /** Absolute image URL; pass as the native image source URI. */
1628
+ url: string;
1629
+ /** Original reading-session credentials required to access the image. */
1630
+ headers: Record<string, string>;
1288
1631
  }
1289
1632
 
1290
1633
  /** Parameters for first adding or replacing a drawing. Writes must be serialized by the caller. */
@@ -1309,9 +1652,9 @@ export interface GetMobileFeedCommentsParams extends MobileSocialFeedReadParams
1309
1652
  rootItemId: string;
1310
1653
  /** Forward or backward opaque cursor from the same session. */
1311
1654
  cursor?: string;
1312
- /** Page size, 1-50; defaults to 20. */
1655
+ /** Top-level group count, 1-50; defaults to 20. Descendants do not consume the limit. */
1313
1656
  limit?: number;
1314
- /** First-page reply anchor; cannot be combined with cursor. */
1657
+ /** First-page anchor at any depth; returns its top-level group. Cannot be combined with cursor. */
1315
1658
  anchorReplyId?: string;
1316
1659
  /** Reuse the original session and viewerToken when navigating or paging. */
1317
1660
  sessionId?: string;
@@ -1331,6 +1674,17 @@ export interface MobileCreateFeedCommentParams extends MobileSignedRequestParams
1331
1674
  mentions: MobileSocialFeedMentionParams[];
1332
1675
  /** Position still held by the signed author; invalid attachment rejects the whole request. */
1333
1676
  attachedPositionId?: string;
1677
+ /**
1678
+ * Up to nine distinct ready image UUIDs owned by the signer, in display order.
1679
+ * Omit or pass `[]` when none; images cannot replace the required nonblank text.
1680
+ */
1681
+ imageIds?: string[];
1682
+ /**
1683
+ * Up to ten original HTTP/HTTPS URLs in display order, independent of the nine upload slots.
1684
+ * No whitespace or control characters. Omit or pass []; null is invalid. Preserve URL spelling,
1685
+ * order, and field presence for retries: omission and [] produce different signing hashes.
1686
+ */
1687
+ imageUrls?: string[];
1334
1688
  }
1335
1689
 
1336
1690
  /** Parameters for setting or cancelling a signed user's like. */
@@ -1341,13 +1695,12 @@ export interface MobileSetFeedLikeParams extends MobileSignedRequestParams {
1341
1695
  isLiked: boolean;
1342
1696
  }
1343
1697
 
1344
- /** Unsigned exposure report; only send after satisfying the session's viewTracking requirements. */
1698
+ /** Unsigned batch view report, independent of reading sessions and prior detail reads. */
1345
1699
  export interface MobileRecordFeedViewsParams {
1346
- /** Original reading session. */
1347
- sessionId: string;
1348
- /** Original opaque browsing credential. */
1349
- viewerToken: string;
1350
- /** One to fifty fully delivered, readable, interactive item UUIDs. */
1700
+ /**
1701
+ * 1–50 canonical lowercase item UUIDs before deduplication. Posts, trade cards, comments, and replies
1702
+ * may be mixed. Same-request duplicates count once; repeating the request counts again.
1703
+ */
1351
1704
  itemIds: string[];
1352
1705
  }
1353
1706
 
@@ -1365,6 +1718,24 @@ export interface GetMobilePositionHistoryParams extends MobileSocialFeedReadPara
1365
1718
  sessionId?: string;
1366
1719
  }
1367
1720
 
1721
+ /** Parameters for the most recent 500 actions, without pagination or authored content. */
1722
+ export interface GetMobilePositionHistoryAllParams extends MobileSocialFeedReadParams {
1723
+ /** Lifecycle UUID. */
1724
+ positionId: string;
1725
+ }
1726
+
1727
+ /** Parameters for published position thoughts containing both nonblank text and a saved drawing. */
1728
+ export interface GetMobilePositionThoughtsParams extends MobileSocialFeedReadParams {
1729
+ /** Lifecycle UUID; reopening a position creates a different lifecycle. */
1730
+ positionId: string;
1731
+ /** Page size, 1-50; defaults to 20 and must remain unchanged across pages. */
1732
+ limit?: number;
1733
+ /** Original thoughts session; cannot be reused from history or feed queries. */
1734
+ sessionId?: string;
1735
+ /** Previous nextCursor; requires the original session and viewerToken. */
1736
+ cursor?: string;
1737
+ }
1738
+
1368
1739
  /** Counts across the authorized position history. */
1369
1740
  export interface MobileSocialFeedHistorySummary {
1370
1741
  /** Action count. */
@@ -1483,14 +1854,22 @@ export interface MobileSocialFeedDrawingMutationResult {
1483
1854
  drawing: MobileSocialFeedDrawing;
1484
1855
  }
1485
1856
 
1486
- /** Comment thread page, including both directions around an anchor. */
1857
+ /** Top-level comment and all readable descendants from the thread snapshot, without recursive groups. */
1858
+ export interface MobileSocialFeedCommentGroup extends MobileSocialFeedReply {
1859
+ /** Flat descendants in server order: creation time ascending, then depth and UUID. Empty when none. */
1860
+ replies: MobileSocialFeedReply[];
1861
+ }
1862
+
1863
+ /** Comment-group page, including both directions around an anchor at any depth. */
1487
1864
  export interface MobileSocialFeedCommentsPage {
1488
1865
  /** Requested anchor, or null when reading without one. */
1489
1866
  anchorReplyId: string | null;
1490
- /** Readable replies in service order. */
1491
- comments: MobileSocialFeedReply[];
1492
- /** Total readable comment count. */
1867
+ /** Top-level comments, newest first, each with its complete readable descendants; never split a group. */
1868
+ comments: MobileSocialFeedCommentGroup[];
1869
+ /** All readable replies in the thread snapshot, including descendants; not just this page. */
1493
1870
  totalCount: number;
1871
+ /** All readable top-level comments in the thread snapshot; not just this page. */
1872
+ topLevelCount: number;
1494
1873
  /** Forward cursor, or null. */
1495
1874
  nextCursor: string | null;
1496
1875
  /** Backward cursor, or null. */
@@ -1519,16 +1898,10 @@ export interface MobileSocialFeedLikeResult {
1519
1898
  version: string;
1520
1899
  }
1521
1900
 
1522
- /** Exposure deduplication result for the current UTC day. */
1523
- export interface MobileSocialFeedViewsResult {
1524
- /** Newly counted item UUIDs. */
1525
- acceptedItemIds: string[];
1526
- /** Already counted item UUIDs. */
1527
- duplicateItemIds: string[];
1528
- }
1529
-
1530
1901
  /** Full position history and viewing-account trading hints. */
1531
1902
  export interface MobileSocialFeedPositionHistory {
1903
+ /** Current position owner; never inferred from the viewer. */
1904
+ owner: MobileSocialFeedAuthor;
1532
1905
  /** Position and additional history metrics. */
1533
1906
  position: MobileSocialFeedPositionHistoryCard;
1534
1907
  /** Whole-history counts. */
@@ -1591,3 +1964,21 @@ export interface MobileSocialFeedMentionParams extends Omit<
1591
1964
  /** Mentioned identity; serialized to bytes32 for signing. */
1592
1965
  subaccount: Subaccount;
1593
1966
  }
1967
+
1968
+ /** Published position thought with nonblank text and a complete saved drawing. */
1969
+ export type MobileSocialFeedPositionThought = MobileSocialFeedHistoryTake & {
1970
+ /** Always true for this endpoint; uploaded or external images alone do not qualify. */
1971
+ hasAnalysis: true;
1972
+ /** Parsed current drawing; saved data does not necessarily contain visible strokes. */
1973
+ drawing: MobileSocialFeedDrawing;
1974
+ };
1975
+
1976
+ /** Thoughts in descending drawing creation time and item UUID order; no 500-item total cap. */
1977
+ export interface MobileSocialFeedPositionThoughtsPage {
1978
+ /** Complete content in server order; never reorder by display time. */
1979
+ items: MobileSocialFeedPositionThought[];
1980
+ /** Null only at the directory end; an empty page can still have a cursor. */
1981
+ nextCursor: string | null;
1982
+ /** Independent position session; newly published content requires a refresh. */
1983
+ readSession: MobileSocialFeedReadSession;
1984
+ }
@@ -2,6 +2,7 @@ export * from './clientTypes';
2
2
  export * from './mobileErrorCodes';
3
3
  export * from './MobileServerFailureError';
4
4
  export * from './MobileUnsupportedFeedItemError';
5
+ export * from './MobileUnsupportedNotificationRouteError';
5
6
  export * from './serverBaseTypes';
6
7
  export * from './serverExecuteTypes';
7
8
  export * from './serverModelTypes';
@@ -44,6 +44,12 @@ export const MOBILE_ERROR_CODES = {
44
44
  INVALID_EXPO_TOKEN: 6200,
45
45
  INVALID_DEVICE_METADATA: 6201,
46
46
  INVALID_PREFERENCES: 6202,
47
+ /** Settings or subscription revision is stale. Read the resource again before retrying. */
48
+ NOTIFICATION_REVISION_CONFLICT: 6203,
49
+ /** Invalid subscription operation, inbox parameters, event batch, timestamp, or notification ownership. */
50
+ INVALID_NOTIFICATION_REQUEST: 6204,
51
+ /** Wallet already has the maximum number of active device registrations. */
52
+ NOTIFICATION_DEVICE_LIMIT: 6205,
47
53
  /** Feed `minimumNotional` or `limit` is outside its allowed domain. Fix the request; do not retry unchanged. */
48
54
  INVALID_FEED_FILTER: 6300,
49
55
  /** Feed cursor is malformed or bound to a different filter. Discard it and restart from the first page. */
@@ -88,6 +94,10 @@ export const MOBILE_ERROR_CODES = {
88
94
  EMPTY_SOCIAL_FEED_CONTENT: 6323,
89
95
  /** Feed reads are only available through public_query. */
90
96
  SOCIAL_FEED_QUERY_REMOVED: 6325,
97
+ /** Image format, dimensions, integrity, ownership, readiness, expiry, hash, or count is invalid. */
98
+ INVALID_SOCIAL_FEED_IMAGE: 6326,
99
+ /** Initial history/thoughts directory exceeds 4 MiB; do not automatically retry the same query. */
100
+ SOCIAL_FEED_HISTORY_TOO_LARGE: 6328,
91
101
  } as const;
92
102
 
93
103
  /**