@nadohq/mobile-client 0.64.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -7
- package/dist/MobileClient-M4oC4lrX.cjs +1101 -0
- package/dist/MobileClient-M4oC4lrX.cjs.map +1 -0
- package/dist/MobileClient.cjs +1 -1
- package/dist/MobileClient.d.cts +306 -10
- package/dist/MobileClient.d.cts.map +1 -1
- package/dist/MobileClient.d.ts +306 -10
- package/dist/MobileClient.d.ts.map +1 -1
- package/dist/MobileClient.js +544 -5
- package/dist/MobileClient.js.map +1 -1
- package/dist/{MobileServerFailureError-Dd3c6P_Z.d.ts → MobileServerFailureError-C9iqNsxI.d.ts} +2 -3
- package/dist/MobileServerFailureError-C9iqNsxI.d.ts.map +1 -0
- package/dist/{MobileServerFailureError-Bpa_WA9f.d.cts → MobileServerFailureError-MtS2reel.d.cts} +2 -3
- package/dist/MobileServerFailureError-MtS2reel.d.cts.map +1 -0
- package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.cts +15 -0
- package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.cts.map +1 -0
- package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.ts +15 -0
- package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.ts.map +1 -0
- package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.cts +15 -0
- package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.cts.map +1 -0
- package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.ts +15 -0
- package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.ts.map +1 -0
- package/dist/{buildSignedMobileRequest-Cb1T74xV.d.ts → buildSignedMobileRequest-BR-KJhIF.d.ts} +2 -2
- package/dist/{buildSignedMobileRequest-Cb1T74xV.d.ts.map → buildSignedMobileRequest-BR-KJhIF.d.ts.map} +1 -1
- package/dist/{buildSignedMobileRequest-NHbMAPzd.d.cts → buildSignedMobileRequest-DyKCK34Y.d.cts} +2 -2
- package/dist/{buildSignedMobileRequest-NHbMAPzd.d.cts.map → buildSignedMobileRequest-DyKCK34Y.d.cts.map} +1 -1
- package/dist/{canonicalize-BBYGh17w.d.ts → canonicalize-Bv6UIAbR.d.ts} +2 -2
- package/dist/canonicalize-Bv6UIAbR.d.ts.map +1 -0
- package/dist/{canonicalize-BF_SiNvO.d.cts → canonicalize-CWh3XZzj.d.cts} +2 -2
- package/dist/canonicalize-CWh3XZzj.d.cts.map +1 -0
- package/dist/clientTypes-BUn5_OzK.d.ts +1665 -0
- package/dist/clientTypes-BUn5_OzK.d.ts.map +1 -0
- package/dist/clientTypes-DOpUcu80.d.cts +1665 -0
- package/dist/clientTypes-DOpUcu80.d.cts.map +1 -0
- package/dist/dataMappers.cjs +691 -14
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.d.cts +254 -8
- package/dist/dataMappers.d.cts.map +1 -1
- package/dist/dataMappers.d.ts +254 -8
- package/dist/dataMappers.d.ts.map +1 -1
- package/dist/dataMappers.js +651 -15
- package/dist/dataMappers.js.map +1 -1
- package/dist/{eip712MethodByType-BSx11xG-.d.cts → eip712MethodByType-CJ6BoayT.d.cts} +2 -2
- package/dist/eip712MethodByType-CJ6BoayT.d.cts.map +1 -0
- package/dist/{eip712MethodByType-DkiAjCLs.d.ts → eip712MethodByType-Dx4mvgni.d.ts} +2 -2
- package/dist/eip712MethodByType-Dx4mvgni.d.ts.map +1 -0
- package/dist/{feed-DTJlsg8W.d.ts → feed-DErOLaoY.d.cts} +4 -2
- package/dist/feed-DErOLaoY.d.cts.map +1 -0
- package/dist/{feed-DTJlsg8W.d.cts → feed-DErOLaoY.d.ts} +4 -2
- package/dist/feed-DErOLaoY.d.ts.map +1 -0
- package/dist/index.cjs +9 -2
- package/dist/index.d.cts +15 -16
- package/dist/index.d.ts +15 -16
- package/dist/index.js +5 -3
- package/dist/{mobileErrorCodes-3LtreeZM.d.ts → mobileErrorCodes-vD6rbFuF.d.cts} +25 -6
- package/dist/mobileErrorCodes-vD6rbFuF.d.cts.map +1 -0
- package/dist/{mobileErrorCodes-3LtreeZM.d.cts → mobileErrorCodes-vD6rbFuF.d.ts} +25 -6
- package/dist/mobileErrorCodes-vD6rbFuF.d.ts.map +1 -0
- package/dist/{payloadHash-BOWGjqdb.d.cts → payloadHash-CdkF2Ocr.d.cts} +2 -2
- package/dist/payloadHash-CdkF2Ocr.d.cts.map +1 -0
- package/dist/{payloadHash-Bzf4CtjV.d.ts → payloadHash-HD29K77M.d.ts} +2 -2
- package/dist/payloadHash-HD29K77M.d.ts.map +1 -0
- package/dist/serverExecuteTypes-5JyyIXRK.d.ts +178 -0
- package/dist/serverExecuteTypes-5JyyIXRK.d.ts.map +1 -0
- package/dist/serverExecuteTypes-CHrQ9Rtq.d.cts +178 -0
- package/dist/serverExecuteTypes-CHrQ9Rtq.d.cts.map +1 -0
- package/dist/serverModelTypes-CGUZCi0y.d.cts +938 -0
- package/dist/serverModelTypes-CGUZCi0y.d.cts.map +1 -0
- package/dist/serverModelTypes-CGUZCi0y.d.ts +938 -0
- package/dist/serverModelTypes-CGUZCi0y.d.ts.map +1 -0
- package/dist/{serverResponseGuards-BU1Xv_tG.d.ts → serverResponseGuards-Bvw8ltYJ.d.ts} +2 -2
- package/dist/{serverResponseGuards-BU1Xv_tG.d.ts.map → serverResponseGuards-Bvw8ltYJ.d.ts.map} +1 -1
- package/dist/{serverResponseGuards-Dkdok0Sm.d.cts → serverResponseGuards-i1njcYKN.d.cts} +2 -2
- package/dist/{serverResponseGuards-Dkdok0Sm.d.cts.map → serverResponseGuards-i1njcYKN.d.cts.map} +1 -1
- package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
- package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
- package/dist/signing/canonicalize.cjs +86 -0
- package/dist/signing/canonicalize.cjs.map +1 -1
- package/dist/signing/canonicalize.d.cts +1 -1
- package/dist/signing/canonicalize.d.ts +1 -1
- package/dist/signing/canonicalize.js +86 -0
- package/dist/signing/canonicalize.js.map +1 -1
- package/dist/signing/eip712MethodByType.cjs +12 -0
- package/dist/signing/eip712MethodByType.cjs.map +1 -1
- package/dist/signing/eip712MethodByType.d.cts +1 -1
- package/dist/signing/eip712MethodByType.d.ts +1 -1
- package/dist/signing/eip712MethodByType.js +12 -0
- package/dist/signing/eip712MethodByType.js.map +1 -1
- package/dist/signing/index.d.cts +5 -5
- package/dist/signing/index.d.ts +5 -5
- package/dist/signing/payloadHash.cjs +1 -1
- package/dist/signing/payloadHash.d.cts +1 -1
- package/dist/signing/payloadHash.d.ts +1 -1
- package/dist/signing/payloadHash.js +1 -1
- package/dist/signing/types.d.cts +1 -1
- package/dist/signing/types.d.ts +1 -1
- package/dist/types/MobileServerFailureError.d.cts +1 -1
- package/dist/types/MobileServerFailureError.d.ts +1 -1
- package/dist/types/MobileUnsupportedFeedItemError.cjs +19 -0
- package/dist/types/MobileUnsupportedFeedItemError.cjs.map +1 -0
- package/dist/types/MobileUnsupportedFeedItemError.d.cts +2 -0
- package/dist/types/MobileUnsupportedFeedItemError.d.ts +2 -0
- package/dist/types/MobileUnsupportedFeedItemError.js +18 -0
- package/dist/types/MobileUnsupportedFeedItemError.js.map +1 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.cjs +19 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.cjs.map +1 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.d.cts +2 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.d.ts +2 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.js +18 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.js.map +1 -0
- package/dist/types/clientTypes.d.cts +2 -2
- package/dist/types/clientTypes.d.ts +2 -2
- package/dist/types/index.cjs +6 -0
- package/dist/types/index.d.cts +9 -9
- package/dist/types/index.d.ts +9 -9
- package/dist/types/index.js +4 -2
- package/dist/types/mobileErrorCodes.cjs +39 -1
- package/dist/types/mobileErrorCodes.cjs.map +1 -1
- package/dist/types/mobileErrorCodes.d.cts +1 -1
- package/dist/types/mobileErrorCodes.d.ts +1 -1
- package/dist/types/mobileErrorCodes.js +39 -1
- package/dist/types/mobileErrorCodes.js.map +1 -1
- package/dist/types/serverBaseTypes.d.cts +1 -1
- package/dist/types/serverBaseTypes.d.ts +1 -1
- package/dist/types/serverExecuteTypes.d.cts +2 -2
- package/dist/types/serverExecuteTypes.d.ts +2 -2
- package/dist/types/serverModelTypes.cjs +15 -0
- package/dist/types/serverModelTypes.cjs.map +1 -1
- package/dist/types/serverModelTypes.d.cts +2 -2
- package/dist/types/serverModelTypes.d.ts +2 -2
- package/dist/types/serverModelTypes.js +14 -1
- package/dist/types/serverModelTypes.js.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +2 -2
- package/dist/types/serverQueryTypes.d.ts +2 -2
- package/dist/types/serverRequestTypes.d.cts +2 -2
- package/dist/types/serverRequestTypes.d.ts +2 -2
- package/dist/types-C9YE4EIt.d.cts +794 -0
- package/dist/types-C9YE4EIt.d.cts.map +1 -0
- package/dist/types-Cwy1y_9x.d.ts +794 -0
- package/dist/types-Cwy1y_9x.d.ts.map +1 -0
- package/dist/utils/buildMobileFeedImageMultipart.cjs +31 -0
- package/dist/utils/buildMobileFeedImageMultipart.cjs.map +1 -0
- package/dist/utils/buildMobileFeedImageMultipart.d.cts +15 -0
- package/dist/utils/buildMobileFeedImageMultipart.d.cts.map +1 -0
- package/dist/utils/buildMobileFeedImageMultipart.d.ts +15 -0
- package/dist/utils/buildMobileFeedImageMultipart.d.ts.map +1 -0
- package/dist/utils/buildMobileFeedImageMultipart.js +30 -0
- package/dist/utils/buildMobileFeedImageMultipart.js.map +1 -0
- package/dist/utils/feed.cjs +3 -0
- package/dist/utils/feed.cjs.map +1 -1
- package/dist/utils/feed.d.cts +2 -2
- package/dist/utils/feed.d.ts +2 -2
- package/dist/utils/feed.js +3 -1
- package/dist/utils/feed.js.map +1 -1
- package/dist/utils/index.cjs +2 -1
- package/dist/utils/index.d.cts +3 -3
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +2 -2
- package/dist/utils/serverResponseGuards.d.cts +1 -1
- package/dist/utils/serverResponseGuards.d.ts +1 -1
- package/package.json +3 -3
- package/src/MobileClient.ts +789 -7
- package/src/dataMappers.test.ts +848 -0
- package/src/dataMappers.ts +924 -17
- package/src/feedImages.test.ts +309 -0
- package/src/notifications.test.ts +950 -0
- package/src/signing/canonicalize.ts +119 -0
- package/src/signing/eip712MethodByType.ts +15 -0
- package/src/signing/signing.test.ts +362 -0
- package/src/signing/types.ts +108 -13
- package/src/socialFeed.test.ts +38 -2
- package/src/types/MobileUnsupportedFeedItemError.ts +18 -0
- package/src/types/MobileUnsupportedNotificationRouteError.ts +16 -0
- package/src/types/clientTypes.ts +1012 -34
- package/src/types/index.ts +2 -0
- package/src/types/mobileErrorCodes.ts +38 -0
- package/src/types/serverExecuteTypes.ts +112 -3
- package/src/types/serverModelTypes.ts +581 -28
- package/src/types/serverQueryTypes.ts +212 -5
- package/src/types/serverRequestTypes.ts +213 -13
- package/src/utils/buildMobileFeedImageMultipart.test.ts +45 -0
- package/src/utils/buildMobileFeedImageMultipart.ts +36 -0
- package/src/utils/feed.ts +3 -0
- package/dist/MobileClient-aDxiM_Kf.cjs +0 -562
- package/dist/MobileClient-aDxiM_Kf.cjs.map +0 -1
- package/dist/MobileServerFailureError-Bpa_WA9f.d.cts.map +0 -1
- package/dist/MobileServerFailureError-Dd3c6P_Z.d.ts.map +0 -1
- package/dist/canonicalize-BBYGh17w.d.ts.map +0 -1
- package/dist/canonicalize-BF_SiNvO.d.cts.map +0 -1
- package/dist/clientTypes-BWFKo9oE.d.cts +0 -844
- package/dist/clientTypes-BWFKo9oE.d.cts.map +0 -1
- package/dist/clientTypes-DCTiUV0H.d.ts +0 -844
- package/dist/clientTypes-DCTiUV0H.d.ts.map +0 -1
- package/dist/eip712MethodByType-BSx11xG-.d.cts.map +0 -1
- package/dist/eip712MethodByType-DkiAjCLs.d.ts.map +0 -1
- package/dist/feed-DTJlsg8W.d.cts.map +0 -1
- package/dist/feed-DTJlsg8W.d.ts.map +0 -1
- package/dist/mobileErrorCodes-3LtreeZM.d.cts.map +0 -1
- package/dist/mobileErrorCodes-3LtreeZM.d.ts.map +0 -1
- package/dist/payloadHash-BOWGjqdb.d.cts.map +0 -1
- package/dist/payloadHash-Bzf4CtjV.d.ts.map +0 -1
- package/dist/serverBaseTypes-DWf3iGWy.d.ts +0 -25
- package/dist/serverBaseTypes-DWf3iGWy.d.ts.map +0 -1
- package/dist/serverBaseTypes-KREDe2M9.d.cts +0 -25
- package/dist/serverBaseTypes-KREDe2M9.d.cts.map +0 -1
- package/dist/serverExecuteTypes-DVRa6ifu.d.cts +0 -89
- package/dist/serverExecuteTypes-DVRa6ifu.d.cts.map +0 -1
- package/dist/serverExecuteTypes-DlYZCp1f.d.ts +0 -89
- package/dist/serverExecuteTypes-DlYZCp1f.d.ts.map +0 -1
- package/dist/serverModelTypes-DAqEyYtB.d.cts +0 -508
- package/dist/serverModelTypes-DAqEyYtB.d.cts.map +0 -1
- package/dist/serverModelTypes-DAqEyYtB.d.ts +0 -508
- package/dist/serverModelTypes-DAqEyYtB.d.ts.map +0 -1
- package/dist/serverQueryTypes-BFdwq0Z2.d.ts +0 -171
- package/dist/serverQueryTypes-BFdwq0Z2.d.ts.map +0 -1
- package/dist/serverQueryTypes-DNdMpmDr.d.cts +0 -171
- package/dist/serverQueryTypes-DNdMpmDr.d.cts.map +0 -1
- package/dist/serverRequestTypes-BNA7FCY6.d.ts +0 -200
- package/dist/serverRequestTypes-BNA7FCY6.d.ts.map +0 -1
- package/dist/serverRequestTypes-CxDRFKfv.d.cts +0 -200
- package/dist/serverRequestTypes-CxDRFKfv.d.cts.map +0 -1
- package/dist/types-BCr2G5gS.d.cts +0 -84
- package/dist/types-BCr2G5gS.d.cts.map +0 -1
- package/dist/types-C18k-9Vy.d.ts +0 -84
- package/dist/types-C18k-9Vy.d.ts.map +0 -1
|
@@ -33,6 +33,51 @@ export interface MobileServerAvatarPreset {
|
|
|
33
33
|
*/
|
|
34
34
|
export type MobileNotificationPlatform = 'ios' | 'android';
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Notification types supported by the v2 payload protocol.
|
|
38
|
+
*/
|
|
39
|
+
export type MobileNotificationTypeId =
|
|
40
|
+
| 'new_follower'
|
|
41
|
+
| 'followed_you_back'
|
|
42
|
+
| 'order_fill'
|
|
43
|
+
| 'order_update'
|
|
44
|
+
| 'liquidation'
|
|
45
|
+
| 'trader_opened'
|
|
46
|
+
| 'trader_closed'
|
|
47
|
+
| 'position_milestone'
|
|
48
|
+
| 'market_movement'
|
|
49
|
+
| 'trader_streak'
|
|
50
|
+
| 'account_drama'
|
|
51
|
+
| 'weekly_digest';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Named navigation destinations supported by notification payloads.
|
|
55
|
+
*/
|
|
56
|
+
export type MobileNotificationRouteName = MobileServerNotificationRoute['name'];
|
|
57
|
+
|
|
58
|
+
/** Position milestone options supported by notification settings. */
|
|
59
|
+
export const MOBILE_NOTIFICATION_POSITION_THRESHOLDS = [10, 25, 50] as const;
|
|
60
|
+
|
|
61
|
+
/** Minimum trade-size options, in whole USD, supported by notification settings. */
|
|
62
|
+
export const MOBILE_NOTIFICATION_MIN_TRADE_SIZES_USD = [
|
|
63
|
+
0, 100, 1000, 10000,
|
|
64
|
+
] as const;
|
|
65
|
+
|
|
66
|
+
/** Supported notification position milestone threshold. */
|
|
67
|
+
export type MobileNotificationPositionThreshold =
|
|
68
|
+
(typeof MOBILE_NOTIFICATION_POSITION_THRESHOLDS)[number];
|
|
69
|
+
|
|
70
|
+
/** Supported notification minimum trade size, in whole USD. */
|
|
71
|
+
export type MobileNotificationMinTradeSizeUsd =
|
|
72
|
+
(typeof MOBILE_NOTIFICATION_MIN_TRADE_SIZES_USD)[number];
|
|
73
|
+
|
|
74
|
+
/** Supported product analytics interaction. */
|
|
75
|
+
export type MobileProductEventName =
|
|
76
|
+
| 'notif_opened'
|
|
77
|
+
| 'market_viewed'
|
|
78
|
+
| 'chart_opened'
|
|
79
|
+
| 'search';
|
|
80
|
+
|
|
36
81
|
/**
|
|
37
82
|
* Category of push notification.
|
|
38
83
|
*/
|
|
@@ -223,6 +268,127 @@ export interface MobileServerNotificationPreferences {
|
|
|
223
268
|
categories: MobileServerNotificationCategoryPreference[];
|
|
224
269
|
}
|
|
225
270
|
|
|
271
|
+
/**
|
|
272
|
+
* Stored push-device metadata shared by registration requests and token ownership responses.
|
|
273
|
+
*/
|
|
274
|
+
export interface MobileServerNotificationDeviceMetadata {
|
|
275
|
+
/** Device operating system. */
|
|
276
|
+
platform: MobileNotificationPlatform;
|
|
277
|
+
/** Locale tag, or null when absent; at most 35 UTF-8 bytes. */
|
|
278
|
+
locale: string | null;
|
|
279
|
+
/** App version, or null when absent; at most 64 UTF-8 bytes. */
|
|
280
|
+
app_version: string | null;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Device capabilities shared by v2 registration and v1/v2 registration queries.
|
|
285
|
+
*/
|
|
286
|
+
export interface MobileServerNotificationCapabilities {
|
|
287
|
+
/** Exactly one supported payload version. */
|
|
288
|
+
payload_versions: [1] | [2];
|
|
289
|
+
/** Supported subset of the registered notification types. */
|
|
290
|
+
type_ids: MobileNotificationTypeId[];
|
|
291
|
+
/** Supported subset of the named destinations. */
|
|
292
|
+
routes: MobileNotificationRouteName[];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Server-side wallet settings; all fields are required on replacement.
|
|
297
|
+
*/
|
|
298
|
+
export interface MobileServerNotificationSettings {
|
|
299
|
+
/** Own position milestones and the initial weekly digest. */
|
|
300
|
+
my_positions: boolean;
|
|
301
|
+
/** One to three unique values; the minimum selects the starting milestone tier. */
|
|
302
|
+
position_thresholds: MobileNotificationPositionThreshold[];
|
|
303
|
+
/** Combined order fill/update switch; does not control liquidation notifications. */
|
|
304
|
+
my_orders: boolean;
|
|
305
|
+
/** Ordinary followed-trader notifications; enabled bells override this switch. */
|
|
306
|
+
following_trades: boolean;
|
|
307
|
+
/** Notifications about posts by followed traders. */
|
|
308
|
+
following_posts: boolean;
|
|
309
|
+
/** Minimum trade size for trade notifications, in whole USD. */
|
|
310
|
+
min_trade_size_usd: MobileNotificationMinTradeSizeUsd;
|
|
311
|
+
/** New followers and follow-backs. */
|
|
312
|
+
new_followers: boolean;
|
|
313
|
+
/** Maps to the legacy announcement preference. */
|
|
314
|
+
announcements: boolean;
|
|
315
|
+
/** Opt-in trader streak and account drama discovery notifications. */
|
|
316
|
+
discovery: boolean;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Server-side allowlisted destination; notification data must never be interpreted as an arbitrary URL.
|
|
321
|
+
*/
|
|
322
|
+
export type MobileServerNotificationRoute =
|
|
323
|
+
| {
|
|
324
|
+
/** Public profile destination. */
|
|
325
|
+
name: 'profile';
|
|
326
|
+
/** Profile subaccount as bytes32. */
|
|
327
|
+
subaccount: Hex;
|
|
328
|
+
}
|
|
329
|
+
| {
|
|
330
|
+
/** Market destination. */
|
|
331
|
+
name: 'market';
|
|
332
|
+
/** Positive product ID. */
|
|
333
|
+
product_id: number;
|
|
334
|
+
}
|
|
335
|
+
| {
|
|
336
|
+
/** Own portfolio destination. */
|
|
337
|
+
name: 'portfolio';
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Server-side v2 push/inbox navigation data, not a complete historical trade or notification body.
|
|
342
|
+
*/
|
|
343
|
+
export interface MobileServerNotificationPayloadV2 {
|
|
344
|
+
/** Payload protocol version. */
|
|
345
|
+
payload_version: 2;
|
|
346
|
+
/** Logical notification UUID, used for click deduplication. */
|
|
347
|
+
notification_id: string;
|
|
348
|
+
/** Intended wallet; private navigation must wait for this wallet to connect. */
|
|
349
|
+
recipient_wallet: Hex;
|
|
350
|
+
/** Registered notification type. */
|
|
351
|
+
type_id: MobileNotificationTypeId;
|
|
352
|
+
/** Supported template version. */
|
|
353
|
+
template_version: 1;
|
|
354
|
+
/** Named destination and its parameters. */
|
|
355
|
+
route: MobileServerNotificationRoute;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Server-side accepted logical notification; does not prove device delivery or read status.
|
|
360
|
+
*/
|
|
361
|
+
export interface MobileServerNotificationInboxItem {
|
|
362
|
+
/** Logical notification UUID. */
|
|
363
|
+
notification_id: string;
|
|
364
|
+
/** Registered notification type. */
|
|
365
|
+
type_id: MobileNotificationTypeId;
|
|
366
|
+
/** Navigation data, without title, body, or read state. */
|
|
367
|
+
data: MobileServerNotificationPayloadV2;
|
|
368
|
+
/** Intent acceptance time in milliseconds. */
|
|
369
|
+
created_at: number;
|
|
370
|
+
/** Backend-computed trade attribution. */
|
|
371
|
+
trade_within_24h: boolean;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Server-side product analytics event; unused nullable fields must be explicitly null.
|
|
376
|
+
*/
|
|
377
|
+
export interface MobileServerProductEvent {
|
|
378
|
+
/** Stable event UUID; reuse across retries. */
|
|
379
|
+
client_event_id: string;
|
|
380
|
+
/** Supported interaction; notif_opened is not a read-state mutation. */
|
|
381
|
+
event_name: MobileProductEventName;
|
|
382
|
+
/** Required for notif_opened and owned by the signing wallet; otherwise null. */
|
|
383
|
+
notification_id: string | null;
|
|
384
|
+
/** Actual event time in milliseconds, within the past 7 days or next 5 minutes. */
|
|
385
|
+
occurred_at: number;
|
|
386
|
+
/** Required for market_viewed/chart_opened; otherwise null. */
|
|
387
|
+
product_id: number | null;
|
|
388
|
+
/** Required for search, nonblank and at most 80 Unicode characters; otherwise null. */
|
|
389
|
+
query: string | null;
|
|
390
|
+
}
|
|
391
|
+
|
|
226
392
|
/** Content filters accepted by the six social feed lists. Empty or omitted means all. */
|
|
227
393
|
export type MobileSocialFeedType =
|
|
228
394
|
| 'open'
|
|
@@ -285,7 +451,7 @@ export type MobileSocialFeedTradeCardAction =
|
|
|
285
451
|
| MobileSocialFeedTradeSizeChangeAction;
|
|
286
452
|
|
|
287
453
|
/** Whether a reading session was created for a list or a direct item. */
|
|
288
|
-
export type MobileSocialFeedReadSessionMode = 'feed' | 'item';
|
|
454
|
+
export type MobileSocialFeedReadSessionMode = 'feed' | 'item' | 'position';
|
|
289
455
|
|
|
290
456
|
/** Kind of feed update target. */
|
|
291
457
|
export type MobileSocialFeedTargetType = 'item' | 'position';
|
|
@@ -356,6 +522,8 @@ export interface MobileServerSocialFeedPnl {
|
|
|
356
522
|
|
|
357
523
|
/** Complete mutable position fields delivered together at one version. */
|
|
358
524
|
export interface MobileServerSocialFeedPositionPatch {
|
|
525
|
+
/** Additional metrics for a position history session, when supplied. */
|
|
526
|
+
current_position?: MobileServerSocialFeedHistoryMetrics;
|
|
359
527
|
/** Position lifecycle UUID. */
|
|
360
528
|
position_id: string;
|
|
361
529
|
/** Positive integer string; compare as integers without Number conversion. */
|
|
@@ -396,7 +564,7 @@ export interface MobileServerSocialFeedPositionCard extends MobileServerSocialFe
|
|
|
396
564
|
direction: MobileFeedTradePositionDirection;
|
|
397
565
|
}
|
|
398
566
|
|
|
399
|
-
/** Interaction counters
|
|
567
|
+
/** Interaction counters and the viewing account's relationship state. */
|
|
400
568
|
export interface MobileServerSocialFeedInteraction {
|
|
401
569
|
/** Number of likes. */
|
|
402
570
|
like_count: number;
|
|
@@ -404,7 +572,7 @@ export interface MobileServerSocialFeedInteraction {
|
|
|
404
572
|
comment_count: number;
|
|
405
573
|
/** Number of recorded views. */
|
|
406
574
|
view_count: number;
|
|
407
|
-
/** Null
|
|
575
|
+
/** Null when no viewing account is selected. */
|
|
408
576
|
liked_by_me: boolean | null;
|
|
409
577
|
}
|
|
410
578
|
|
|
@@ -420,8 +588,8 @@ export interface MobileServerSocialFeedCapabilities {
|
|
|
420
588
|
|
|
421
589
|
/** Comment preview metadata for a social trade card. */
|
|
422
590
|
export interface MobileServerSocialFeedCommentPreview {
|
|
423
|
-
/**
|
|
424
|
-
items:
|
|
591
|
+
/** Most recent readable replies. */
|
|
592
|
+
items: MobileServerSocialFeedReply[];
|
|
425
593
|
/** Comment count. */
|
|
426
594
|
total_count: number;
|
|
427
595
|
/** Comment cursor, if available. */
|
|
@@ -430,10 +598,39 @@ export interface MobileServerSocialFeedCommentPreview {
|
|
|
430
598
|
|
|
431
599
|
/** Exposure requirements associated with a reading session. */
|
|
432
600
|
export interface MobileServerSocialFeedViewTracking {
|
|
433
|
-
/**
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
601
|
+
/**
|
|
602
|
+
* Detail-visit exposure: report the primary detail target after it is shown in the foreground.
|
|
603
|
+
* List visible-ratio / dwell thresholds are no longer used.
|
|
604
|
+
*/
|
|
605
|
+
mode: 'detail_visit';
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/** Uploaded feed image metadata; bytes are fetched separately with the reading session. */
|
|
609
|
+
export interface MobileServerSocialFeedImage {
|
|
610
|
+
/** Image UUID. */
|
|
611
|
+
image_id: string;
|
|
612
|
+
/** Backend path for the original image bytes. */
|
|
613
|
+
url: string;
|
|
614
|
+
/** Display-orientation width in pixels. */
|
|
615
|
+
width: number;
|
|
616
|
+
/** Display-orientation height in pixels. */
|
|
617
|
+
height: number;
|
|
618
|
+
/** Detected content type. */
|
|
619
|
+
content_type: 'image/jpeg' | 'image/png';
|
|
620
|
+
/** Original file size in bytes. */
|
|
621
|
+
byte_size: number;
|
|
622
|
+
/** Always-present thumbnail (longest edge ≤ 512, never upscaled). */
|
|
623
|
+
thumbnail: MobileServerSocialFeedImageThumbnail;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/** Thumbnail metadata for an uploaded feed image. */
|
|
627
|
+
export interface MobileServerSocialFeedImageThumbnail {
|
|
628
|
+
/** Backend path for the thumbnail bytes. */
|
|
629
|
+
url: string;
|
|
630
|
+
/** Thumbnail width in pixels. */
|
|
631
|
+
width: number;
|
|
632
|
+
/** Thumbnail height in pixels. */
|
|
633
|
+
height: number;
|
|
437
634
|
}
|
|
438
635
|
|
|
439
636
|
/** Coverage of the candidate authors in a qualification snapshot. */
|
|
@@ -458,14 +655,14 @@ export interface MobileServerSocialFeedCohort {
|
|
|
458
655
|
coverage: MobileServerSocialFeedCohortCoverage;
|
|
459
656
|
}
|
|
460
657
|
|
|
461
|
-
/** Metadata shared by
|
|
658
|
+
/** Metadata shared by social feed content. */
|
|
462
659
|
export interface MobileServerSocialFeedItemBase {
|
|
463
660
|
/** Item UUID. */
|
|
464
661
|
id: string;
|
|
465
662
|
/** Whether authored analysis exists. */
|
|
466
663
|
has_analysis: boolean;
|
|
467
|
-
/**
|
|
468
|
-
drawing: null;
|
|
664
|
+
/** Parsed drawing document, or null when no drawing is readable. */
|
|
665
|
+
drawing: MobileServerSocialFeedDrawing | null;
|
|
469
666
|
/** Author identity, badge, and follow perspective. */
|
|
470
667
|
author: MobileServerSocialFeedAuthor;
|
|
471
668
|
/** Creation time in Unix milliseconds. */
|
|
@@ -476,28 +673,34 @@ export interface MobileServerSocialFeedItemBase {
|
|
|
476
673
|
version: string;
|
|
477
674
|
/** Market metadata. */
|
|
478
675
|
market: MobileServerSocialFeedMarket;
|
|
479
|
-
/** Server capability flags
|
|
676
|
+
/** Server capability flags, subject to the corresponding write switches. */
|
|
480
677
|
capabilities: MobileServerSocialFeedCapabilities;
|
|
481
678
|
}
|
|
482
679
|
|
|
483
|
-
/**
|
|
484
|
-
export interface
|
|
485
|
-
/**
|
|
486
|
-
|
|
487
|
-
/** Trading action. */
|
|
488
|
-
action: MobileSocialFeedTradeCardAction;
|
|
680
|
+
/** Content shared by authored posts and trade cards. */
|
|
681
|
+
export interface MobileServerSocialFeedContentBase extends MobileServerSocialFeedItemBase {
|
|
682
|
+
/** Bound images in display order; empty when none. */
|
|
683
|
+
images: MobileServerSocialFeedImage[];
|
|
489
684
|
/** Card text, empty for automatic cards. */
|
|
490
685
|
text: string;
|
|
491
|
-
/**
|
|
492
|
-
mentions:
|
|
686
|
+
/** Mentions in the original, unmodified text. */
|
|
687
|
+
mentions: MobileSocialFeedMention[];
|
|
493
688
|
/** Current or frozen position display. */
|
|
494
689
|
position: MobileServerSocialFeedPositionCard;
|
|
495
690
|
/** Interaction counters. */
|
|
496
691
|
interaction: MobileServerSocialFeedInteraction;
|
|
497
|
-
/**
|
|
692
|
+
/** Readable comment preview. */
|
|
498
693
|
comment_preview: MobileServerSocialFeedCommentPreview;
|
|
499
694
|
}
|
|
500
695
|
|
|
696
|
+
/** Trade card with optional authored text and analysis. */
|
|
697
|
+
export interface MobileServerSocialFeedTradeCard extends MobileServerSocialFeedContentBase {
|
|
698
|
+
/** Card discriminant. */
|
|
699
|
+
kind: 'trade_card';
|
|
700
|
+
/** Trading action. */
|
|
701
|
+
action: MobileSocialFeedTradeCardAction;
|
|
702
|
+
}
|
|
703
|
+
|
|
501
704
|
/** Fields shared by size-change and liquidation trade rows. */
|
|
502
705
|
export interface MobileServerSocialFeedTradeRowBase extends MobileServerSocialFeedItemBase {
|
|
503
706
|
/** Row discriminant. */
|
|
@@ -546,20 +749,22 @@ export type MobileServerSocialFeedTradeRow =
|
|
|
546
749
|
}
|
|
547
750
|
);
|
|
548
751
|
|
|
549
|
-
/**
|
|
752
|
+
/** Discriminated social feed content. */
|
|
550
753
|
export type MobileServerSocialFeedItem =
|
|
551
754
|
| MobileServerSocialFeedTradeCard
|
|
552
|
-
| MobileServerSocialFeedTradeRow
|
|
755
|
+
| MobileServerSocialFeedTradeRow
|
|
756
|
+
| MobileServerSocialFeedPost
|
|
757
|
+
| MobileServerSocialFeedReply;
|
|
553
758
|
|
|
554
|
-
/**
|
|
759
|
+
/** Idle-renewed social feed reading session. Credentials and cursors must be returned unchanged. */
|
|
555
760
|
export interface MobileServerSocialFeedReadSession {
|
|
556
761
|
/** Session identifier. */
|
|
557
762
|
session_id: string;
|
|
558
|
-
/** Feed or
|
|
763
|
+
/** Feed, item, or full position history session. */
|
|
559
764
|
mode: MobileSocialFeedReadSessionMode;
|
|
560
|
-
/**
|
|
765
|
+
/** Current idle expiration in Unix milliseconds; legitimate session requests renew it. */
|
|
561
766
|
expires_at_ms: number;
|
|
562
|
-
/**
|
|
767
|
+
/** Visibility requirements for explicit exposure reporting. */
|
|
563
768
|
view_tracking: MobileServerSocialFeedViewTracking;
|
|
564
769
|
/** Initial update baseline, distinct from the page cursor. */
|
|
565
770
|
update_cursor: string | null;
|
|
@@ -569,6 +774,10 @@ export interface MobileServerSocialFeedReadSession {
|
|
|
569
774
|
|
|
570
775
|
/** Item delta: omitted means unchanged; explicit null clears a prior value. */
|
|
571
776
|
export interface MobileServerSocialFeedItemPatch {
|
|
777
|
+
/** Updated reply attachment; null clears it, omission leaves it unchanged. */
|
|
778
|
+
attached_position?: MobileServerSocialFeedPositionCard | null;
|
|
779
|
+
/** Updated reply attachment visibility. */
|
|
780
|
+
attachment_status?: MobileSocialFeedAttachmentStatus;
|
|
572
781
|
/** Current author identity, follow state, and qualification badge. */
|
|
573
782
|
author: MobileServerSocialFeedAuthor;
|
|
574
783
|
/** Target item UUID. */
|
|
@@ -610,3 +819,347 @@ export interface MobileSocialFeedUnavailableTarget {
|
|
|
610
819
|
/** Uniform reason prevents leaking inaccessible content. */
|
|
611
820
|
reason: 'unavailable';
|
|
612
821
|
}
|
|
822
|
+
|
|
823
|
+
/** Readable state of a reply's position attachment. */
|
|
824
|
+
export type MobileSocialFeedAttachmentStatus =
|
|
825
|
+
| 'none'
|
|
826
|
+
| 'visible'
|
|
827
|
+
| 'unavailable';
|
|
828
|
+
|
|
829
|
+
/** Supported chart candle intervals. */
|
|
830
|
+
export type MobileSocialFeedChartInterval =
|
|
831
|
+
| '1m'
|
|
832
|
+
| '5m'
|
|
833
|
+
| '15m'
|
|
834
|
+
| '1h'
|
|
835
|
+
| '4h'
|
|
836
|
+
| '1d';
|
|
837
|
+
|
|
838
|
+
/** Position lifecycle action. */
|
|
839
|
+
export type MobileSocialFeedAction =
|
|
840
|
+
| MobileSocialFeedTradeCardAction
|
|
841
|
+
| 'liquidated';
|
|
842
|
+
|
|
843
|
+
/** Result of resolving a position command. */
|
|
844
|
+
export type MobileSocialFeedPositionResolution =
|
|
845
|
+
| 'resolved'
|
|
846
|
+
| 'choose_position'
|
|
847
|
+
| 'no_open_position'
|
|
848
|
+
| 'unknown_market';
|
|
849
|
+
|
|
850
|
+
/** Resolution of a viewing account's trading targets. */
|
|
851
|
+
export type MobileSocialFeedTradingResolution =
|
|
852
|
+
| 'no_viewing_account'
|
|
853
|
+
| 'none'
|
|
854
|
+
| 'unique'
|
|
855
|
+
| 'choose_position'
|
|
856
|
+
| 'unavailable';
|
|
857
|
+
|
|
858
|
+
/** Price source for a historical action marker. */
|
|
859
|
+
export type MobileSocialFeedActionPriceBasis =
|
|
860
|
+
| 'execution'
|
|
861
|
+
| 'liquidation_oracle';
|
|
862
|
+
|
|
863
|
+
/** Chart source completeness; wholly unavailable sources fail the request. */
|
|
864
|
+
export type MobileSocialFeedChartDataQuality = 'ready' | 'partial';
|
|
865
|
+
|
|
866
|
+
/** Projection state of an order's authoritative action segments. */
|
|
867
|
+
export type MobileSocialFeedActionResolution = 'ready' | 'pending';
|
|
868
|
+
|
|
869
|
+
/** Explanation for an empty position command result. */
|
|
870
|
+
export type MobileSocialFeedPositionResolutionReason =
|
|
871
|
+
| 'no_open_position'
|
|
872
|
+
| 'unknown_market';
|
|
873
|
+
|
|
874
|
+
/** Reason an action cannot be published. */
|
|
875
|
+
export type MobileSocialFeedActionUnavailableReason =
|
|
876
|
+
| 'position_closed'
|
|
877
|
+
| 'already_published'
|
|
878
|
+
| 'unavailable';
|
|
879
|
+
|
|
880
|
+
/** Availability of an estimated liquidation price. */
|
|
881
|
+
export type MobileSocialFeedLiquidationPriceQuality =
|
|
882
|
+
| MobileSocialFeedPnlQuality
|
|
883
|
+
| 'not_applicable';
|
|
884
|
+
|
|
885
|
+
/** Presence lifecycle reported by an individual page. */
|
|
886
|
+
export type MobileSocialFeedPresenceState = 'watching' | 'heartbeat' | 'left';
|
|
887
|
+
|
|
888
|
+
/** Mention offsets refer to Unicode code points in the original text, not UTF-16 indices. */
|
|
889
|
+
export interface MobileSocialFeedMention {
|
|
890
|
+
/** Mentioned identity. */
|
|
891
|
+
subaccount: Hex;
|
|
892
|
+
/** Inclusive code point offset. */
|
|
893
|
+
start: number;
|
|
894
|
+
/** Exclusive code point offset. */
|
|
895
|
+
end: number;
|
|
896
|
+
/** Label matching the original text. */
|
|
897
|
+
label: string;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/** Parsed drawing; data is opaque to the SDK and may legitimately be false or zero. */
|
|
901
|
+
export interface MobileServerSocialFeedDrawing {
|
|
902
|
+
/** Already parsed drawing document; do not JSON.parse again. */
|
|
903
|
+
data: unknown;
|
|
904
|
+
/** Original creation time in milliseconds. */
|
|
905
|
+
created_at_ms: number;
|
|
906
|
+
/** Last update time in milliseconds. */
|
|
907
|
+
updated_at_ms: number;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/** Nonrecursive root-post preview carried by replies. */
|
|
911
|
+
export interface MobileServerSocialFeedCompactCard {
|
|
912
|
+
/** Root item UUID. */
|
|
913
|
+
id: string;
|
|
914
|
+
/** Root author. */
|
|
915
|
+
author: MobileServerSocialFeedAuthor;
|
|
916
|
+
/** Original text excerpt. */
|
|
917
|
+
text_excerpt: string;
|
|
918
|
+
/** Visible position summary, or null. */
|
|
919
|
+
position: Pick<
|
|
920
|
+
MobileServerSocialFeedPositionCard,
|
|
921
|
+
'position_id' | 'market' | 'direction' | 'state' | 'notional_x18'
|
|
922
|
+
> | null;
|
|
923
|
+
/** Whether the root has published analysis. */
|
|
924
|
+
has_analysis: boolean;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/** Authored position post, including text-only, drawing-only, and combined content. */
|
|
928
|
+
export interface MobileServerSocialFeedPost extends MobileServerSocialFeedContentBase {
|
|
929
|
+
/** Post discriminant. */
|
|
930
|
+
kind: 'post';
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/** Reply with independently permissioned position attachment and nonrecursive root preview. */
|
|
934
|
+
export interface MobileServerSocialFeedReply extends MobileServerSocialFeedItemBase {
|
|
935
|
+
/** Reply discriminant. */
|
|
936
|
+
kind: 'reply';
|
|
937
|
+
/** Bound images in display order; empty when none. */
|
|
938
|
+
images: MobileServerSocialFeedImage[];
|
|
939
|
+
/** Original text. */
|
|
940
|
+
text: string;
|
|
941
|
+
/** Mentions in the text. */
|
|
942
|
+
mentions: MobileSocialFeedMention[];
|
|
943
|
+
/** Actual root item UUID. */
|
|
944
|
+
root_item_id: string;
|
|
945
|
+
/** Omitted for a direct reply to the root. */
|
|
946
|
+
reply_to_item_id?: string;
|
|
947
|
+
/** Author being replied to, or null. */
|
|
948
|
+
reply_to_author: MobileServerSocialFeedAuthor | null;
|
|
949
|
+
/** Readable attachment; null when absent or unavailable. */
|
|
950
|
+
attached_position: MobileServerSocialFeedPositionCard | null;
|
|
951
|
+
/** Distinguishes an absent attachment from an unreadable one. */
|
|
952
|
+
attachment_status: MobileSocialFeedAttachmentStatus;
|
|
953
|
+
/** Root preview; does not register root exposure. */
|
|
954
|
+
original: MobileServerSocialFeedCompactCard;
|
|
955
|
+
/** Reply interaction state. */
|
|
956
|
+
interaction: MobileServerSocialFeedInteraction;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/** Current eligibility hints; actual writes still recheck the signed author. */
|
|
960
|
+
export interface MobileServerSocialFeedPublishablePosition {
|
|
961
|
+
/** Candidate position. */
|
|
962
|
+
position: MobileServerSocialFeedPositionCard;
|
|
963
|
+
/** Whether this account can publish. */
|
|
964
|
+
can_publish: boolean;
|
|
965
|
+
/** Whether this account can attach the position to a comment. */
|
|
966
|
+
can_attach_to_comment: boolean;
|
|
967
|
+
/** Whether this account can first add analysis. */
|
|
968
|
+
can_draw_analysis: boolean;
|
|
969
|
+
/** Unavailability explanation, or null. */
|
|
970
|
+
unavailable_reason: string | null;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
/** An authoritative lifecycle segment of an order. */
|
|
974
|
+
export interface MobileServerSocialFeedActionCandidate {
|
|
975
|
+
/** Action UUID. */
|
|
976
|
+
action_id: string;
|
|
977
|
+
/** Lifecycle UUID. */
|
|
978
|
+
position_id: string;
|
|
979
|
+
/** Lifecycle action. */
|
|
980
|
+
action: MobileSocialFeedAction;
|
|
981
|
+
/** Current publishing eligibility, not proof of caller ownership. */
|
|
982
|
+
can_publish: boolean;
|
|
983
|
+
/** Publication restriction, or null when eligible. */
|
|
984
|
+
unavailable_reason: MobileSocialFeedActionUnavailableReason | null;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
/** Additional history metrics; unavailable values are not zero. */
|
|
988
|
+
export interface MobileServerSocialFeedHistoryMetrics {
|
|
989
|
+
/** Estimated liquidation price in x18, independent of event Oracle and execution prices. */
|
|
990
|
+
estimated_liquidation_price_x18: string | null;
|
|
991
|
+
/** Availability of the estimated price. */
|
|
992
|
+
liquidation_price_quality: MobileSocialFeedLiquidationPriceQuality;
|
|
993
|
+
/** Source time in milliseconds. */
|
|
994
|
+
liquidation_price_as_of_ms: number | null;
|
|
995
|
+
/** Signed funding amount in x18. */
|
|
996
|
+
funding_pnl_x18: string | null;
|
|
997
|
+
/** Funding availability. */
|
|
998
|
+
funding_quality: MobileSocialFeedPnlQuality;
|
|
999
|
+
/** Funding source time in milliseconds. */
|
|
1000
|
+
funding_as_of_ms: number | null;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/** Full position card displayed above its historical timeline. */
|
|
1004
|
+
export interface MobileServerSocialFeedPositionHistoryCard
|
|
1005
|
+
extends
|
|
1006
|
+
MobileServerSocialFeedPositionCard,
|
|
1007
|
+
MobileServerSocialFeedHistoryMetrics {}
|
|
1008
|
+
|
|
1009
|
+
/** Persisted action facts, independent of whether a feed item was published. */
|
|
1010
|
+
export interface MobileServerSocialFeedPositionAction {
|
|
1011
|
+
/** Action UUID. */
|
|
1012
|
+
id: string;
|
|
1013
|
+
/** Lifecycle UUID. */
|
|
1014
|
+
position_id: string;
|
|
1015
|
+
/** Lifecycle action. */
|
|
1016
|
+
action: MobileSocialFeedAction;
|
|
1017
|
+
/** Position direction. */
|
|
1018
|
+
direction: MobileFeedTradePositionDirection;
|
|
1019
|
+
/** Historical margin mode. */
|
|
1020
|
+
margin_mode: MobileFeedMarginMode;
|
|
1021
|
+
/** Quantity before the action, in x18. */
|
|
1022
|
+
quantity_before_x18: string;
|
|
1023
|
+
/** Quantity after the action, in x18. */
|
|
1024
|
+
quantity_after_x18: string;
|
|
1025
|
+
/** Executed quantity, in x18. */
|
|
1026
|
+
executed_quantity_x18: string;
|
|
1027
|
+
/** Actual executed notional in x18; may be unknown for liquidation. */
|
|
1028
|
+
executed_notional_x18: string | null;
|
|
1029
|
+
/** Actual execution price in x18. */
|
|
1030
|
+
average_price_x18: string | null;
|
|
1031
|
+
/** Entry price before the action, in x18. */
|
|
1032
|
+
entry_price_before_x18: string | null;
|
|
1033
|
+
/** Liquidation event Oracle price in x18. */
|
|
1034
|
+
liquidation_oracle_price_x18: string | null;
|
|
1035
|
+
/** Liquidation Oracle-based notional in x18. */
|
|
1036
|
+
liquidation_notional_x18: string | null;
|
|
1037
|
+
/** Signed realized trading PnL in x18, excluding ordinary fees and funding. */
|
|
1038
|
+
realized_pnl_delta_x18: string | null;
|
|
1039
|
+
/** Historical effective leverage. */
|
|
1040
|
+
leverage: MobileSocialFeedLeverage;
|
|
1041
|
+
/** Leverage source time in milliseconds. */
|
|
1042
|
+
leverage_at_ms: number | null;
|
|
1043
|
+
/** First event time in milliseconds. */
|
|
1044
|
+
first_event_at_ms: number;
|
|
1045
|
+
/** Last event time in milliseconds. */
|
|
1046
|
+
last_event_at_ms: number;
|
|
1047
|
+
/** Decimal-string version. */
|
|
1048
|
+
version: string;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/** Full published content appearing in a position timeline. */
|
|
1052
|
+
export type MobileServerSocialFeedHistoryTake =
|
|
1053
|
+
| MobileServerSocialFeedTradeCard
|
|
1054
|
+
| MobileServerSocialFeedPost;
|
|
1055
|
+
|
|
1056
|
+
/** A historical action or authored take; preserve service ordering. */
|
|
1057
|
+
export type MobileServerSocialFeedTimelineEntry =
|
|
1058
|
+
| {
|
|
1059
|
+
/** Action entry. */
|
|
1060
|
+
kind: 'action';
|
|
1061
|
+
/** Full action facts. */
|
|
1062
|
+
action: MobileServerSocialFeedPositionAction;
|
|
1063
|
+
/** Actually associated feed item, or null. */
|
|
1064
|
+
related_item_id: string | null;
|
|
1065
|
+
/** Full published trade card, or null. */
|
|
1066
|
+
related_take: MobileServerSocialFeedTradeCard | null;
|
|
1067
|
+
}
|
|
1068
|
+
| {
|
|
1069
|
+
/** Published take entry. */
|
|
1070
|
+
kind: 'take';
|
|
1071
|
+
/** Full published content. */
|
|
1072
|
+
item: MobileServerSocialFeedHistoryTake;
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
/** Trusted trading target; this hint does not authorize trading. */
|
|
1076
|
+
export interface MobileServerSocialFeedTradingTarget {
|
|
1077
|
+
/** Lifecycle UUID. */
|
|
1078
|
+
position_id: string;
|
|
1079
|
+
/** Parent identity. */
|
|
1080
|
+
identity_subaccount: Hex;
|
|
1081
|
+
/** Actual trading subaccount, possibly isolated. */
|
|
1082
|
+
trading_subaccount: Hex;
|
|
1083
|
+
/** Market product ID. */
|
|
1084
|
+
product_id: number;
|
|
1085
|
+
/** Margin mode. */
|
|
1086
|
+
margin_mode: MobileFeedMarginMode;
|
|
1087
|
+
/** Isolated name, or null for cross margin. */
|
|
1088
|
+
iso_subaccount_name: string | null;
|
|
1089
|
+
/** Position direction. */
|
|
1090
|
+
direction: MobileFeedTradePositionDirection;
|
|
1091
|
+
/** Source time in milliseconds. */
|
|
1092
|
+
state_as_of_ms: number;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
/** Viewing-account trading hints, not authenticated permissions. */
|
|
1096
|
+
export interface MobileServerSocialFeedTradingContext {
|
|
1097
|
+
/** Market product ID. */
|
|
1098
|
+
product_id: number;
|
|
1099
|
+
/** Suggested trade direction. */
|
|
1100
|
+
suggested_direction: MobileFeedTradePositionDirection;
|
|
1101
|
+
/** Resolution of the viewing account's positions. */
|
|
1102
|
+
resolution: MobileSocialFeedTradingResolution;
|
|
1103
|
+
/** Trusted candidates. */
|
|
1104
|
+
candidates: MobileServerSocialFeedTradingTarget[];
|
|
1105
|
+
/** Unique candidate, or null. */
|
|
1106
|
+
viewer_position_id: string | null;
|
|
1107
|
+
/** Whether the selected account has a unique reducible position. */
|
|
1108
|
+
can_reduce: boolean;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
/** Historical candle; volume is a quantity, not a price. */
|
|
1112
|
+
export interface MobileServerSocialFeedCandle {
|
|
1113
|
+
/** Candle start time in milliseconds. */
|
|
1114
|
+
timestamp_ms: number;
|
|
1115
|
+
/** Open price in x18. */
|
|
1116
|
+
open_x18: string;
|
|
1117
|
+
/** High price in x18. */
|
|
1118
|
+
high_x18: string;
|
|
1119
|
+
/** Low price in x18. */
|
|
1120
|
+
low_x18: string;
|
|
1121
|
+
/** Close price in x18. */
|
|
1122
|
+
close_x18: string;
|
|
1123
|
+
/** Base asset volume in x18. */
|
|
1124
|
+
volume_x18: string;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
/** Chart action marker with explicitly identified price basis. */
|
|
1128
|
+
export interface MobileServerSocialFeedActionMarker {
|
|
1129
|
+
/** Action UUID. */
|
|
1130
|
+
action_id: string;
|
|
1131
|
+
/** Event time in milliseconds. */
|
|
1132
|
+
timestamp_ms: number;
|
|
1133
|
+
/** Price in x18; null does not remove the action. */
|
|
1134
|
+
price_x18: string | null;
|
|
1135
|
+
/** Lifecycle action. */
|
|
1136
|
+
action: MobileSocialFeedAction;
|
|
1137
|
+
/** Direction. */
|
|
1138
|
+
direction: MobileFeedTradePositionDirection;
|
|
1139
|
+
/** Never substitute actual execution for a liquidation Oracle. */
|
|
1140
|
+
price_basis: MobileSocialFeedActionPriceBasis;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
/** Counts across the authorized position history. */
|
|
1144
|
+
export interface MobileServerSocialFeedHistorySummary {
|
|
1145
|
+
/** Action count. */
|
|
1146
|
+
action_count: number;
|
|
1147
|
+
/** Published take count. */
|
|
1148
|
+
take_count: number;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/** Estimated liquidation price and its source time. */
|
|
1152
|
+
export interface MobileServerSocialFeedEstimatedLiquidationLine {
|
|
1153
|
+
/** Estimated price in x18. */
|
|
1154
|
+
price_x18: string;
|
|
1155
|
+
/** Source time in milliseconds. */
|
|
1156
|
+
as_of_ms: number;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
/** Half-open chart range, preserved across pages. */
|
|
1160
|
+
export interface MobileServerSocialFeedChartRange {
|
|
1161
|
+
/** Inclusive start in milliseconds. */
|
|
1162
|
+
from_ms: number;
|
|
1163
|
+
/** Exclusive end in milliseconds. */
|
|
1164
|
+
to_ms: number;
|
|
1165
|
+
}
|