@nadohq/mobile-client 0.65.0 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/README.md +107 -8
  2. package/dist/{MobileClient-CfVZXTcz.cjs → MobileClient-M4oC4lrX.cjs} +258 -16
  3. package/dist/MobileClient-M4oC4lrX.cjs.map +1 -0
  4. package/dist/MobileClient.cjs +1 -1
  5. package/dist/MobileClient.d.cts +146 -16
  6. package/dist/MobileClient.d.cts.map +1 -1
  7. package/dist/MobileClient.d.ts +146 -16
  8. package/dist/MobileClient.d.ts.map +1 -1
  9. package/dist/MobileClient.js +258 -16
  10. package/dist/MobileClient.js.map +1 -1
  11. package/dist/{MobileServerFailureError-BZVwlsMg.d.ts → MobileServerFailureError-C9iqNsxI.d.ts} +2 -3
  12. package/dist/MobileServerFailureError-C9iqNsxI.d.ts.map +1 -0
  13. package/dist/{MobileServerFailureError-CbtK8kD4.d.cts → MobileServerFailureError-MtS2reel.d.cts} +2 -3
  14. package/dist/MobileServerFailureError-MtS2reel.d.cts.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-UeeWdYGU.d.ts → buildSignedMobileRequest-BR-KJhIF.d.ts} +2 -2
  20. package/dist/{buildSignedMobileRequest-UeeWdYGU.d.ts.map → buildSignedMobileRequest-BR-KJhIF.d.ts.map} +1 -1
  21. package/dist/{buildSignedMobileRequest-C1v0flCR.d.cts → buildSignedMobileRequest-DyKCK34Y.d.cts} +2 -2
  22. package/dist/{buildSignedMobileRequest-C1v0flCR.d.cts.map → buildSignedMobileRequest-DyKCK34Y.d.cts.map} +1 -1
  23. package/dist/{canonicalize-5eeZrkzQ.d.ts → canonicalize-Bv6UIAbR.d.ts} +2 -2
  24. package/dist/canonicalize-Bv6UIAbR.d.ts.map +1 -0
  25. package/dist/{canonicalize-CBaZprTo.d.cts → canonicalize-CWh3XZzj.d.cts} +2 -2
  26. package/dist/canonicalize-CWh3XZzj.d.cts.map +1 -0
  27. package/dist/{clientTypes-C9dJufxk.d.ts → clientTypes-BUn5_OzK.d.ts} +297 -20
  28. package/dist/clientTypes-BUn5_OzK.d.ts.map +1 -0
  29. package/dist/{clientTypes-_mEgzmNs.d.cts → clientTypes-DOpUcu80.d.cts} +297 -20
  30. package/dist/clientTypes-DOpUcu80.d.cts.map +1 -0
  31. package/dist/dataMappers.cjs +203 -5
  32. package/dist/dataMappers.cjs.map +1 -1
  33. package/dist/dataMappers.d.cts +70 -7
  34. package/dist/dataMappers.d.cts.map +1 -1
  35. package/dist/dataMappers.d.ts +70 -7
  36. package/dist/dataMappers.d.ts.map +1 -1
  37. package/dist/dataMappers.js +192 -6
  38. package/dist/dataMappers.js.map +1 -1
  39. package/dist/{eip712MethodByType-D8jLoxDu.d.cts → eip712MethodByType-CJ6BoayT.d.cts} +2 -2
  40. package/dist/eip712MethodByType-CJ6BoayT.d.cts.map +1 -0
  41. package/dist/{eip712MethodByType-DcUh8h-l.d.ts → eip712MethodByType-Dx4mvgni.d.ts} +2 -2
  42. package/dist/eip712MethodByType-Dx4mvgni.d.ts.map +1 -0
  43. package/dist/{feed-DTJlsg8W.d.ts → feed-DErOLaoY.d.cts} +4 -2
  44. package/dist/feed-DErOLaoY.d.cts.map +1 -0
  45. package/dist/{feed-DTJlsg8W.d.cts → feed-DErOLaoY.d.ts} +4 -2
  46. package/dist/feed-DErOLaoY.d.ts.map +1 -0
  47. package/dist/index.cjs +7 -2
  48. package/dist/index.d.cts +14 -16
  49. package/dist/index.d.ts +14 -16
  50. package/dist/index.js +4 -3
  51. package/dist/{mobileErrorCodes-CmjYEIYm.d.ts → mobileErrorCodes-vD6rbFuF.d.cts} +8 -3
  52. package/dist/mobileErrorCodes-vD6rbFuF.d.cts.map +1 -0
  53. package/dist/{mobileErrorCodes-CmjYEIYm.d.cts → mobileErrorCodes-vD6rbFuF.d.ts} +8 -3
  54. package/dist/mobileErrorCodes-vD6rbFuF.d.ts.map +1 -0
  55. package/dist/{payloadHash-DhHmgRqL.d.cts → payloadHash-CdkF2Ocr.d.cts} +2 -2
  56. package/dist/payloadHash-CdkF2Ocr.d.cts.map +1 -0
  57. package/dist/{payloadHash-E1_8fpLW.d.ts → payloadHash-HD29K77M.d.ts} +2 -2
  58. package/dist/payloadHash-HD29K77M.d.ts.map +1 -0
  59. package/dist/{serverExecuteTypes-B-OJok19.d.cts → serverExecuteTypes-5JyyIXRK.d.ts} +21 -5
  60. package/dist/serverExecuteTypes-5JyyIXRK.d.ts.map +1 -0
  61. package/dist/{serverExecuteTypes-BwWGspOg.d.ts → serverExecuteTypes-CHrQ9Rtq.d.cts} +21 -5
  62. package/dist/serverExecuteTypes-CHrQ9Rtq.d.cts.map +1 -0
  63. package/dist/{serverModelTypes-CiA-dy1R.d.ts → serverModelTypes-CGUZCi0y.d.cts} +163 -8
  64. package/dist/serverModelTypes-CGUZCi0y.d.cts.map +1 -0
  65. package/dist/{serverModelTypes-CiA-dy1R.d.cts → serverModelTypes-CGUZCi0y.d.ts} +163 -8
  66. package/dist/serverModelTypes-CGUZCi0y.d.ts.map +1 -0
  67. package/dist/{serverResponseGuards-CShiXpHT.d.ts → serverResponseGuards-Bvw8ltYJ.d.ts} +2 -2
  68. package/dist/{serverResponseGuards-CShiXpHT.d.ts.map → serverResponseGuards-Bvw8ltYJ.d.ts.map} +1 -1
  69. package/dist/{serverResponseGuards-BW69PS7O.d.cts → serverResponseGuards-i1njcYKN.d.cts} +2 -2
  70. package/dist/{serverResponseGuards-BW69PS7O.d.cts.map → serverResponseGuards-i1njcYKN.d.cts.map} +1 -1
  71. package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
  72. package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
  73. package/dist/signing/canonicalize.cjs +51 -2
  74. package/dist/signing/canonicalize.cjs.map +1 -1
  75. package/dist/signing/canonicalize.d.cts +1 -1
  76. package/dist/signing/canonicalize.d.ts +1 -1
  77. package/dist/signing/canonicalize.js +51 -2
  78. package/dist/signing/canonicalize.js.map +1 -1
  79. package/dist/signing/eip712MethodByType.cjs +7 -0
  80. package/dist/signing/eip712MethodByType.cjs.map +1 -1
  81. package/dist/signing/eip712MethodByType.d.cts +1 -1
  82. package/dist/signing/eip712MethodByType.d.ts +1 -1
  83. package/dist/signing/eip712MethodByType.js +7 -0
  84. package/dist/signing/eip712MethodByType.js.map +1 -1
  85. package/dist/signing/index.d.cts +5 -5
  86. package/dist/signing/index.d.ts +5 -5
  87. package/dist/signing/payloadHash.cjs +1 -1
  88. package/dist/signing/payloadHash.d.cts +1 -1
  89. package/dist/signing/payloadHash.d.ts +1 -1
  90. package/dist/signing/payloadHash.js +1 -1
  91. package/dist/signing/types.d.cts +1 -1
  92. package/dist/signing/types.d.ts +1 -1
  93. package/dist/types/MobileServerFailureError.d.cts +1 -1
  94. package/dist/types/MobileServerFailureError.d.ts +1 -1
  95. package/dist/types/MobileUnsupportedNotificationRouteError.cjs +19 -0
  96. package/dist/types/MobileUnsupportedNotificationRouteError.cjs.map +1 -0
  97. package/dist/types/MobileUnsupportedNotificationRouteError.d.cts +2 -0
  98. package/dist/types/MobileUnsupportedNotificationRouteError.d.ts +2 -0
  99. package/dist/types/MobileUnsupportedNotificationRouteError.js +18 -0
  100. package/dist/types/MobileUnsupportedNotificationRouteError.js.map +1 -0
  101. package/dist/types/clientTypes.d.cts +2 -2
  102. package/dist/types/clientTypes.d.ts +2 -2
  103. package/dist/types/index.cjs +4 -0
  104. package/dist/types/index.d.cts +8 -9
  105. package/dist/types/index.d.ts +8 -9
  106. package/dist/types/index.js +3 -2
  107. package/dist/types/mobileErrorCodes.cjs +11 -1
  108. package/dist/types/mobileErrorCodes.cjs.map +1 -1
  109. package/dist/types/mobileErrorCodes.d.cts +1 -1
  110. package/dist/types/mobileErrorCodes.d.ts +1 -1
  111. package/dist/types/mobileErrorCodes.js +11 -1
  112. package/dist/types/mobileErrorCodes.js.map +1 -1
  113. package/dist/types/serverBaseTypes.d.cts +1 -1
  114. package/dist/types/serverBaseTypes.d.ts +1 -1
  115. package/dist/types/serverExecuteTypes.d.cts +2 -2
  116. package/dist/types/serverExecuteTypes.d.ts +2 -2
  117. package/dist/types/serverModelTypes.cjs +15 -0
  118. package/dist/types/serverModelTypes.cjs.map +1 -1
  119. package/dist/types/serverModelTypes.d.cts +2 -2
  120. package/dist/types/serverModelTypes.d.ts +2 -2
  121. package/dist/types/serverModelTypes.js +14 -1
  122. package/dist/types/serverModelTypes.js.map +1 -1
  123. package/dist/types/serverQueryTypes.d.cts +2 -2
  124. package/dist/types/serverQueryTypes.d.ts +2 -2
  125. package/dist/types/serverRequestTypes.d.cts +2 -2
  126. package/dist/types/serverRequestTypes.d.ts +2 -2
  127. package/dist/types-C9YE4EIt.d.cts +794 -0
  128. package/dist/types-C9YE4EIt.d.cts.map +1 -0
  129. package/dist/types-Cwy1y_9x.d.ts +794 -0
  130. package/dist/types-Cwy1y_9x.d.ts.map +1 -0
  131. package/dist/utils/buildMobileFeedImageMultipart.cjs +31 -0
  132. package/dist/utils/buildMobileFeedImageMultipart.cjs.map +1 -0
  133. package/dist/utils/buildMobileFeedImageMultipart.d.cts +15 -0
  134. package/dist/utils/buildMobileFeedImageMultipart.d.cts.map +1 -0
  135. package/dist/utils/buildMobileFeedImageMultipart.d.ts +15 -0
  136. package/dist/utils/buildMobileFeedImageMultipart.d.ts.map +1 -0
  137. package/dist/utils/buildMobileFeedImageMultipart.js +30 -0
  138. package/dist/utils/buildMobileFeedImageMultipart.js.map +1 -0
  139. package/dist/utils/feed.cjs +3 -0
  140. package/dist/utils/feed.cjs.map +1 -1
  141. package/dist/utils/feed.d.cts +2 -2
  142. package/dist/utils/feed.d.ts +2 -2
  143. package/dist/utils/feed.js +3 -1
  144. package/dist/utils/feed.js.map +1 -1
  145. package/dist/utils/index.cjs +2 -1
  146. package/dist/utils/index.d.cts +3 -3
  147. package/dist/utils/index.d.ts +3 -3
  148. package/dist/utils/index.js +2 -2
  149. package/dist/utils/serverResponseGuards.d.cts +1 -1
  150. package/dist/utils/serverResponseGuards.d.ts +1 -1
  151. package/package.json +3 -3
  152. package/src/MobileClient.ts +388 -11
  153. package/src/dataMappers.test.ts +108 -2
  154. package/src/dataMappers.ts +253 -5
  155. package/src/feedImages.test.ts +309 -0
  156. package/src/notifications.test.ts +950 -0
  157. package/src/signing/canonicalize.ts +66 -0
  158. package/src/signing/eip712MethodByType.ts +10 -0
  159. package/src/signing/signing.test.ts +16 -1
  160. package/src/signing/types.ts +51 -9
  161. package/src/socialFeed.test.ts +38 -2
  162. package/src/types/MobileUnsupportedNotificationRouteError.ts +16 -0
  163. package/src/types/clientTypes.ts +372 -16
  164. package/src/types/index.ts +1 -0
  165. package/src/types/mobileErrorCodes.ts +10 -0
  166. package/src/types/serverExecuteTypes.ts +20 -0
  167. package/src/types/serverModelTypes.ts +205 -6
  168. package/src/types/serverQueryTypes.ts +74 -5
  169. package/src/types/serverRequestTypes.ts +101 -12
  170. package/src/utils/buildMobileFeedImageMultipart.test.ts +45 -0
  171. package/src/utils/buildMobileFeedImageMultipart.ts +36 -0
  172. package/src/utils/feed.ts +3 -0
  173. package/dist/MobileClient-CfVZXTcz.cjs.map +0 -1
  174. package/dist/MobileServerFailureError-BZVwlsMg.d.ts.map +0 -1
  175. package/dist/MobileServerFailureError-CbtK8kD4.d.cts.map +0 -1
  176. package/dist/canonicalize-5eeZrkzQ.d.ts.map +0 -1
  177. package/dist/canonicalize-CBaZprTo.d.cts.map +0 -1
  178. package/dist/clientTypes-C9dJufxk.d.ts.map +0 -1
  179. package/dist/clientTypes-_mEgzmNs.d.cts.map +0 -1
  180. package/dist/eip712MethodByType-D8jLoxDu.d.cts.map +0 -1
  181. package/dist/eip712MethodByType-DcUh8h-l.d.ts.map +0 -1
  182. package/dist/feed-DTJlsg8W.d.cts.map +0 -1
  183. package/dist/feed-DTJlsg8W.d.ts.map +0 -1
  184. package/dist/mobileErrorCodes-CmjYEIYm.d.cts.map +0 -1
  185. package/dist/mobileErrorCodes-CmjYEIYm.d.ts.map +0 -1
  186. package/dist/payloadHash-DhHmgRqL.d.cts.map +0 -1
  187. package/dist/payloadHash-E1_8fpLW.d.ts.map +0 -1
  188. package/dist/serverBaseTypes-B5J1_TyC.d.cts +0 -25
  189. package/dist/serverBaseTypes-B5J1_TyC.d.cts.map +0 -1
  190. package/dist/serverBaseTypes-DnLzsdm-.d.ts +0 -25
  191. package/dist/serverBaseTypes-DnLzsdm-.d.ts.map +0 -1
  192. package/dist/serverExecuteTypes-B-OJok19.d.cts.map +0 -1
  193. package/dist/serverExecuteTypes-BwWGspOg.d.ts.map +0 -1
  194. package/dist/serverModelTypes-CiA-dy1R.d.cts.map +0 -1
  195. package/dist/serverModelTypes-CiA-dy1R.d.ts.map +0 -1
  196. package/dist/serverQueryTypes-CJcjLB7n.d.ts +0 -283
  197. package/dist/serverQueryTypes-CJcjLB7n.d.ts.map +0 -1
  198. package/dist/serverQueryTypes-V1f9yE7L.d.cts +0 -283
  199. package/dist/serverQueryTypes-V1f9yE7L.d.cts.map +0 -1
  200. package/dist/serverRequestTypes-CRlkNSu5.d.cts +0 -270
  201. package/dist/serverRequestTypes-CRlkNSu5.d.cts.map +0 -1
  202. package/dist/serverRequestTypes-DZoOhV2o.d.ts +0 -270
  203. package/dist/serverRequestTypes-DZoOhV2o.d.ts.map +0 -1
  204. package/dist/types-BiRmH5Iv.d.cts +0 -108
  205. package/dist/types-BiRmH5Iv.d.cts.map +0 -1
  206. package/dist/types-DoJuq0Ij.d.ts +0 -108
  207. 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. */
