@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
package/src/types/clientTypes.ts
CHANGED
|
@@ -6,22 +6,39 @@ import {
|
|
|
6
6
|
MobileFeedTradePosition,
|
|
7
7
|
MobileFeedTradePositionDirection,
|
|
8
8
|
MobileNotificationCategory,
|
|
9
|
+
MobileNotificationMinTradeSizeUsd,
|
|
9
10
|
MobileNotificationPlatform,
|
|
11
|
+
MobileNotificationPositionThreshold,
|
|
12
|
+
MobileNotificationRouteName,
|
|
13
|
+
MobileNotificationTypeId,
|
|
14
|
+
MobileSocialFeedAction,
|
|
15
|
+
MobileSocialFeedActionPriceBasis,
|
|
16
|
+
MobileSocialFeedActionResolution,
|
|
17
|
+
MobileSocialFeedActionUnavailableReason,
|
|
18
|
+
MobileSocialFeedAttachmentStatus,
|
|
19
|
+
MobileSocialFeedChartDataQuality,
|
|
20
|
+
MobileSocialFeedChartInterval,
|
|
10
21
|
MobileSocialFeedCohortStatus,
|
|
11
22
|
MobileSocialFeedHistoryQuality,
|
|
12
23
|
MobileSocialFeedLeverage,
|
|
24
|
+
MobileSocialFeedLiquidationPriceQuality,
|
|
13
25
|
MobileSocialFeedMarketCategory,
|
|
26
|
+
MobileSocialFeedMention,
|
|
14
27
|
MobileSocialFeedPnlBasis,
|
|
15
28
|
MobileSocialFeedPnlMode,
|
|
16
29
|
MobileSocialFeedPnlQuality,
|
|
17
30
|
MobileSocialFeedPositionDisplayBasis,
|
|
31
|
+
MobileSocialFeedPositionResolution,
|
|
32
|
+
MobileSocialFeedPositionResolutionReason,
|
|
18
33
|
MobileSocialFeedPositionState,
|
|
34
|
+
MobileSocialFeedPresenceState,
|
|
19
35
|
MobileSocialFeedReadSessionMode,
|
|
20
36
|
MobileSocialFeedSourceCategory,
|
|
21
37
|
MobileSocialFeedTradeCardAction,
|
|
22
38
|
MobileSocialFeedTradeSizeChangeAction,
|
|
23
39
|
MobileSocialFeedTraderBadgeCode,
|
|
24
40
|
MobileSocialFeedTraderDataStatus,
|
|
41
|
+
MobileSocialFeedTradingResolution,
|
|
25
42
|
MobileSocialFeedType,
|
|
26
43
|
MobileSocialFeedUnavailableTarget,
|
|
27
44
|
} from './serverModelTypes';
|
|
@@ -287,11 +304,224 @@ export interface MobileRegisteredWallet {
|
|
|
287
304
|
lastSeenAt: number;
|
|
288
305
|
}
|
|
289
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
|
+
|
|
290
513
|
/**
|
|
291
514
|
* Common params for signed requests that authenticate as a given subaccount.
|
|
292
515
|
*/
|
|
293
|
-
export interface MobileSignedRequestParams
|
|
294
|
-
|
|
516
|
+
export interface MobileSignedRequestParams extends Subaccount, SignatureParams {
|
|
517
|
+
/**
|
|
518
|
+
* Optional nonce from {@link getMobileNonce}. For clock synchronization, use EngineWebClient.getTime()
|
|
519
|
+
* from @nadohq/engine-client as a reference; the mobile service has no time endpoint. The receive deadline
|
|
520
|
+
* must be later than mobile server time and no more than 100 seconds ahead, expressed in milliseconds.
|
|
521
|
+
* The SDK does not fetch server time automatically.
|
|
522
|
+
*/
|
|
523
|
+
nonce?: bigint;
|
|
524
|
+
}
|
|
295
525
|
|
|
296
526
|
/**
|
|
297
527
|
* Common params for the unsigned notification requests, which name their target with an Expo push token
|
|
@@ -484,11 +714,8 @@ export type GetMobileFollowingParams = GetMobileFollowListParams;
|
|
|
484
714
|
/**
|
|
485
715
|
* Params for {@link MobileClient.registerExpoToken}.
|
|
486
716
|
*/
|
|
487
|
-
export interface MobileRegisterExpoTokenParams
|
|
488
|
-
|
|
489
|
-
* Expo push token, e.g. `ExponentPushToken[...]`.
|
|
490
|
-
*/
|
|
491
|
-
expoToken: string;
|
|
717
|
+
export interface MobileRegisterExpoTokenParams
|
|
718
|
+
extends MobileSignedRequestParams, MobileWithExpoTokenParams {
|
|
492
719
|
platform: MobileNotificationPlatform;
|
|
493
720
|
/**
|
|
494
721
|
* BCP-47 locale tag, max 35 chars.
|
|
@@ -522,6 +749,67 @@ export type GetMobileNotificationPreferencesParams = MobileWithExpoTokenParams;
|
|
|
522
749
|
*/
|
|
523
750
|
export type GetMobileRegisteredWalletParams = MobileWithExpoTokenParams;
|
|
524
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
|
+
|
|
525
813
|
/** Official account-level 30-day PnL badge, independent of position PnL. */
|
|
526
814
|
export interface MobileSocialFeedTraderBadge {
|
|
527
815
|
/** Qualification tier. */
|
|
@@ -580,6 +868,8 @@ export interface MobileSocialFeedPnl {
|
|
|
580
868
|
|
|
581
869
|
/** Complete mutable position fields delivered together at one version. */
|
|
582
870
|
export interface MobileSocialFeedPositionPatch {
|
|
871
|
+
/** Additional metrics for a position history session, when supplied. */
|
|
872
|
+
currentPosition?: MobileSocialFeedHistoryMetrics;
|
|
583
873
|
/** Position lifecycle UUID. */
|
|
584
874
|
positionId: string;
|
|
585
875
|
/** Positive integer string; compare as integers without Number conversion. */
|
|
@@ -620,7 +910,7 @@ export interface MobileSocialFeedPositionCard extends MobileSocialFeedPositionPa
|
|
|
620
910
|
direction: MobileFeedTradePositionDirection;
|
|
621
911
|
}
|
|
622
912
|
|
|
623
|
-
/** Interaction counters
|
|
913
|
+
/** Interaction counters and the viewing account's relationship state. */
|
|
624
914
|
export interface MobileSocialFeedInteraction {
|
|
625
915
|
/** Number of likes. */
|
|
626
916
|
likeCount: number;
|
|
@@ -628,7 +918,7 @@ export interface MobileSocialFeedInteraction {
|
|
|
628
918
|
commentCount: number;
|
|
629
919
|
/** Number of recorded views. */
|
|
630
920
|
viewCount: number;
|
|
631
|
-
/** Null
|
|
921
|
+
/** Null when no viewing account is selected. */
|
|
632
922
|
likedByMe: boolean | null;
|
|
633
923
|
}
|
|
634
924
|
|
|
@@ -644,8 +934,8 @@ export interface MobileSocialFeedCapabilities {
|
|
|
644
934
|
|
|
645
935
|
/** Comment preview metadata for a social trade card. */
|
|
646
936
|
export interface MobileSocialFeedCommentPreview {
|
|
647
|
-
/**
|
|
648
|
-
items:
|
|
937
|
+
/** Most recent readable replies. */
|
|
938
|
+
items: MobileSocialFeedReply[];
|
|
649
939
|
/** Comment count. */
|
|
650
940
|
totalCount: number;
|
|
651
941
|
/** Comment cursor, if available. */
|
|
@@ -654,10 +944,39 @@ export interface MobileSocialFeedCommentPreview {
|
|
|
654
944
|
|
|
655
945
|
/** Exposure requirements associated with a reading session. */
|
|
656
946
|
export interface MobileSocialFeedViewTracking {
|
|
657
|
-
/**
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
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;
|
|
661
980
|
}
|
|
662
981
|
|
|
663
982
|
/** Coverage of the candidate authors in a qualification snapshot. */
|
|
@@ -682,14 +1001,14 @@ export interface MobileSocialFeedCohort {
|
|
|
682
1001
|
coverage: MobileSocialFeedCohortCoverage;
|
|
683
1002
|
}
|
|
684
1003
|
|
|
685
|
-
/** Metadata shared by
|
|
1004
|
+
/** Metadata shared by social feed content. */
|
|
686
1005
|
export interface MobileSocialFeedItemBase {
|
|
687
1006
|
/** Item UUID. */
|
|
688
1007
|
id: string;
|
|
689
1008
|
/** Whether authored analysis exists. */
|
|
690
1009
|
hasAnalysis: boolean;
|
|
691
|
-
/**
|
|
692
|
-
drawing: null;
|
|
1010
|
+
/** Parsed drawing document, or null when no drawing is readable. */
|
|
1011
|
+
drawing: MobileSocialFeedDrawing | null;
|
|
693
1012
|
/** Author identity, badge, and follow perspective. */
|
|
694
1013
|
author: MobileSocialFeedAuthor;
|
|
695
1014
|
/** Creation time in Unix milliseconds. */
|
|
@@ -700,28 +1019,34 @@ export interface MobileSocialFeedItemBase {
|
|
|
700
1019
|
version: string;
|
|
701
1020
|
/** Market metadata. */
|
|
702
1021
|
market: MobileSocialFeedMarket;
|
|
703
|
-
/** Server capability flags
|
|
1022
|
+
/** Server capability flags, subject to the corresponding write switches. */
|
|
704
1023
|
capabilities: MobileSocialFeedCapabilities;
|
|
705
1024
|
}
|
|
706
1025
|
|
|
707
|
-
/**
|
|
708
|
-
export interface
|
|
709
|
-
/**
|
|
710
|
-
|
|
711
|
-
/** Trading action. */
|
|
712
|
-
action: MobileSocialFeedTradeCardAction;
|
|
1026
|
+
/** Content shared by authored posts and trade cards. */
|
|
1027
|
+
export interface MobileSocialFeedContentBase extends MobileSocialFeedItemBase {
|
|
1028
|
+
/** Bound images in display order; empty when none. */
|
|
1029
|
+
images: MobileSocialFeedImage[];
|
|
713
1030
|
/** Card text, empty for automatic cards. */
|
|
714
1031
|
text: string;
|
|
715
|
-
/**
|
|
716
|
-
mentions:
|
|
1032
|
+
/** Mentions in the original, unmodified text. */
|
|
1033
|
+
mentions: MobileSocialFeedMention[];
|
|
717
1034
|
/** Current or frozen position display. */
|
|
718
1035
|
position: MobileSocialFeedPositionCard;
|
|
719
1036
|
/** Interaction counters. */
|
|
720
1037
|
interaction: MobileSocialFeedInteraction;
|
|
721
|
-
/**
|
|
1038
|
+
/** Readable comment preview. */
|
|
722
1039
|
commentPreview: MobileSocialFeedCommentPreview;
|
|
723
1040
|
}
|
|
724
1041
|
|
|
1042
|
+
/** Trade card with optional authored text and analysis. */
|
|
1043
|
+
export interface MobileSocialFeedTradeCard extends MobileSocialFeedContentBase {
|
|
1044
|
+
/** Card discriminant. */
|
|
1045
|
+
kind: 'trade_card';
|
|
1046
|
+
/** Trading action. */
|
|
1047
|
+
action: MobileSocialFeedTradeCardAction;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
725
1050
|
/** Fields shared by size-change and liquidation trade rows. */
|
|
726
1051
|
export interface MobileSocialFeedTradeRowBase extends MobileSocialFeedItemBase {
|
|
727
1052
|
/** Row discriminant. */
|
|
@@ -769,20 +1094,22 @@ export type MobileSocialFeedTradeRow = MobileSocialFeedTradeRowBase &
|
|
|
769
1094
|
}
|
|
770
1095
|
);
|
|
771
1096
|
|
|
772
|
-
/**
|
|
1097
|
+
/** Discriminated social feed content. */
|
|
773
1098
|
export type MobileSocialFeedItem =
|
|
774
1099
|
| MobileSocialFeedTradeCard
|
|
775
|
-
| MobileSocialFeedTradeRow
|
|
1100
|
+
| MobileSocialFeedTradeRow
|
|
1101
|
+
| MobileSocialFeedPost
|
|
1102
|
+
| MobileSocialFeedReply;
|
|
776
1103
|
|
|
777
|
-
/**
|
|
1104
|
+
/** Idle-renewed social feed reading session. Credentials and cursors must be returned unchanged. */
|
|
778
1105
|
export interface MobileSocialFeedReadSession {
|
|
779
1106
|
/** Session identifier. */
|
|
780
1107
|
sessionId: string;
|
|
781
|
-
/** Feed or
|
|
1108
|
+
/** Feed, item, or full position history session. */
|
|
782
1109
|
mode: MobileSocialFeedReadSessionMode;
|
|
783
|
-
/**
|
|
1110
|
+
/** Current idle expiration in Unix milliseconds; legitimate session requests renew it. */
|
|
784
1111
|
expiresAtMs: number;
|
|
785
|
-
/**
|
|
1112
|
+
/** Visibility requirements for explicit exposure reporting. */
|
|
786
1113
|
viewTracking: MobileSocialFeedViewTracking;
|
|
787
1114
|
/** Initial update baseline, distinct from the page cursor. */
|
|
788
1115
|
updateCursor: string | null;
|
|
@@ -824,6 +1151,10 @@ export interface MobileSocialFeedItemResponse {
|
|
|
824
1151
|
|
|
825
1152
|
/** Item delta: omitted means unchanged; explicit null clears a prior value. */
|
|
826
1153
|
export interface MobileSocialFeedItemPatch {
|
|
1154
|
+
/** Updated reply attachment; null clears it, omission leaves it unchanged. */
|
|
1155
|
+
attachedPosition?: MobileSocialFeedPositionCard | null;
|
|
1156
|
+
/** Updated reply attachment visibility. */
|
|
1157
|
+
attachmentStatus?: MobileSocialFeedAttachmentStatus;
|
|
827
1158
|
/** Current author identity, follow state, and qualification badge. */
|
|
828
1159
|
author: MobileSocialFeedAuthor;
|
|
829
1160
|
/** Target item UUID. */
|
|
@@ -944,6 +1275,12 @@ export type GetMobilePositionFeedParams = MobileSocialFeedListParams &
|
|
|
944
1275
|
export type GetMobileFeedItemParams = MobileSocialFeedReadParams & {
|
|
945
1276
|
/** Target item UUID. */
|
|
946
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;
|
|
947
1284
|
/** Preview size, 0–3. */
|
|
948
1285
|
commentPreviewLimit?: number;
|
|
949
1286
|
/** Existing session authorized for the item. */
|
|
@@ -969,3 +1306,644 @@ export type GetMobileFeedUpdatesParams = {
|
|
|
969
1306
|
/** Credential belonging to the original public session. */
|
|
970
1307
|
viewerToken: string;
|
|
971
1308
|
};
|
|
1309
|
+
|
|
1310
|
+
/** Parsed drawing; data is opaque to the SDK and may legitimately be false or zero. */
|
|
1311
|
+
export interface MobileSocialFeedDrawing {
|
|
1312
|
+
/** Already parsed drawing document; do not JSON.parse again. */
|
|
1313
|
+
data: unknown;
|
|
1314
|
+
/** Original creation time in milliseconds. */
|
|
1315
|
+
createdAtMs: number;
|
|
1316
|
+
/** Last update time in milliseconds. */
|
|
1317
|
+
updatedAtMs: number;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
/** Nonrecursive root-post preview carried by replies. */
|
|
1321
|
+
export interface MobileSocialFeedCompactCard {
|
|
1322
|
+
/** Root item UUID. */
|
|
1323
|
+
id: string;
|
|
1324
|
+
/** Root author. */
|
|
1325
|
+
author: MobileSocialFeedAuthor;
|
|
1326
|
+
/** Original text excerpt. */
|
|
1327
|
+
textExcerpt: string;
|
|
1328
|
+
/** Visible position summary, or null. */
|
|
1329
|
+
position: Pick<
|
|
1330
|
+
MobileSocialFeedPositionCard,
|
|
1331
|
+
'positionId' | 'market' | 'direction' | 'state' | 'notional'
|
|
1332
|
+
> | null;
|
|
1333
|
+
/** Whether the root has published analysis. */
|
|
1334
|
+
hasAnalysis: boolean;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/** Authored position post, including text-only, drawing-only, and combined content. */
|
|
1338
|
+
export interface MobileSocialFeedPost extends MobileSocialFeedContentBase {
|
|
1339
|
+
/** Post discriminant. */
|
|
1340
|
+
kind: 'post';
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
/** Reply with independently permissioned position attachment and nonrecursive root preview. */
|
|
1344
|
+
export interface MobileSocialFeedReply extends MobileSocialFeedItemBase {
|
|
1345
|
+
/** Reply discriminant. */
|
|
1346
|
+
kind: 'reply';
|
|
1347
|
+
/** Bound images in display order; empty when none. */
|
|
1348
|
+
images: MobileSocialFeedImage[];
|
|
1349
|
+
/** Original text. */
|
|
1350
|
+
text: string;
|
|
1351
|
+
/** Mentions in the text. */
|
|
1352
|
+
mentions: MobileSocialFeedMention[];
|
|
1353
|
+
/** Actual root item UUID. */
|
|
1354
|
+
rootItemId: string;
|
|
1355
|
+
/** Omitted for a direct reply to the root. */
|
|
1356
|
+
replyToItemId?: string;
|
|
1357
|
+
/** Author being replied to, or null. */
|
|
1358
|
+
replyToAuthor: MobileSocialFeedAuthor | null;
|
|
1359
|
+
/** Readable attachment; null when absent or unavailable. */
|
|
1360
|
+
attachedPosition: MobileSocialFeedPositionCard | null;
|
|
1361
|
+
/** Distinguishes an absent attachment from an unreadable one. */
|
|
1362
|
+
attachmentStatus: MobileSocialFeedAttachmentStatus;
|
|
1363
|
+
/** Root preview; does not register root exposure. */
|
|
1364
|
+
original: MobileSocialFeedCompactCard;
|
|
1365
|
+
/** Reply interaction state. */
|
|
1366
|
+
interaction: MobileSocialFeedInteraction;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
/** Current eligibility hints; actual writes still recheck the signed author. */
|
|
1370
|
+
export interface MobileSocialFeedPublishablePosition {
|
|
1371
|
+
/** Candidate position. */
|
|
1372
|
+
position: MobileSocialFeedPositionCard;
|
|
1373
|
+
/** Whether this account can publish. */
|
|
1374
|
+
canPublish: boolean;
|
|
1375
|
+
/** Whether this account can attach the position to a comment. */
|
|
1376
|
+
canAttachToComment: boolean;
|
|
1377
|
+
/** Whether this account can first add analysis. */
|
|
1378
|
+
canDrawAnalysis: boolean;
|
|
1379
|
+
/** Unavailability explanation, or null. */
|
|
1380
|
+
unavailableReason: string | null;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
/** An authoritative lifecycle segment of an order. */
|
|
1384
|
+
export interface MobileSocialFeedActionCandidate {
|
|
1385
|
+
/** Action UUID. */
|
|
1386
|
+
actionId: string;
|
|
1387
|
+
/** Lifecycle UUID. */
|
|
1388
|
+
positionId: string;
|
|
1389
|
+
/** Lifecycle action. */
|
|
1390
|
+
action: MobileSocialFeedAction;
|
|
1391
|
+
/** Current publishing eligibility, not proof of caller ownership. */
|
|
1392
|
+
canPublish: boolean;
|
|
1393
|
+
/** Publication restriction, or null when eligible. */
|
|
1394
|
+
unavailableReason: MobileSocialFeedActionUnavailableReason | null;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/** Additional history metrics; unavailable values are not zero. */
|
|
1398
|
+
export interface MobileSocialFeedHistoryMetrics {
|
|
1399
|
+
/** Estimated liquidation price in decimal units, independent of event Oracle and execution prices. */
|
|
1400
|
+
estimatedLiquidationPrice: BigNumber | null;
|
|
1401
|
+
/** Availability of the estimated price. */
|
|
1402
|
+
liquidationPriceQuality: MobileSocialFeedLiquidationPriceQuality;
|
|
1403
|
+
/** Source time in milliseconds. */
|
|
1404
|
+
liquidationPriceAsOfMs: number | null;
|
|
1405
|
+
/** Signed funding amount in x18. */
|
|
1406
|
+
fundingPnl: BigNumber | null;
|
|
1407
|
+
/** Funding availability. */
|
|
1408
|
+
fundingQuality: MobileSocialFeedPnlQuality;
|
|
1409
|
+
/** Funding source time in milliseconds. */
|
|
1410
|
+
fundingAsOfMs: number | null;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/** Full position card displayed above its historical timeline. */
|
|
1414
|
+
export interface MobileSocialFeedPositionHistoryCard
|
|
1415
|
+
extends MobileSocialFeedPositionCard, MobileSocialFeedHistoryMetrics {}
|
|
1416
|
+
|
|
1417
|
+
/** Persisted action facts, independent of whether a feed item was published. */
|
|
1418
|
+
export interface MobileSocialFeedPositionAction {
|
|
1419
|
+
/** Action UUID. */
|
|
1420
|
+
id: string;
|
|
1421
|
+
/** Lifecycle UUID. */
|
|
1422
|
+
positionId: string;
|
|
1423
|
+
/** Lifecycle action. */
|
|
1424
|
+
action: MobileSocialFeedAction;
|
|
1425
|
+
/** Position direction. */
|
|
1426
|
+
direction: MobileFeedTradePositionDirection;
|
|
1427
|
+
/** Historical margin mode. */
|
|
1428
|
+
marginMode: MobileFeedMarginMode;
|
|
1429
|
+
/** Quantity before the action, in x18. */
|
|
1430
|
+
quantityBefore: BigNumber;
|
|
1431
|
+
/** Quantity after the action, in x18. */
|
|
1432
|
+
quantityAfter: BigNumber;
|
|
1433
|
+
/** Executed quantity, in x18. */
|
|
1434
|
+
executedQuantity: BigNumber;
|
|
1435
|
+
/** Actual executed notional in x18; may be unknown for liquidation. */
|
|
1436
|
+
executedNotional: BigNumber | null;
|
|
1437
|
+
/** Actual execution price in decimal units. */
|
|
1438
|
+
averagePrice: BigNumber | null;
|
|
1439
|
+
/** Entry price before the action, in decimal units. */
|
|
1440
|
+
entryPriceBefore: BigNumber | null;
|
|
1441
|
+
/** Liquidation event Oracle price in decimal units. */
|
|
1442
|
+
liquidationOraclePrice: BigNumber | null;
|
|
1443
|
+
/** Liquidation Oracle-based notional in x18. */
|
|
1444
|
+
liquidationNotional: BigNumber | null;
|
|
1445
|
+
/** Signed realized trading PnL in x18, excluding ordinary fees and funding. */
|
|
1446
|
+
realizedPnlDelta: BigNumber | null;
|
|
1447
|
+
/** Historical effective leverage. */
|
|
1448
|
+
leverage: MobileSocialFeedLeverage;
|
|
1449
|
+
/** Leverage source time in milliseconds. */
|
|
1450
|
+
leverageAtMs: number | null;
|
|
1451
|
+
/** First event time in milliseconds. */
|
|
1452
|
+
firstEventAtMs: number;
|
|
1453
|
+
/** Last event time in milliseconds. */
|
|
1454
|
+
lastEventAtMs: number;
|
|
1455
|
+
/** Decimal-string version. */
|
|
1456
|
+
version: string;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
/** Full published content appearing in a position timeline. */
|
|
1460
|
+
export type MobileSocialFeedHistoryTake =
|
|
1461
|
+
| MobileSocialFeedTradeCard
|
|
1462
|
+
| MobileSocialFeedPost;
|
|
1463
|
+
|
|
1464
|
+
/** A historical action or authored take; preserve service ordering. */
|
|
1465
|
+
export type MobileSocialFeedTimelineEntry =
|
|
1466
|
+
| {
|
|
1467
|
+
/** Action entry. */
|
|
1468
|
+
kind: 'action';
|
|
1469
|
+
/** Full action facts. */
|
|
1470
|
+
action: MobileSocialFeedPositionAction;
|
|
1471
|
+
/** Actually associated feed item, or null. */
|
|
1472
|
+
relatedItemId: string | null;
|
|
1473
|
+
/** Full published trade card, or null. */
|
|
1474
|
+
relatedTake: MobileSocialFeedTradeCard | null;
|
|
1475
|
+
}
|
|
1476
|
+
| {
|
|
1477
|
+
/** Published take entry. */
|
|
1478
|
+
kind: 'take';
|
|
1479
|
+
/** Full published content. */
|
|
1480
|
+
item: MobileSocialFeedHistoryTake;
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1483
|
+
/** Trusted trading target; this hint does not authorize trading. */
|
|
1484
|
+
export interface MobileSocialFeedTradingTarget {
|
|
1485
|
+
/** Lifecycle UUID. */
|
|
1486
|
+
positionId: string;
|
|
1487
|
+
/** Parent identity. */
|
|
1488
|
+
identitySubaccount: Hex;
|
|
1489
|
+
/** Actual trading subaccount, possibly isolated. */
|
|
1490
|
+
tradingSubaccount: Hex;
|
|
1491
|
+
/** Market product ID. */
|
|
1492
|
+
productId: number;
|
|
1493
|
+
/** Margin mode. */
|
|
1494
|
+
marginMode: MobileFeedMarginMode;
|
|
1495
|
+
/** Isolated name, or null for cross margin. */
|
|
1496
|
+
isoSubaccountName: string | null;
|
|
1497
|
+
/** Position direction. */
|
|
1498
|
+
direction: MobileFeedTradePositionDirection;
|
|
1499
|
+
/** Source time in milliseconds. */
|
|
1500
|
+
stateAsOfMs: number;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
/** Viewing-account trading hints, not authenticated permissions. */
|
|
1504
|
+
export interface MobileSocialFeedTradingContext {
|
|
1505
|
+
/** Market product ID. */
|
|
1506
|
+
productId: number;
|
|
1507
|
+
/** Suggested trade direction. */
|
|
1508
|
+
suggestedDirection: MobileFeedTradePositionDirection;
|
|
1509
|
+
/** Resolution of the viewing account's positions. */
|
|
1510
|
+
resolution: MobileSocialFeedTradingResolution;
|
|
1511
|
+
/** Trusted candidates. */
|
|
1512
|
+
candidates: MobileSocialFeedTradingTarget[];
|
|
1513
|
+
/** Unique candidate, or null. */
|
|
1514
|
+
viewerPositionId: string | null;
|
|
1515
|
+
/** Whether the selected account has a unique reducible position. */
|
|
1516
|
+
canReduce: boolean;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
/** Historical candle; volume is a quantity, not a price. */
|
|
1520
|
+
export interface MobileSocialFeedCandle {
|
|
1521
|
+
/** Candle start time in milliseconds. */
|
|
1522
|
+
timestampMs: number;
|
|
1523
|
+
/** Open price in decimal units. */
|
|
1524
|
+
open: BigNumber;
|
|
1525
|
+
/** High price in decimal units. */
|
|
1526
|
+
high: BigNumber;
|
|
1527
|
+
/** Low price in decimal units. */
|
|
1528
|
+
low: BigNumber;
|
|
1529
|
+
/** Close price in decimal units. */
|
|
1530
|
+
close: BigNumber;
|
|
1531
|
+
/** Base asset volume in x18. */
|
|
1532
|
+
volume: BigNumber;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
/** Chart action marker with explicitly identified price basis. */
|
|
1536
|
+
export interface MobileSocialFeedActionMarker {
|
|
1537
|
+
/** Action UUID. */
|
|
1538
|
+
actionId: string;
|
|
1539
|
+
/** Event time in milliseconds. */
|
|
1540
|
+
timestampMs: number;
|
|
1541
|
+
/** Price in decimal units; null does not remove the action. */
|
|
1542
|
+
price: BigNumber | null;
|
|
1543
|
+
/** Lifecycle action. */
|
|
1544
|
+
action: MobileSocialFeedAction;
|
|
1545
|
+
/** Direction. */
|
|
1546
|
+
direction: MobileFeedTradePositionDirection;
|
|
1547
|
+
/** Never substitute actual execution for a liquidation Oracle. */
|
|
1548
|
+
priceBasis: MobileSocialFeedActionPriceBasis;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
/** Parameters for listing the selected account's open position candidates. */
|
|
1552
|
+
export interface GetMobileSelfFeedPositionsParams {
|
|
1553
|
+
/** Full non-isolated identity; selecting it is not authentication. */
|
|
1554
|
+
viewAs: Subaccount;
|
|
1555
|
+
/** Optional market filter. */
|
|
1556
|
+
productId?: number;
|
|
1557
|
+
/** Opaque cursor bound to the account and filters. */
|
|
1558
|
+
cursor?: string;
|
|
1559
|
+
/** Page size, 1-50; defaults to 20. */
|
|
1560
|
+
limit?: number;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
/** Parameters for resolving a slash command against the selected account. */
|
|
1564
|
+
export interface ResolveMobileFeedPositionParams {
|
|
1565
|
+
/** Required non-isolated viewing account. */
|
|
1566
|
+
viewAs: Subaccount;
|
|
1567
|
+
/** Original command, such as /position or /BTC; passed unchanged. */
|
|
1568
|
+
input: string;
|
|
1569
|
+
/** Optional market disambiguation. */
|
|
1570
|
+
productId?: number;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
/** Parameters for resolving all trusted lifecycle segments of an order. */
|
|
1574
|
+
export interface ResolveMobileFeedActionParams {
|
|
1575
|
+
/** Required order-owning identity; the caller need not own it to read. */
|
|
1576
|
+
viewAs: Subaccount;
|
|
1577
|
+
/** Order digest returned by trading. */
|
|
1578
|
+
orderDigest: Hex;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
/** Parameters for atomic text, drawing, or combined publication. */
|
|
1582
|
+
export interface MobileCreateFeedPostParams extends MobileSignedRequestParams {
|
|
1583
|
+
/** Author-scoped idempotency UUID; reuse unchanged for a retry. */
|
|
1584
|
+
clientRequestId: string;
|
|
1585
|
+
/** Lifecycle still held by the signed author. */
|
|
1586
|
+
positionId: string;
|
|
1587
|
+
/** Trusted action for a trading annotation; omit for an independent post. */
|
|
1588
|
+
actionId?: string;
|
|
1589
|
+
/** Original text, at most 2,000 code points; empty is allowed with a drawing. */
|
|
1590
|
+
text: string;
|
|
1591
|
+
/** At most ten mentions, with offsets into the original text. */
|
|
1592
|
+
mentions: MobileSocialFeedMentionParams[];
|
|
1593
|
+
/** Original JSON text, at most 256 KiB UTF-8; never reformatted by the SDK. */
|
|
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>;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
/** Parameters for first adding or replacing a drawing. Writes must be serialized by the caller. */
|
|
1634
|
+
export interface MobileFeedChartDrawingParams extends MobileSignedRequestParams {
|
|
1635
|
+
/** Author-owned item UUID. */
|
|
1636
|
+
itemId: string;
|
|
1637
|
+
/** Complete original JSON text; false and zero are valid documents. */
|
|
1638
|
+
dataJson: string;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
/** Parameters for reading a drawing with the original session or an independent account perspective. */
|
|
1642
|
+
export interface GetMobileFeedChartDrawingParams extends MobileSocialFeedReadParams {
|
|
1643
|
+
/** Parent item UUID. */
|
|
1644
|
+
itemId: string;
|
|
1645
|
+
/** If supplied, the original viewerToken is required; independent reads omit both. */
|
|
1646
|
+
sessionId?: string;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
/** Parameters for a comment thread; cursor and anchorReplyId are mutually exclusive. */
|
|
1650
|
+
export interface GetMobileFeedCommentsParams extends MobileSocialFeedReadParams {
|
|
1651
|
+
/** Root post UUID. */
|
|
1652
|
+
rootItemId: string;
|
|
1653
|
+
/** Forward or backward opaque cursor from the same session. */
|
|
1654
|
+
cursor?: string;
|
|
1655
|
+
/** Page size, 1-50; defaults to 20. */
|
|
1656
|
+
limit?: number;
|
|
1657
|
+
/** First-page reply anchor; cannot be combined with cursor. */
|
|
1658
|
+
anchorReplyId?: string;
|
|
1659
|
+
/** Reuse the original session and viewerToken when navigating or paging. */
|
|
1660
|
+
sessionId?: string;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
/** Parameters for posting a comment or reply with an optional owned position attachment. */
|
|
1664
|
+
export interface MobileCreateFeedCommentParams extends MobileSignedRequestParams {
|
|
1665
|
+
/** Author-scoped idempotency UUID. */
|
|
1666
|
+
clientRequestId: string;
|
|
1667
|
+
/** Commentable root UUID. */
|
|
1668
|
+
rootItemId: string;
|
|
1669
|
+
/** Reply within the same thread; omit to reply to the root. */
|
|
1670
|
+
replyToItemId?: string;
|
|
1671
|
+
/** Nonblank original text, at most 1,000 Unicode code points. */
|
|
1672
|
+
text: string;
|
|
1673
|
+
/** At most ten mentions into the original text. */
|
|
1674
|
+
mentions: MobileSocialFeedMentionParams[];
|
|
1675
|
+
/** Position still held by the signed author; invalid attachment rejects the whole request. */
|
|
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
|
+
|
|
1684
|
+
/** Parameters for setting or cancelling a signed user's like. */
|
|
1685
|
+
export interface MobileSetFeedLikeParams extends MobileSignedRequestParams {
|
|
1686
|
+
/** Readable, interactive item UUID. */
|
|
1687
|
+
itemId: string;
|
|
1688
|
+
/** Desired relationship state. */
|
|
1689
|
+
isLiked: boolean;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
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
|
+
*/
|
|
1696
|
+
export interface MobileRecordFeedViewsParams {
|
|
1697
|
+
/** Original reading session returned by the detail read. */
|
|
1698
|
+
sessionId: string;
|
|
1699
|
+
/** Original opaque browsing credential from that read session. */
|
|
1700
|
+
viewerToken: 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;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
/** Parameters for full position history, not just published feed items. */
|
|
1711
|
+
export interface GetMobilePositionHistoryParams extends MobileSocialFeedReadParams {
|
|
1712
|
+
/** Lifecycle UUID. */
|
|
1713
|
+
positionId: string;
|
|
1714
|
+
/** Only published takes when true; defaults to false. */
|
|
1715
|
+
takesOnly?: boolean;
|
|
1716
|
+
/** Opaque history cursor; requires the original position session and viewerToken. */
|
|
1717
|
+
cursor?: string;
|
|
1718
|
+
/** Page size, 1-50; defaults to 20. */
|
|
1719
|
+
limit?: number;
|
|
1720
|
+
/** History session; do not substitute a feed session. */
|
|
1721
|
+
sessionId?: string;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
/** Counts across the authorized position history. */
|
|
1725
|
+
export interface MobileSocialFeedHistorySummary {
|
|
1726
|
+
/** Action count. */
|
|
1727
|
+
actionCount: number;
|
|
1728
|
+
/** Published take count. */
|
|
1729
|
+
takeCount: number;
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
/** Estimated liquidation price and its source time. */
|
|
1733
|
+
export interface MobileSocialFeedEstimatedLiquidationLine {
|
|
1734
|
+
/** Decimal price. */
|
|
1735
|
+
price: BigNumber;
|
|
1736
|
+
/** Source time in milliseconds. */
|
|
1737
|
+
asOfMs: number;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
/** Half-open chart range, preserved across pages. */
|
|
1741
|
+
export interface MobileSocialFeedChartRange {
|
|
1742
|
+
/** Inclusive start in milliseconds. */
|
|
1743
|
+
fromMs: number;
|
|
1744
|
+
/** Exclusive end in milliseconds. */
|
|
1745
|
+
toMs: number;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
/** Parameters for position candles and action markers. */
|
|
1749
|
+
export interface GetMobilePositionChartParams extends MobileSocialFeedReadParams {
|
|
1750
|
+
/** Lifecycle UUID. */
|
|
1751
|
+
positionId: string;
|
|
1752
|
+
/** Original session, if reusing one; must be paired with viewerToken. */
|
|
1753
|
+
sessionId?: string;
|
|
1754
|
+
/** Candle interval. */
|
|
1755
|
+
interval: MobileSocialFeedChartInterval;
|
|
1756
|
+
/** Half-open time range; preserve it when paging. */
|
|
1757
|
+
range: MobileSocialFeedChartRange;
|
|
1758
|
+
/** Exclusive candle upper bound for subsequent pages. */
|
|
1759
|
+
beforeMs?: number;
|
|
1760
|
+
/** Candle count, 1-500; defaults to 200. */
|
|
1761
|
+
limit?: number;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
/** Unsigned, page-scoped presence registration using the original reading credential. */
|
|
1765
|
+
export interface MobilePositionPresenceParams {
|
|
1766
|
+
/** Lifecycle UUID authorized by the session. */
|
|
1767
|
+
positionId: string;
|
|
1768
|
+
/** Original reading session. */
|
|
1769
|
+
sessionId: string;
|
|
1770
|
+
/** Original browsing credential; determines visitor deduplication. */
|
|
1771
|
+
viewerToken: string;
|
|
1772
|
+
/** UUID generated per page, retained for that page's lifetime. */
|
|
1773
|
+
viewSessionId: string;
|
|
1774
|
+
/** Enter, renew, or leave the page. */
|
|
1775
|
+
state: MobileSocialFeedPresenceState;
|
|
1776
|
+
/** Self-reported display account: omission preserves it, null clears it. Not authentication. */
|
|
1777
|
+
watcherSubaccount?: Subaccount | null;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
/** Parameters for read-only watcher counts; this query never registers presence. */
|
|
1781
|
+
export interface GetMobilePositionWatchersParams {
|
|
1782
|
+
/** Lifecycle UUID. */
|
|
1783
|
+
positionId: string;
|
|
1784
|
+
/** Optional relationship perspective, not a watcher registration. */
|
|
1785
|
+
viewAs?: Subaccount;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
/** Open position candidates for a selected identity. */
|
|
1789
|
+
export interface MobileSocialFeedPositionsPage {
|
|
1790
|
+
/** Current candidates and eligibility hints. */
|
|
1791
|
+
positions: MobileSocialFeedPublishablePosition[];
|
|
1792
|
+
/** Next opaque cursor, or null. */
|
|
1793
|
+
nextCursor: string | null;
|
|
1794
|
+
/** Observation time in milliseconds. */
|
|
1795
|
+
asOfMs: number;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
/** Position command result, including normal empty/unknown outcomes. */
|
|
1799
|
+
export interface MobileSocialFeedPositionResolutionResult {
|
|
1800
|
+
/** Resolution outcome. */
|
|
1801
|
+
resolution: MobileSocialFeedPositionResolution;
|
|
1802
|
+
/** Resolved market, or null for an unknown or unconstrained market. */
|
|
1803
|
+
product: MobileSocialFeedMarket | null;
|
|
1804
|
+
/** Eligible open position candidates. */
|
|
1805
|
+
candidates: MobileSocialFeedPublishablePosition[];
|
|
1806
|
+
/** Explanation for no position or unknown market. */
|
|
1807
|
+
reason: MobileSocialFeedPositionResolutionReason | null;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
/** Trusted order actions; pending is distinct from a source failure. */
|
|
1811
|
+
export interface MobileSocialFeedActionResolutionResult {
|
|
1812
|
+
/** Requested order digest. */
|
|
1813
|
+
orderDigest: Hex;
|
|
1814
|
+
/** Ready when all currently confirmed segments have been projected. */
|
|
1815
|
+
resolution: MobileSocialFeedActionResolution;
|
|
1816
|
+
/** All trusted segments, or an empty array when pending. */
|
|
1817
|
+
actions: MobileSocialFeedActionCandidate[];
|
|
1818
|
+
/** Observation time in milliseconds. */
|
|
1819
|
+
asOfMs: number;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
/** Readable drawing and parent display version; drawing data is already parsed. */
|
|
1823
|
+
export interface MobileSocialFeedDrawingResult {
|
|
1824
|
+
/** Parent item UUID. */
|
|
1825
|
+
itemId: string;
|
|
1826
|
+
/** Current parent display version. */
|
|
1827
|
+
itemVersion: string;
|
|
1828
|
+
/** Null when the readable parent has no drawing. */
|
|
1829
|
+
drawing: MobileSocialFeedDrawing | null;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
/** Saved drawing returned by successful creation or replacement. */
|
|
1833
|
+
export interface MobileSocialFeedDrawingMutationResult {
|
|
1834
|
+
/** Parent item UUID. */
|
|
1835
|
+
itemId: string;
|
|
1836
|
+
/** Post-mutation parent display version. */
|
|
1837
|
+
itemVersion: string;
|
|
1838
|
+
/** Saved parsed drawing. */
|
|
1839
|
+
drawing: MobileSocialFeedDrawing;
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
/** Comment thread page, including both directions around an anchor. */
|
|
1843
|
+
export interface MobileSocialFeedCommentsPage {
|
|
1844
|
+
/** Requested anchor, or null when reading without one. */
|
|
1845
|
+
anchorReplyId: string | null;
|
|
1846
|
+
/** Readable replies in service order. */
|
|
1847
|
+
comments: MobileSocialFeedReply[];
|
|
1848
|
+
/** Total readable comment count. */
|
|
1849
|
+
totalCount: number;
|
|
1850
|
+
/** Forward cursor, or null. */
|
|
1851
|
+
nextCursor: string | null;
|
|
1852
|
+
/** Backward cursor, or null. */
|
|
1853
|
+
previousCursor: string | null;
|
|
1854
|
+
/** Original or newly created reading session. */
|
|
1855
|
+
readSession: MobileSocialFeedReadSession;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
/** Atomic comment publication result. */
|
|
1859
|
+
export interface MobileSocialFeedCommentResult {
|
|
1860
|
+
/** Published reply. */
|
|
1861
|
+
comment: MobileSocialFeedReply;
|
|
1862
|
+
/** Post-commit root comment count. */
|
|
1863
|
+
rootCommentCount: number;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
/** Authoritative post-mutation like state. */
|
|
1867
|
+
export interface MobileSocialFeedLikeResult {
|
|
1868
|
+
/** Item UUID. */
|
|
1869
|
+
itemId: string;
|
|
1870
|
+
/** Desired applied state. */
|
|
1871
|
+
isLiked: boolean;
|
|
1872
|
+
/** Post-mutation count. */
|
|
1873
|
+
likeCount: number;
|
|
1874
|
+
/** Item display version. */
|
|
1875
|
+
version: string;
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
/** Exposure deduplication result for the current UTC day. */
|
|
1879
|
+
export interface MobileSocialFeedViewsResult {
|
|
1880
|
+
/** Newly counted item UUIDs. */
|
|
1881
|
+
acceptedItemIds: string[];
|
|
1882
|
+
/** Already counted item UUIDs. */
|
|
1883
|
+
duplicateItemIds: string[];
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
/** Full position history and viewing-account trading hints. */
|
|
1887
|
+
export interface MobileSocialFeedPositionHistory {
|
|
1888
|
+
/** Position and additional history metrics. */
|
|
1889
|
+
position: MobileSocialFeedPositionHistoryCard;
|
|
1890
|
+
/** Whole-history counts. */
|
|
1891
|
+
summary: MobileSocialFeedHistorySummary;
|
|
1892
|
+
/** Ordered actions and takes; no synthesized items. */
|
|
1893
|
+
timeline: MobileSocialFeedTimelineEntry[];
|
|
1894
|
+
/** Next cursor, or null. */
|
|
1895
|
+
nextCursor: string | null;
|
|
1896
|
+
/** Completeness, independent of whether any items were published. */
|
|
1897
|
+
historyQuality: MobileSocialFeedHistoryQuality;
|
|
1898
|
+
/** Position-mode session for navigation, updates, and statistics. */
|
|
1899
|
+
readSession: MobileSocialFeedReadSession;
|
|
1900
|
+
/** Hints only; actual trading requires authentication. */
|
|
1901
|
+
tradingContext: MobileSocialFeedTradingContext;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
/** Candle page and event-price markers, independent of drawing data. */
|
|
1905
|
+
export interface MobileSocialFeedPositionChart {
|
|
1906
|
+
/** Candles in descending timestamp order. */
|
|
1907
|
+
candles: MobileSocialFeedCandle[];
|
|
1908
|
+
/** Actions, retaining markers whose price is unknown. */
|
|
1909
|
+
actionMarkers: MobileSocialFeedActionMarker[];
|
|
1910
|
+
/** Estimated price, never substituted for execution or Oracle event prices. */
|
|
1911
|
+
estimatedLiquidationLine: MobileSocialFeedEstimatedLiquidationLine | null;
|
|
1912
|
+
/** Exclusive candle upper bound for the next page. */
|
|
1913
|
+
nextBeforeMs: number | null;
|
|
1914
|
+
/** Observation time in milliseconds. */
|
|
1915
|
+
asOfMs: number;
|
|
1916
|
+
/** Reliability of this response. */
|
|
1917
|
+
dataQuality: MobileSocialFeedChartDataQuality;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
/** Current visitor count and self-reported public account previews. */
|
|
1921
|
+
export interface MobileSocialFeedWatchers {
|
|
1922
|
+
/** Distinct active browsing credentials, not unique accounts. */
|
|
1923
|
+
watcherCount: number;
|
|
1924
|
+
/** Deduplicated self-reported accounts; may be fewer than watcherCount. */
|
|
1925
|
+
watcherPreview: MobileSocialFeedAuthor[];
|
|
1926
|
+
/** Observation time in milliseconds. */
|
|
1927
|
+
asOfMs: number;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
/** Presence result; does not include an observation timestamp. */
|
|
1931
|
+
export interface MobileSocialFeedPresence {
|
|
1932
|
+
/** Distinct active browsing credentials. */
|
|
1933
|
+
watcherCount: number;
|
|
1934
|
+
/** Self-reported account previews, not authenticated visitors. */
|
|
1935
|
+
watcherPreview: MobileSocialFeedAuthor[];
|
|
1936
|
+
/** Recommended heartbeat cadence in seconds. */
|
|
1937
|
+
heartbeatIntervalSeconds: number;
|
|
1938
|
+
/** Remaining lease lifetime in seconds. */
|
|
1939
|
+
expiresInSeconds: number;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
/** Mention input, using the same structured subaccount convention as other signed SDK inputs. */
|
|
1943
|
+
export interface MobileSocialFeedMentionParams extends Omit<
|
|
1944
|
+
MobileSocialFeedMention,
|
|
1945
|
+
'subaccount'
|
|
1946
|
+
> {
|
|
1947
|
+
/** Mentioned identity; serialized to bytes32 for signing. */
|
|
1948
|
+
subaccount: Subaccount;
|
|
1949
|
+
}
|