@@ -676,10 +944,39 @@ export interface MobileSocialFeedCommentPreview {
676
944
 
677
945
  /** Exposure requirements associated with a reading session. */
678
946
  export interface MobileSocialFeedViewTracking {
679
- /** Required visible fraction. */
680
- minVisibleRatio: number;
681
- /** Required visible duration in milliseconds. */
682
- minDurationMs: number;
947
+ /**
948
+ * Detail-visit exposure: report the primary detail target after it is shown in the foreground.
949
+ * List visible-ratio / dwell thresholds are no longer used.
950
+ */
951
+ mode: 'detail_visit';
952
+ }
953
+
954
+ /** Uploaded feed image metadata; bytes are fetched separately with the reading session. */
955
+ export interface MobileSocialFeedImage {
956
+ /** Image UUID. */
957
+ imageId: string;
958
+ /** Backend path for the original image bytes. */
959
+ url: string;
960
+ /** Display-orientation width in pixels. */
961
+ width: number;
962
+ /** Display-orientation height in pixels. */
963
+ height: number;
964
+ /** Detected content type. */
965
+ contentType: 'image/jpeg' | 'image/png';
966
+ /** Original file size in bytes. */
967
+ byteSize: number;
968
+ /** Always-present thumbnail (longest edge ≤ 512, never upscaled). */
969
+ thumbnail: MobileSocialFeedImageThumbnail;
970
+ }
971
+
972
+ /** Thumbnail metadata for an uploaded feed image. */
973
+ export interface MobileSocialFeedImageThumbnail {
974
+ /** Backend path for the thumbnail bytes. */
975
+ url: string;
976
+ /** Thumbnail width in pixels. */
977
+ width: number;
978
+ /** Thumbnail height in pixels. */
979
+ height: number;
683
980
  }
684
981
 
685
982
  /** Coverage of the candidate authors in a qualification snapshot. */
@@ -728,6 +1025,8 @@ export interface MobileSocialFeedItemBase {
728
1025
 
729
1026
  /** Content shared by authored posts and trade cards. */
730
1027
  export interface MobileSocialFeedContentBase extends MobileSocialFeedItemBase {
1028
+ /** Bound images in display order; empty when none. */
1029
+ images: MobileSocialFeedImage[];
731
1030
  /** Card text, empty for automatic cards. */
732
1031
  text: string;
733
1032
  /** Mentions in the original, unmodified text. */
@@ -802,13 +1101,13 @@ export type MobileSocialFeedItem =
802
1101
  | MobileSocialFeedPost
803
1102
  | MobileSocialFeedReply;
804
1103
 
805
- /** Fixed-duration social feed reading session. Credentials and cursors must be returned unchanged. */
1104
+ /** Idle-renewed social feed reading session. Credentials and cursors must be returned unchanged. */
806
1105
  export interface MobileSocialFeedReadSession {
807
1106
  /** Session identifier. */
808
1107
  sessionId: string;
809
1108
  /** Feed, item, or full position history session. */
810
1109
  mode: MobileSocialFeedReadSessionMode;
811
- /** Fixed expiration time in Unix milliseconds; pagination does not extend it. */
1110
+ /** Current idle expiration in Unix milliseconds; legitimate session requests renew it. */
812
1111
  expiresAtMs: number;
813
1112
  /** Visibility requirements for explicit exposure reporting. */
814
1113
  viewTracking: MobileSocialFeedViewTracking;
@@ -976,6 +1275,12 @@ export type GetMobilePositionFeedParams = MobileSocialFeedListParams &
976
1275
  export type GetMobileFeedItemParams = MobileSocialFeedReadParams & {
977
1276
  /** Target item UUID. */
978
1277
  itemId: string;
1278
+ /**
1279
+ * Detail-visit event UUID generated once per real navigation into this item.
1280
+ * Reuse the same value on retries for the same visit; omit for prefetch.
1281
+ * Registering the event does not increment the view count by itself.
1282
+ */
1283
+ viewEventId?: string;
979
1284
  /** Preview size, 0–3. */
980
1285
  commentPreviewLimit?: number;
981
1286
  /** Existing session authorized for the item. */
@@ -1039,6 +1344,8 @@ export interface MobileSocialFeedPost extends MobileSocialFeedContentBase {
1039
1344
  export interface MobileSocialFeedReply extends MobileSocialFeedItemBase {
1040
1345
  /** Reply discriminant. */
1041
1346
  kind: 'reply';
1347
+ /** Bound images in display order; empty when none. */
1348
+ images: MobileSocialFeedImage[];
1042
1349
  /** Original text. */
1043
1350
  text: string;
1044
1351
  /** Mentions in the text. */
@@ -1285,6 +1592,42 @@ export interface MobileCreateFeedPostParams extends MobileSignedRequestParams {
1285
1592
  mentions: MobileSocialFeedMentionParams[];
1286
1593
  /** Original JSON text, at most 256 KiB UTF-8; never reformatted by the SDK. */
1287
1594
  drawingDataJson?: string;
1595
+ /**
1596
+ * Up to nine distinct ready image UUIDs owned by the signer, in display order.
1597
+ * Omit or pass `[]` when none; order participates in the signature and idempotency hash.
1598
+ * Images alone are not enough — nonblank text or a valid drawing is still required.
1599
+ */
1600
+ imageIds?: 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
+ /** Backend path from {@link MobileSocialFeedImage.url} or thumbnail.url. */
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. */
@@ -1331,6 +1674,11 @@ 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[];
1334
1682
  }
1335
1683
 
1336
1684
  /** Parameters for setting or cancelling a signed user's like. */
@@ -1341,14 +1689,22 @@ export interface MobileSetFeedLikeParams extends MobileSignedRequestParams {
1341
1689
  isLiked: boolean;
1342
1690
  }
1343
1691
 
1344
- /** Unsigned exposure report; only send after satisfying the session's viewTracking requirements. */
1692
+ /**
1693
+ * Unsigned detail-visit report. Call after the primary detail target is shown in the foreground,
1694
+ * using the same {@link GetMobileFeedItemParams.viewEventId} previously sent to `getFeedItem`.
1695
+ */
1345
1696
  export interface MobileRecordFeedViewsParams {
1346
- /** Original reading session. */
1697
+ /** Original reading session returned by the detail read. */
1347
1698
  sessionId: string;
1348
- /** Original opaque browsing credential. */
1699
+ /** Original opaque browsing credential from that read session. */
1349
1700
  viewerToken: string;
1350
- /** One to fifty fully delivered, readable, interactive item UUIDs. */
1351
- itemIds: string[];
1701
+ /**
1702
+ * Detail-visit event UUID registered on the preceding feed_item call.
1703
+ * Reuse across retries for the same visit; generate a new UUID only after leaving and re-entering.
1704
+ */
1705
+ viewEventId: string;
1706
+ /** Exactly one fully delivered, readable detail-target item UUID. */
1707
+ itemId: string;
1352
1708
  }
1353
1709
 
1354
1710
  /** Parameters for full position history, not just published feed items. */
@@ -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
+ /** An existing detail-visit event was reused with a different item or browsing credential. */
100
+ SOCIAL_FEED_VIEW_EVENT_REBOUND: 6327,
91
101
  } as const;
92
102
 
93
103
  /**
@@ -6,9 +6,11 @@ import {
6
6
  import {
7
7
  MobileServerSocialFeedAuthor,
8
8
  MobileServerSocialFeedDrawing,
9
+ MobileServerSocialFeedImage,
9
10
  MobileServerSocialFeedItem,
10
11
  MobileServerSocialFeedReply,
11
12
  } from './serverModelTypes';
13
+ import { MobileServerNotificationSettingsV2Response } from './serverQueryTypes';
12
14
  import {
13
15
  MobileServerExecuteRequestType,
14
16
  MobileServerPublicExecuteRequestByType,
@@ -80,15 +82,31 @@ export interface MobileServerAvatarUploadResponse {
80
82
  expires_in_seconds: number;
81
83
  }
82
84
 
85
+ /** Ready image returned by a direct multipart upload. */
86
+ export interface MobileServerSocialFeedImageUploadResponse {
87
+ /** Ready image metadata, including original and thumbnail paths. */
88
+ image: MobileServerSocialFeedImage;
89
+ }
90
+
83
91
  /**
84
92
  * Success payloads for each signed `execute`, keyed by request `type`. Mutations return either the success
85
93
  * envelope alone or authoritative post-commit state; avatar upload creation returns a temporary grant.
86
94
  */
87
95
  export interface MobileServerExecuteResponseByType {
96
+ /** Capability-aware device registration returns only status. */
97
+ register_expo_token_v2: MobileServerEmptyExecuteResponse;
98
+ /** Re-query subscriptions after success to obtain the new revision. */
99
+ update_notification_subscriptions: MobileServerEmptyExecuteResponse;
100
+ /** Atomic event recording returns only status. */
101
+ record_product_events: MobileServerEmptyExecuteResponse;
88
102
  /** Published or idempotently recovered item. */
89
103
  create_feed_post: MobileServerSocialFeedPostResponse;
90
104
  /** Atomically published reply and updated count. */
91
105
  create_feed_comment: MobileServerSocialFeedCommentResponse;
106
+ /** Direct post-image upload; the image is ready immediately. */
107
+ create_feed_post_image_uploads: MobileServerSocialFeedImageUploadResponse;
108
+ /** Direct comment-image upload; the image is ready immediately. */
109
+ create_feed_comment_image_uploads: MobileServerSocialFeedImageUploadResponse;
92
110
  /** First attached drawing. */
93
111
  create_feed_chart_drawing: MobileServerSocialFeedDrawingMutationResponse;
94
112
  /** Replaced or idempotently recovered drawing. */
@@ -181,6 +199,8 @@ export interface MobileServerSocialFeedPresenceResponse {
181
199
 
182
200
  /** Response payloads for unsigned writes. */
183
201
  export interface MobileServerPublicExecuteResponseByType {
202
+ /** Saved document, including the advanced settings revision. */
203
+ update_notification_settings_v2: MobileServerNotificationSettingsV2Response;
184
204
  /** Token removal returns only the success envelope. */
185
205
  unregister_expo_token: MobileServerEmptyExecuteResponse;
186
206
  /** Preference updates return only the success envelope. */