@nadohq/mobile-client 0.63.0 → 0.65.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 +20 -2
- package/dist/{MobileClient-aDxiM_Kf.cjs → MobileClient-CfVZXTcz.cjs} +298 -1
- package/dist/MobileClient-CfVZXTcz.cjs.map +1 -0
- package/dist/MobileClient.cjs +1 -1
- package/dist/MobileClient.d.cts +173 -7
- package/dist/MobileClient.d.cts.map +1 -1
- package/dist/MobileClient.d.ts +173 -7
- package/dist/MobileClient.d.ts.map +1 -1
- package/dist/MobileClient.js +298 -1
- package/dist/MobileClient.js.map +1 -1
- package/dist/{MobileServerFailureError-Dd3c6P_Z.d.ts → MobileServerFailureError-BZVwlsMg.d.ts} +3 -3
- package/dist/{MobileServerFailureError-Dd3c6P_Z.d.ts.map → MobileServerFailureError-BZVwlsMg.d.ts.map} +1 -1
- package/dist/{MobileServerFailureError-Bpa_WA9f.d.cts → MobileServerFailureError-CbtK8kD4.d.cts} +3 -3
- package/dist/{MobileServerFailureError-Bpa_WA9f.d.cts.map → MobileServerFailureError-CbtK8kD4.d.cts.map} +1 -1
- 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/{buildSignedMobileRequest-NHbMAPzd.d.cts → buildSignedMobileRequest-C1v0flCR.d.cts} +2 -2
- package/dist/{buildSignedMobileRequest-NHbMAPzd.d.cts.map → buildSignedMobileRequest-C1v0flCR.d.cts.map} +1 -1
- package/dist/{buildSignedMobileRequest-Cb1T74xV.d.ts → buildSignedMobileRequest-UeeWdYGU.d.ts} +2 -2
- package/dist/{buildSignedMobileRequest-Cb1T74xV.d.ts.map → buildSignedMobileRequest-UeeWdYGU.d.ts.map} +1 -1
- package/dist/{canonicalize-BBYGh17w.d.ts → canonicalize-5eeZrkzQ.d.ts} +2 -2
- package/dist/canonicalize-5eeZrkzQ.d.ts.map +1 -0
- package/dist/{canonicalize-BF_SiNvO.d.cts → canonicalize-CBaZprTo.d.cts} +2 -2
- package/dist/canonicalize-CBaZprTo.d.cts.map +1 -0
- package/dist/{clientTypes-BWFKo9oE.d.cts → clientTypes-C9dJufxk.d.ts} +569 -25
- package/dist/clientTypes-C9dJufxk.d.ts.map +1 -0
- package/dist/{clientTypes-DCTiUV0H.d.ts → clientTypes-_mEgzmNs.d.cts} +569 -25
- package/dist/clientTypes-_mEgzmNs.d.cts.map +1 -0
- package/dist/dataMappers.cjs +488 -9
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.d.cts +190 -7
- package/dist/dataMappers.d.cts.map +1 -1
- package/dist/dataMappers.d.ts +190 -7
- package/dist/dataMappers.d.ts.map +1 -1
- package/dist/dataMappers.js +460 -10
- package/dist/dataMappers.js.map +1 -1
- package/dist/{eip712MethodByType-BSx11xG-.d.cts → eip712MethodByType-D8jLoxDu.d.cts} +2 -2
- package/dist/eip712MethodByType-D8jLoxDu.d.cts.map +1 -0
- package/dist/{eip712MethodByType-DkiAjCLs.d.ts → eip712MethodByType-DcUh8h-l.d.ts} +2 -2
- package/dist/eip712MethodByType-DcUh8h-l.d.ts.map +1 -0
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +16 -15
- package/dist/index.d.ts +16 -15
- package/dist/index.js +2 -1
- package/dist/{mobileErrorCodes-3LtreeZM.d.ts → mobileErrorCodes-CmjYEIYm.d.cts} +18 -4
- package/dist/mobileErrorCodes-CmjYEIYm.d.cts.map +1 -0
- package/dist/{mobileErrorCodes-3LtreeZM.d.cts → mobileErrorCodes-CmjYEIYm.d.ts} +18 -4
- package/dist/mobileErrorCodes-CmjYEIYm.d.ts.map +1 -0
- package/dist/{payloadHash-BOWGjqdb.d.cts → payloadHash-DhHmgRqL.d.cts} +2 -2
- package/dist/payloadHash-DhHmgRqL.d.cts.map +1 -0
- package/dist/{payloadHash-Bzf4CtjV.d.ts → payloadHash-E1_8fpLW.d.ts} +2 -2
- package/dist/payloadHash-E1_8fpLW.d.ts.map +1 -0
- package/dist/{serverBaseTypes-KREDe2M9.d.cts → serverBaseTypes-B5J1_TyC.d.cts} +2 -2
- package/dist/{serverBaseTypes-KREDe2M9.d.cts.map → serverBaseTypes-B5J1_TyC.d.cts.map} +1 -1
- package/dist/{serverBaseTypes-DWf3iGWy.d.ts → serverBaseTypes-DnLzsdm-.d.ts} +2 -2
- package/dist/{serverBaseTypes-DWf3iGWy.d.ts.map → serverBaseTypes-DnLzsdm-.d.ts.map} +1 -1
- package/dist/serverExecuteTypes-B-OJok19.d.cts +162 -0
- package/dist/serverExecuteTypes-B-OJok19.d.cts.map +1 -0
- package/dist/serverExecuteTypes-BwWGspOg.d.ts +162 -0
- package/dist/serverExecuteTypes-BwWGspOg.d.ts.map +1 -0
- package/dist/{serverModelTypes-DAqEyYtB.d.cts → serverModelTypes-CiA-dy1R.d.cts} +299 -24
- package/dist/serverModelTypes-CiA-dy1R.d.cts.map +1 -0
- package/dist/{serverModelTypes-DAqEyYtB.d.ts → serverModelTypes-CiA-dy1R.d.ts} +299 -24
- package/dist/serverModelTypes-CiA-dy1R.d.ts.map +1 -0
- package/dist/{serverQueryTypes-DNdMpmDr.d.cts → serverQueryTypes-CJcjLB7n.d.ts} +117 -5
- package/dist/serverQueryTypes-CJcjLB7n.d.ts.map +1 -0
- package/dist/{serverQueryTypes-BFdwq0Z2.d.ts → serverQueryTypes-V1f9yE7L.d.cts} +117 -5
- package/dist/serverQueryTypes-V1f9yE7L.d.cts.map +1 -0
- package/dist/{serverRequestTypes-CxDRFKfv.d.cts → serverRequestTypes-CRlkNSu5.d.cts} +77 -7
- package/dist/serverRequestTypes-CRlkNSu5.d.cts.map +1 -0
- package/dist/{serverRequestTypes-BNA7FCY6.d.ts → serverRequestTypes-DZoOhV2o.d.ts} +77 -7
- package/dist/serverRequestTypes-DZoOhV2o.d.ts.map +1 -0
- package/dist/{serverResponseGuards-Dkdok0Sm.d.cts → serverResponseGuards-BW69PS7O.d.cts} +2 -2
- package/dist/{serverResponseGuards-Dkdok0Sm.d.cts.map → serverResponseGuards-BW69PS7O.d.cts.map} +1 -1
- package/dist/{serverResponseGuards-BU1Xv_tG.d.ts → serverResponseGuards-CShiXpHT.d.ts} +2 -2
- package/dist/{serverResponseGuards-BU1Xv_tG.d.ts.map → serverResponseGuards-CShiXpHT.d.ts.map} +1 -1
- package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
- package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
- package/dist/signing/canonicalize.cjs +37 -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 +37 -0
- package/dist/signing/canonicalize.js.map +1 -1
- package/dist/signing/eip712MethodByType.cjs +5 -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 +5 -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.d.cts +1 -1
- package/dist/signing/payloadHash.d.ts +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/clientTypes.d.cts +2 -2
- package/dist/types/clientTypes.d.ts +2 -2
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +10 -9
- package/dist/types/index.d.ts +10 -9
- package/dist/types/index.js +2 -1
- package/dist/types/mobileErrorCodes.cjs +28 -0
- 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 +28 -0
- 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.map +1 -1
- package/dist/types/serverModelTypes.d.cts +2 -2
- package/dist/types/serverModelTypes.d.ts +2 -2
- 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 +1 -1
- package/dist/types/serverRequestTypes.d.ts +1 -1
- package/dist/{types-BCr2G5gS.d.cts → types-BiRmH5Iv.d.cts} +31 -7
- package/dist/types-BiRmH5Iv.d.cts.map +1 -0
- package/dist/{types-C18k-9Vy.d.ts → types-DoJuq0Ij.d.ts} +31 -7
- package/dist/types-DoJuq0Ij.d.ts.map +1 -0
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- 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 +409 -4
- package/src/dataMappers.test.ts +742 -0
- package/src/dataMappers.ts +671 -12
- package/src/signing/canonicalize.ts +53 -0
- package/src/signing/eip712MethodByType.ts +5 -0
- package/src/signing/signing.test.ts +347 -0
- package/src/signing/types.ts +57 -4
- package/src/types/MobileUnsupportedFeedItemError.ts +18 -0
- package/src/types/clientTypes.ts +645 -23
- package/src/types/index.ts +1 -0
- package/src/types/mobileErrorCodes.ts +28 -0
- package/src/types/serverExecuteTypes.ts +92 -3
- package/src/types/serverModelTypes.ts +376 -22
- package/src/types/serverQueryTypes.ts +138 -0
- package/src/types/serverRequestTypes.ts +115 -4
- package/dist/MobileClient-aDxiM_Kf.cjs.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.map +0 -1
- 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/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/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.map +0 -1
- package/dist/serverModelTypes-DAqEyYtB.d.ts.map +0 -1
- package/dist/serverQueryTypes-BFdwq0Z2.d.ts.map +0 -1
- package/dist/serverQueryTypes-DNdMpmDr.d.cts.map +0 -1
- package/dist/serverRequestTypes-BNA7FCY6.d.ts.map +0 -1
- package/dist/serverRequestTypes-CxDRFKfv.d.cts.map +0 -1
- package/dist/types-BCr2G5gS.d.cts.map +0 -1
- package/dist/types-C18k-9Vy.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-
|
|
1
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-BW69PS7O.cjs";
|
|
2
2
|
export { isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-
|
|
1
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-CShiXpHT.js";
|
|
2
2
|
export { isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/mobile-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "HTTP client for the Nado mobile service API — username claims, profiles, privacy settings, and push notification devices & preferences",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@msgpack/msgpack": "3.1.3",
|
|
45
|
-
"@nadohq/shared": "^0.
|
|
45
|
+
"@nadohq/shared": "^0.65.0",
|
|
46
46
|
"axios": "1.16.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"bignumber.js": "11.1.1",
|
|
55
55
|
"viem": "2.52.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "12b716e33133073ea5012fcbcf8f4ba2fd7335c5"
|
|
58
58
|
}
|
package/src/MobileClient.ts
CHANGED
|
@@ -21,13 +21,28 @@ import {
|
|
|
21
21
|
mapMobileProfilesIncludeToServer,
|
|
22
22
|
mapMobilePublicProfile,
|
|
23
23
|
mapMobileRegisteredWallet,
|
|
24
|
+
mapMobileSocialFeedActionResolutionResult,
|
|
25
|
+
mapMobileSocialFeedCommentResult,
|
|
26
|
+
mapMobileSocialFeedCommentsPage,
|
|
27
|
+
mapMobileSocialFeedDrawingMutationResult,
|
|
28
|
+
mapMobileSocialFeedDrawingResult,
|
|
29
|
+
mapMobileSocialFeedItem,
|
|
24
30
|
mapMobileSocialFeedItemResponse,
|
|
31
|
+
mapMobileSocialFeedLikeResult,
|
|
25
32
|
mapMobileSocialFeedListParamsToServer,
|
|
33
|
+
mapMobileSocialFeedMentionToServer,
|
|
26
34
|
mapMobileSocialFeedPage,
|
|
35
|
+
mapMobileSocialFeedPositionChart,
|
|
36
|
+
mapMobileSocialFeedPositionHistory,
|
|
37
|
+
mapMobileSocialFeedPositionResolutionResult,
|
|
38
|
+
mapMobileSocialFeedPositionsPage,
|
|
39
|
+
mapMobileSocialFeedPresence,
|
|
27
40
|
mapMobileSocialFeedRankedPage,
|
|
28
41
|
mapMobileSocialFeedReadParamsToServer,
|
|
29
42
|
mapMobileSocialFeedTopTradersPage,
|
|
30
43
|
mapMobileSocialFeedUpdates,
|
|
44
|
+
mapMobileSocialFeedViewsResult,
|
|
45
|
+
mapMobileSocialFeedWatchers,
|
|
31
46
|
} from './dataMappers';
|
|
32
47
|
import {
|
|
33
48
|
buildSignedMobileRequest,
|
|
@@ -37,6 +52,8 @@ import {
|
|
|
37
52
|
MobileSignedRequest,
|
|
38
53
|
} from './signing';
|
|
39
54
|
import {
|
|
55
|
+
GetMobileFeedChartDrawingParams,
|
|
56
|
+
GetMobileFeedCommentsParams,
|
|
40
57
|
GetMobileFeedItemParams,
|
|
41
58
|
GetMobileFeedParams,
|
|
42
59
|
GetMobileFeedUpdatesParams,
|
|
@@ -46,39 +63,65 @@ import {
|
|
|
46
63
|
GetMobileFriendsFeedParams,
|
|
47
64
|
GetMobileMarketFeedParams,
|
|
48
65
|
GetMobileNotificationPreferencesParams,
|
|
66
|
+
GetMobilePositionChartParams,
|
|
49
67
|
GetMobilePositionFeedParams,
|
|
68
|
+
GetMobilePositionHistoryParams,
|
|
69
|
+
GetMobilePositionWatchersParams,
|
|
50
70
|
GetMobileProfileFeedParams,
|
|
51
71
|
GetMobileProfilesParams,
|
|
52
72
|
GetMobileRegisteredWalletParams,
|
|
73
|
+
GetMobileSelfFeedPositionsParams,
|
|
53
74
|
GetMobileTopTradersFeedParams,
|
|
54
75
|
GetMobileUsernameAvailabilityParams,
|
|
55
76
|
MobileAvatarPreset,
|
|
56
77
|
MobileAvatarUpload,
|
|
57
78
|
MobileCreateAvatarUploadParams,
|
|
79
|
+
MobileCreateFeedCommentParams,
|
|
80
|
+
MobileCreateFeedPostParams,
|
|
81
|
+
MobileFeedChartDrawingParams,
|
|
58
82
|
MobileFeedPage,
|
|
59
83
|
MobileFollowBatchResultItem,
|
|
60
84
|
MobileFollowListPage,
|
|
61
85
|
MobileFollowMutationResult,
|
|
62
86
|
MobileNotificationPreferences,
|
|
87
|
+
MobilePositionPresenceParams,
|
|
63
88
|
MobileProfileSearchPage,
|
|
64
89
|
MobilePublicProfile,
|
|
90
|
+
MobileRecordFeedViewsParams,
|
|
65
91
|
MobileRegisteredWallet,
|
|
66
92
|
MobileRegisterExpoTokenParams,
|
|
67
93
|
MobileSetAvatarParams,
|
|
68
94
|
MobileSetBioParams,
|
|
95
|
+
MobileSetFeedLikeParams,
|
|
69
96
|
MobileSetFollowBatchParams,
|
|
70
97
|
MobileSetFollowParams,
|
|
71
98
|
MobileSetPrivateModeParams,
|
|
72
99
|
MobileSetUsernameParams,
|
|
73
100
|
MobileSignedRequestParams,
|
|
101
|
+
MobileSocialFeedActionResolutionResult,
|
|
102
|
+
MobileSocialFeedCommentResult,
|
|
103
|
+
MobileSocialFeedCommentsPage,
|
|
104
|
+
MobileSocialFeedDrawingMutationResult,
|
|
105
|
+
MobileSocialFeedDrawingResult,
|
|
106
|
+
MobileSocialFeedItem,
|
|
74
107
|
MobileSocialFeedItemResponse,
|
|
108
|
+
MobileSocialFeedLikeResult,
|
|
75
109
|
MobileSocialFeedPage,
|
|
110
|
+
MobileSocialFeedPositionChart,
|
|
111
|
+
MobileSocialFeedPositionHistory,
|
|
112
|
+
MobileSocialFeedPositionResolutionResult,
|
|
113
|
+
MobileSocialFeedPositionsPage,
|
|
114
|
+
MobileSocialFeedPresence,
|
|
76
115
|
MobileSocialFeedRankedPage,
|
|
77
116
|
MobileSocialFeedTopTradersPage,
|
|
78
117
|
MobileSocialFeedUpdates,
|
|
118
|
+
MobileSocialFeedViewsResult,
|
|
119
|
+
MobileSocialFeedWatchers,
|
|
79
120
|
MobileUnregisterExpoTokenParams,
|
|
80
121
|
MobileUpdateNotificationPreferencesParams,
|
|
81
122
|
MobileUsernameAvailability,
|
|
123
|
+
ResolveMobileFeedActionParams,
|
|
124
|
+
ResolveMobileFeedPositionParams,
|
|
82
125
|
SearchMobileProfilesParams,
|
|
83
126
|
} from './types/clientTypes';
|
|
84
127
|
import { MobileServerFailureError } from './types/MobileServerFailureError';
|
|
@@ -87,6 +130,7 @@ import {
|
|
|
87
130
|
MobileServerExecuteResult,
|
|
88
131
|
MobileServerExecuteSuccessResponse,
|
|
89
132
|
MobileServerPublicExecuteRequest,
|
|
133
|
+
MobileServerPublicExecuteSuccessResponse,
|
|
90
134
|
} from './types/serverExecuteTypes';
|
|
91
135
|
import {
|
|
92
136
|
MobileServerPublicQueryRequest,
|
|
@@ -94,6 +138,8 @@ import {
|
|
|
94
138
|
} from './types/serverQueryTypes';
|
|
95
139
|
import {
|
|
96
140
|
MobileServerExecuteRequestType,
|
|
141
|
+
MobileServerPublicExecuteRequestByType,
|
|
142
|
+
MobileServerPublicExecuteRequestType,
|
|
97
143
|
MobileServerPublicQueryRequestByType,
|
|
98
144
|
MobileServerPublicQueryRequestType,
|
|
99
145
|
} from './types/serverRequestTypes';
|
|
@@ -312,6 +358,7 @@ export class MobileClient {
|
|
|
312
358
|
* @param params - Filters, pagination, optional viewing account, and browser credential; no signing identity.
|
|
313
359
|
* @returns A fixed-session page with its ranking version and new-content watermark.
|
|
314
360
|
* @throws {MobileServerFailureError} On invalid parameters, session mismatch/expiry, or unavailable data.
|
|
361
|
+
* @throws {MobileUnsupportedFeedItemError} If the service returns an unsupported item kind.
|
|
315
362
|
*/
|
|
316
363
|
async getForYouFeed(
|
|
317
364
|
params: GetMobileForYouFeedParams = {},
|
|
@@ -332,6 +379,7 @@ export class MobileClient {
|
|
|
332
379
|
* @param params - Filters, pagination, optional viewing account, and browser credential.
|
|
333
380
|
* @returns A page with its qualification cohort; an unavailable cohort fails instead of returning an empty ranking.
|
|
334
381
|
* @throws {MobileServerFailureError} On request/session errors or unavailable cohort data.
|
|
382
|
+
* @throws {MobileUnsupportedFeedItemError} If the service returns an unsupported item kind.
|
|
335
383
|
*/
|
|
336
384
|
async getTopTradersFeed(
|
|
337
385
|
params: GetMobileTopTradersFeedParams = {},
|
|
@@ -351,6 +399,7 @@ export class MobileClient {
|
|
|
351
399
|
* @param params - Required viewing account on every request, filters, pagination, and browser credential.
|
|
352
400
|
* @returns A chronological Friends page and reading session.
|
|
353
401
|
* @throws {MobileServerFailureError} On invalid viewing account, session errors, or feed query failure.
|
|
402
|
+
* @throws {MobileUnsupportedFeedItemError} If the service returns an unsupported item kind.
|
|
354
403
|
*/
|
|
355
404
|
async getFriendsFeed(
|
|
356
405
|
params: GetMobileFriendsFeedParams,
|
|
@@ -371,6 +420,7 @@ export class MobileClient {
|
|
|
371
420
|
* @param params - Target identity, filters, pagination, and optional public viewing account.
|
|
372
421
|
* @returns An author page without main-feed ranking or cohort fields.
|
|
373
422
|
* @throws {MobileServerFailureError} On invalid parameters, session errors, or inaccessible content.
|
|
423
|
+
* @throws {MobileUnsupportedFeedItemError} If the service returns an unsupported item kind.
|
|
374
424
|
*/
|
|
375
425
|
async getProfileFeed(
|
|
376
426
|
params: GetMobileProfileFeedParams,
|
|
@@ -391,6 +441,7 @@ export class MobileClient {
|
|
|
391
441
|
* @param params - Product ID, content/size filters, pagination, and public viewing account.
|
|
392
442
|
* @returns A market page without main-feed ranking fields.
|
|
393
443
|
* @throws {MobileServerFailureError} On an unknown market, session errors, or unavailable data.
|
|
444
|
+
* @throws {MobileUnsupportedFeedItemError} If the service returns an unsupported item kind.
|
|
394
445
|
*/
|
|
395
446
|
async getMarketFeed(
|
|
396
447
|
params: GetMobileMarketFeedParams,
|
|
@@ -411,6 +462,7 @@ export class MobileClient {
|
|
|
411
462
|
* @param params - Position UUID, filters, pagination, and public viewing account.
|
|
412
463
|
* @returns A fixed-session position feed page.
|
|
413
464
|
* @throws {MobileServerFailureError} On inaccessible content, session errors, or unavailable data.
|
|
465
|
+
* @throws {MobileUnsupportedFeedItemError} If the service returns an unsupported item kind.
|
|
414
466
|
*/
|
|
415
467
|
async getPositionFeed(
|
|
416
468
|
params: GetMobilePositionFeedParams,
|
|
@@ -431,6 +483,7 @@ export class MobileClient {
|
|
|
431
483
|
* @param params - Item UUID, preview limit, and optional existing session/read identity.
|
|
432
484
|
* @returns The complete item and authorized reading session.
|
|
433
485
|
* @throws {MobileServerFailureError} On inaccessible content or session mismatch/expiry.
|
|
486
|
+
* @throws {MobileUnsupportedFeedItemError} If the service returns an unsupported item kind.
|
|
434
487
|
*/
|
|
435
488
|
async getFeedItem(
|
|
436
489
|
params: GetMobileFeedItemParams,
|
|
@@ -514,6 +567,182 @@ export class MobileClient {
|
|
|
514
567
|
return mapMobileRegisteredWallet(data);
|
|
515
568
|
}
|
|
516
569
|
|
|
570
|
+
/**
|
|
571
|
+
* Lists a selected account's current positions without signing or authenticating ownership.
|
|
572
|
+
* Publication and attachment eligibility are hints that the service rechecks on writes.
|
|
573
|
+
* @param params - Viewing subaccount, optional market filter, page size, and opaque cursor.
|
|
574
|
+
* @returns Current position candidates, their eligibility hints, the next cursor, and observation time.
|
|
575
|
+
* @throws {MobileServerFailureError} On invalid parameters, an unsupported viewing account, or unavailable
|
|
576
|
+
* position data. An account with no open positions returns an empty page instead of an error.
|
|
577
|
+
*/
|
|
578
|
+
async getSelfFeedPositions(
|
|
579
|
+
params: GetMobileSelfFeedPositionsParams,
|
|
580
|
+
): Promise<MobileSocialFeedPositionsPage> {
|
|
581
|
+
const body: MobileServerPublicQueryRequest<'self_feed_positions'> = {
|
|
582
|
+
type: 'self_feed_positions',
|
|
583
|
+
view_as: subaccountToHex(params.viewAs),
|
|
584
|
+
product_id: params.productId,
|
|
585
|
+
cursor: params.cursor,
|
|
586
|
+
limit: params.limit,
|
|
587
|
+
};
|
|
588
|
+
return mapMobileSocialFeedPositionsPage(await this.publicQuery(body));
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Resolves a slash command against a selected account without changing the caller's input.
|
|
593
|
+
* @param params - Viewing subaccount, original command text, and optional market disambiguation.
|
|
594
|
+
* @returns The resolution, nullable market, candidate positions, and reason for an empty result.
|
|
595
|
+
* @throws {MobileServerFailureError} On invalid parameters, an unsupported viewing account, or unavailable
|
|
596
|
+
* source data. Unknown markets and accounts without open positions are normal resolution results.
|
|
597
|
+
*/
|
|
598
|
+
async resolveFeedPosition(
|
|
599
|
+
params: ResolveMobileFeedPositionParams,
|
|
600
|
+
): Promise<MobileSocialFeedPositionResolutionResult> {
|
|
601
|
+
const body: MobileServerPublicQueryRequest<'resolve_feed_position'> = {
|
|
602
|
+
type: 'resolve_feed_position',
|
|
603
|
+
view_as: subaccountToHex(params.viewAs),
|
|
604
|
+
input: params.input,
|
|
605
|
+
product_id: params.productId,
|
|
606
|
+
};
|
|
607
|
+
return mapMobileSocialFeedPositionResolutionResult(
|
|
608
|
+
await this.publicQuery(body),
|
|
609
|
+
);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Resolves every trusted lifecycle segment of an order without requiring a signature.
|
|
614
|
+
* @param params - Order-owning subaccount and order digest; selecting the account is not authentication.
|
|
615
|
+
* @returns Trusted action candidates and their observation time, or a pending result with no actions.
|
|
616
|
+
* @throws {MobileServerFailureError} On invalid parameters, an inaccessible order, or unavailable source
|
|
617
|
+
* data. Pending projection is a successful result, not a source failure.
|
|
618
|
+
*/
|
|
619
|
+
async resolveFeedAction(
|
|
620
|
+
params: ResolveMobileFeedActionParams,
|
|
621
|
+
): Promise<MobileSocialFeedActionResolutionResult> {
|
|
622
|
+
const body: MobileServerPublicQueryRequest<'resolve_feed_action'> = {
|
|
623
|
+
type: 'resolve_feed_action',
|
|
624
|
+
view_as: subaccountToHex(params.viewAs),
|
|
625
|
+
order_digest: params.orderDigest,
|
|
626
|
+
};
|
|
627
|
+
return mapMobileSocialFeedActionResolutionResult(
|
|
628
|
+
await this.publicQuery(body),
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Reads a drawing publicly without issuing a reading session. Supplied sessions retain their scope.
|
|
634
|
+
* @param params - Parent item, optional viewing account, and optional original session and viewer token.
|
|
635
|
+
* @returns The parent ID and version, with a nullable drawing whose data may legitimately be false or zero.
|
|
636
|
+
* @throws {MobileServerFailureError} On invalid parameters, session mismatch or expiry, unavailable data,
|
|
637
|
+
* or `SOCIAL_FEED_DRAWING_UNAVAILABLE` when the parent is inaccessible. A readable parent without a drawing
|
|
638
|
+
* returns null. Acquire a new reading session when the original has expired.
|
|
639
|
+
*/
|
|
640
|
+
async getFeedChartDrawing(
|
|
641
|
+
params: GetMobileFeedChartDrawingParams,
|
|
642
|
+
): Promise<MobileSocialFeedDrawingResult> {
|
|
643
|
+
const body: MobileServerPublicQueryRequest<'feed_chart_drawing'> = {
|
|
644
|
+
type: 'feed_chart_drawing',
|
|
645
|
+
item_id: params.itemId,
|
|
646
|
+
session_id: params.sessionId,
|
|
647
|
+
...mapMobileSocialFeedReadParamsToServer(params),
|
|
648
|
+
};
|
|
649
|
+
return mapMobileSocialFeedDrawingResult(await this.publicQuery(body));
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Reads a comment thread with an optional anchor and bidirectional pagination.
|
|
654
|
+
* Independent reads create a public-only session; reused sessions retain their original scope.
|
|
655
|
+
* @param params - Root item, optional anchor or cursor (mutually exclusive), page size, and read perspective.
|
|
656
|
+
* Paging requires the original session and viewer token.
|
|
657
|
+
* @returns Replies, total count, forward and backward cursors, the anchor, and the actual reading session.
|
|
658
|
+
* @throws {MobileServerFailureError} On invalid parameters, session mismatch or expiry, inaccessible content,
|
|
659
|
+
* or unavailable data. Restart pagination with a new session after expiry; do not reuse the old cursor.
|
|
660
|
+
*/
|
|
661
|
+
async getFeedComments(
|
|
662
|
+
params: GetMobileFeedCommentsParams,
|
|
663
|
+
): Promise<MobileSocialFeedCommentsPage> {
|
|
664
|
+
const body: MobileServerPublicQueryRequest<'feed_comments'> = {
|
|
665
|
+
type: 'feed_comments',
|
|
666
|
+
root_item_id: params.rootItemId,
|
|
667
|
+
cursor: params.cursor,
|
|
668
|
+
limit: params.limit,
|
|
669
|
+
anchor_reply_id: params.anchorReplyId,
|
|
670
|
+
session_id: params.sessionId,
|
|
671
|
+
...mapMobileSocialFeedReadParamsToServer(params),
|
|
672
|
+
};
|
|
673
|
+
return mapMobileSocialFeedCommentsPage(await this.publicQuery(body));
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Reads the full position lifecycle and creates or reuses a position session.
|
|
678
|
+
* Unlike getPositionFeed, this includes lifecycle actions as well as published takes.
|
|
679
|
+
* @param params - Position, optional takes-only filter, pagination, and read perspective. Paging requires
|
|
680
|
+
* the original position session and viewer token, not a feed session.
|
|
681
|
+
* @returns Position metrics, ordered action/take history, summary, trading hints, cursor, and reading session.
|
|
682
|
+
* @throws {MobileServerFailureError} On invalid parameters, session mismatch or expiry, inaccessible content,
|
|
683
|
+
* or unavailable source data. Restart with a new position session after expiry.
|
|
684
|
+
* @throws {MobileUnsupportedFeedItemError} If a timeline entry or take has an unsupported kind.
|
|
685
|
+
*/
|
|
686
|
+
async getPositionHistory(
|
|
687
|
+
params: GetMobilePositionHistoryParams,
|
|
688
|
+
): Promise<MobileSocialFeedPositionHistory> {
|
|
689
|
+
const body: MobileServerPublicQueryRequest<'position_history'> = {
|
|
690
|
+
type: 'position_history',
|
|
691
|
+
position_id: params.positionId,
|
|
692
|
+
takes_only: params.takesOnly,
|
|
693
|
+
cursor: params.cursor,
|
|
694
|
+
limit: params.limit,
|
|
695
|
+
session_id: params.sessionId,
|
|
696
|
+
...mapMobileSocialFeedReadParamsToServer(params),
|
|
697
|
+
};
|
|
698
|
+
return mapMobileSocialFeedPositionHistory(await this.publicQuery(body));
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Reads candles and action markers without creating a reading session.
|
|
703
|
+
* Preserve the original range, interval, and read perspective when paging with nextBeforeMs.
|
|
704
|
+
* @param params - Position, candle interval, half-open time range, pagination, and optional original session
|
|
705
|
+
* and viewer token. An independent read omits both session credentials.
|
|
706
|
+
* @returns Candles with decimal prices and x18 volume, action markers, a nullable liquidation line, and paging metadata.
|
|
707
|
+
* @throws {MobileServerFailureError} On invalid parameters, session mismatch or expiry, inaccessible content,
|
|
708
|
+
* or wholly unavailable chart sources. Partially available data is returned with its quality indicator.
|
|
709
|
+
*/
|
|
710
|
+
async getPositionChart(
|
|
711
|
+
params: GetMobilePositionChartParams,
|
|
712
|
+
): Promise<MobileSocialFeedPositionChart> {
|
|
713
|
+
const body: MobileServerPublicQueryRequest<'position_chart'> = {
|
|
714
|
+
type: 'position_chart',
|
|
715
|
+
position_id: params.positionId,
|
|
716
|
+
session_id: params.sessionId,
|
|
717
|
+
interval: params.interval,
|
|
718
|
+
range: { from_ms: params.range.fromMs, to_ms: params.range.toMs },
|
|
719
|
+
before_ms: params.beforeMs,
|
|
720
|
+
limit: params.limit,
|
|
721
|
+
...mapMobileSocialFeedReadParamsToServer(params),
|
|
722
|
+
};
|
|
723
|
+
return mapMobileSocialFeedPositionChart(await this.publicQuery(body));
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Reads active visitor counts and self-reported account previews without registering presence.
|
|
728
|
+
* @param params - Position and optional viewing account, used only for preview relationship information.
|
|
729
|
+
* @returns The visitor count, public account previews, and observation time; previews need not match the count.
|
|
730
|
+
* @throws {MobileServerFailureError} On invalid parameters, an unavailable position, or unavailable source data.
|
|
731
|
+
*/
|
|
732
|
+
async getPositionWatchers(
|
|
733
|
+
params: GetMobilePositionWatchersParams,
|
|
734
|
+
): Promise<MobileSocialFeedWatchers> {
|
|
735
|
+
const body: MobileServerPublicQueryRequest<'position_watchers'> = {
|
|
736
|
+
type: 'position_watchers',
|
|
737
|
+
position_id: params.positionId,
|
|
738
|
+
view_as:
|
|
739
|
+
params.viewAs === undefined
|
|
740
|
+
? undefined
|
|
741
|
+
: subaccountToHex(params.viewAs),
|
|
742
|
+
};
|
|
743
|
+
return mapMobileSocialFeedWatchers(await this.publicQuery(body));
|
|
744
|
+
}
|
|
745
|
+
|
|
517
746
|
/*
|
|
518
747
|
Public executes
|
|
519
748
|
*/
|
|
@@ -561,6 +790,58 @@ export class MobileClient {
|
|
|
561
790
|
return this.publicExecute(body);
|
|
562
791
|
}
|
|
563
792
|
|
|
793
|
+
/**
|
|
794
|
+
* Reports qualified exposures without signing. Ordinary reads and root previews do not count as exposures.
|
|
795
|
+
* The caller must satisfy the session's viewTracking requirements before reporting an item.
|
|
796
|
+
* @param params - Original reading session and viewer token, plus one to fifty fully delivered, readable,
|
|
797
|
+
* interactive item IDs. The service deduplicates repeated exposures.
|
|
798
|
+
* @returns Separate lists of newly accepted and already-counted item IDs.
|
|
799
|
+
* @throws {MobileServerFailureError} On invalid parameters, session mismatch or expiry, or any ineligible item.
|
|
800
|
+
* A rejected batch is not partially counted. Acquire a new session after expiry and re-evaluate exposure eligibility.
|
|
801
|
+
*/
|
|
802
|
+
async recordFeedViews(
|
|
803
|
+
params: MobileRecordFeedViewsParams,
|
|
804
|
+
): Promise<MobileSocialFeedViewsResult> {
|
|
805
|
+
const body: MobileServerPublicExecuteRequest<'record_feed_views'> = {
|
|
806
|
+
type: 'record_feed_views',
|
|
807
|
+
session_id: params.sessionId,
|
|
808
|
+
item_ids: params.itemIds,
|
|
809
|
+
viewer_token: params.viewerToken,
|
|
810
|
+
};
|
|
811
|
+
return mapMobileSocialFeedViewsResult(await this.publicExecute(body));
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* Registers, renews, or leaves a page lease without signing or authenticating the displayed account.
|
|
816
|
+
* Omitting watcherSubaccount preserves its value; null clears it. This operation does not record item views.
|
|
817
|
+
* @param params - Authorized position, original session and viewer token, page-scoped viewSessionId,
|
|
818
|
+
* lease state, and optional self-reported display account. Retain viewSessionId for the lifetime of the page.
|
|
819
|
+
* @returns Visitor count, public previews, recommended heartbeat interval, and remaining lease lifetime.
|
|
820
|
+
* @throws {MobileServerFailureError} On invalid parameters, session mismatch or expiry, or an inaccessible
|
|
821
|
+
* position. Rejected requests leave leases unchanged; acquire a new reading session after expiry.
|
|
822
|
+
*/
|
|
823
|
+
async setPositionPresence(
|
|
824
|
+
params: MobilePositionPresenceParams,
|
|
825
|
+
): Promise<MobileSocialFeedPresence> {
|
|
826
|
+
const body: MobileServerPublicExecuteRequest<'position_presence'> = {
|
|
827
|
+
type: 'position_presence',
|
|
828
|
+
position_id: params.positionId,
|
|
829
|
+
session_id: params.sessionId,
|
|
830
|
+
view_session_id: params.viewSessionId,
|
|
831
|
+
state: params.state,
|
|
832
|
+
viewer_token: params.viewerToken,
|
|
833
|
+
...(params.watcherSubaccount === undefined
|
|
834
|
+
? {}
|
|
835
|
+
: {
|
|
836
|
+
watcher_subaccount:
|
|
837
|
+
params.watcherSubaccount === null
|
|
838
|
+
? null
|
|
839
|
+
: subaccountToHex(params.watcherSubaccount),
|
|
840
|
+
}),
|
|
841
|
+
};
|
|
842
|
+
return mapMobileSocialFeedPresence(await this.publicExecute(body));
|
|
843
|
+
}
|
|
844
|
+
|
|
564
845
|
/*
|
|
565
846
|
Signed executes
|
|
566
847
|
*/
|
|
@@ -740,6 +1021,130 @@ export class MobileClient {
|
|
|
740
1021
|
return mapMobileFollowBatchResult(data);
|
|
741
1022
|
}
|
|
742
1023
|
|
|
1024
|
+
/**
|
|
1025
|
+
* Publishes text, a drawing, or both atomically using the signed author identity.
|
|
1026
|
+
* For an idempotent retry, reuse clientRequestId and the exact original content with a valid signature.
|
|
1027
|
+
* The SDK does not trim text or reformat the signed drawing JSON.
|
|
1028
|
+
* @param params - Author subaccount and signing options, request UUID, owned position, original text and
|
|
1029
|
+
* mentions, plus an optional trusted action and original drawing JSON.
|
|
1030
|
+
* @returns The published item, including authoritative interaction state and any drawing or comment preview.
|
|
1031
|
+
* @throws {WalletNotProvidedError} If neither a linked signer nor a default wallet is configured.
|
|
1032
|
+
* @throws {MobileServerFailureError} On authentication, ownership, eligibility, content, mention, or drawing
|
|
1033
|
+
* errors, or `SOCIAL_FEED_REQUEST_CONFLICT` when a request UUID is reused with different content. Do not
|
|
1034
|
+
* change an earlier request to retry it; use a new UUID for a genuinely new publication.
|
|
1035
|
+
* @throws {MobileUnsupportedFeedItemError} If the service returns an unsupported item kind.
|
|
1036
|
+
*/
|
|
1037
|
+
async createFeedPost(
|
|
1038
|
+
params: MobileCreateFeedPostParams,
|
|
1039
|
+
): Promise<MobileSocialFeedItem> {
|
|
1040
|
+
const request = await this.getSignedRequest('create_feed_post', params, {
|
|
1041
|
+
client_request_id: params.clientRequestId,
|
|
1042
|
+
position_id: params.positionId,
|
|
1043
|
+
action_id: params.actionId,
|
|
1044
|
+
text: params.text,
|
|
1045
|
+
mentions: params.mentions.map(mapMobileSocialFeedMentionToServer),
|
|
1046
|
+
drawing_data_json: params.drawingDataJson,
|
|
1047
|
+
});
|
|
1048
|
+
return mapMobileSocialFeedItem((await this.execute(request)).item);
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* First attaches a drawing to an owned post or trade card while the author still holds its position.
|
|
1053
|
+
* The original JSON is signed unchanged; false and zero are valid drawing documents.
|
|
1054
|
+
* For an exact retry after a timeout, generate a nonce up front with {@link getMobileNonce} and reuse
|
|
1055
|
+
* that nonce and the original JSON before its receive deadline. A fresh nonce is not an exact replay.
|
|
1056
|
+
* If a retry returns `SOCIAL_FEED_DRAWING_EXISTS`, use {@link getFeedChartDrawing} to confirm that the
|
|
1057
|
+
* stored data matches the intended drawing before treating the original create as successful.
|
|
1058
|
+
* @param params - Author subaccount and signing options, parent item, and complete original drawing JSON.
|
|
1059
|
+
* @returns The parent ID and updated version together with the stored drawing.
|
|
1060
|
+
* @throws {WalletNotProvidedError} If neither a linked signer nor a default wallet is configured.
|
|
1061
|
+
* @throws {MobileServerFailureError} On authentication, ownership, eligibility, or invalid/oversized drawing
|
|
1062
|
+
* errors, an unavailable parent, or `SOCIAL_FEED_DRAWING_EXISTS` for a conflicting existing drawing.
|
|
1063
|
+
* Read the existing drawing and use updateFeedChartDrawing when replacement is intended.
|
|
1064
|
+
*/
|
|
1065
|
+
async createFeedChartDrawing(
|
|
1066
|
+
params: MobileFeedChartDrawingParams,
|
|
1067
|
+
): Promise<MobileSocialFeedDrawingMutationResult> {
|
|
1068
|
+
const request = await this.getSignedRequest(
|
|
1069
|
+
'create_feed_chart_drawing',
|
|
1070
|
+
params,
|
|
1071
|
+
{ item_id: params.itemId, data_json: params.dataJson },
|
|
1072
|
+
);
|
|
1073
|
+
return mapMobileSocialFeedDrawingMutationResult(
|
|
1074
|
+
await this.execute(request),
|
|
1075
|
+
);
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* Replaces an existing drawing, including after the associated position has closed.
|
|
1080
|
+
* Serialize writes per item and preserve the original JSON text when retrying.
|
|
1081
|
+
* @param params - Author subaccount and signing options, parent item, and complete replacement JSON.
|
|
1082
|
+
* @returns The parent ID and updated version together with the stored replacement drawing.
|
|
1083
|
+
* @throws {WalletNotProvidedError} If neither a linked signer nor a default wallet is configured.
|
|
1084
|
+
* @throws {MobileServerFailureError} On authentication, ownership, or invalid/oversized drawing errors, an
|
|
1085
|
+
* unavailable parent or drawing, or `STALE_SOCIAL_FEED_DRAWING_UPDATE`. Re-read the drawing before retrying
|
|
1086
|
+
* a stale or conflicting update instead of blindly replacing newer content.
|
|
1087
|
+
*/
|
|
1088
|
+
async updateFeedChartDrawing(
|
|
1089
|
+
params: MobileFeedChartDrawingParams,
|
|
1090
|
+
): Promise<MobileSocialFeedDrawingMutationResult> {
|
|
1091
|
+
const request = await this.getSignedRequest(
|
|
1092
|
+
'update_feed_chart_drawing',
|
|
1093
|
+
params,
|
|
1094
|
+
{ item_id: params.itemId, data_json: params.dataJson },
|
|
1095
|
+
);
|
|
1096
|
+
return mapMobileSocialFeedDrawingMutationResult(
|
|
1097
|
+
await this.execute(request),
|
|
1098
|
+
);
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Publishes a comment or reply atomically; an invalid position attachment rejects the entire request.
|
|
1103
|
+
* For an idempotent retry, reuse clientRequestId and the unmodified text, mentions, and attachment.
|
|
1104
|
+
* @param params - Author subaccount and signing options, request UUID, root item, original nonblank text
|
|
1105
|
+
* and mentions, plus an optional reply target in the same thread and currently owned position attachment.
|
|
1106
|
+
* @returns The created reply and authoritative root comment count; this write does not create a reading session.
|
|
1107
|
+
* @throws {WalletNotProvidedError} If neither a linked signer nor a default wallet is configured.
|
|
1108
|
+
* @throws {MobileServerFailureError} On authentication, inaccessible content, invalid text/mentions/reply
|
|
1109
|
+
* relationships, an ineligible attachment, or `SOCIAL_FEED_REQUEST_CONFLICT`. Correct invalid input before
|
|
1110
|
+
* a new submission, and never reuse an existing request UUID with different content.
|
|
1111
|
+
*/
|
|
1112
|
+
async createFeedComment(
|
|
1113
|
+
params: MobileCreateFeedCommentParams,
|
|
1114
|
+
): Promise<MobileSocialFeedCommentResult> {
|
|
1115
|
+
const request = await this.getSignedRequest('create_feed_comment', params, {
|
|
1116
|
+
client_request_id: params.clientRequestId,
|
|
1117
|
+
root_item_id: params.rootItemId,
|
|
1118
|
+
reply_to_item_id: params.replyToItemId,
|
|
1119
|
+
text: params.text,
|
|
1120
|
+
mentions: params.mentions.map(mapMobileSocialFeedMentionToServer),
|
|
1121
|
+
attached_position_id: params.attachedPositionId,
|
|
1122
|
+
});
|
|
1123
|
+
return mapMobileSocialFeedCommentResult(await this.execute(request));
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* Sets or clears a signed user's like without requiring an open position.
|
|
1128
|
+
* Serialize mutations per item and author. Retrying the same isLiked state with a fresh nonce is safe
|
|
1129
|
+
* when no newer change intervenes; an unchanged state does not increment the count or version again.
|
|
1130
|
+
* Pass the original nonce on a retry before its deadline to avoid overwriting a newer change from
|
|
1131
|
+
* another device. Re-read the current state if that retry conflicts.
|
|
1132
|
+
* @param params - Acting subaccount and signing options, interactive item, and desired like state.
|
|
1133
|
+
* @returns The applied like state, authoritative count, and item version after the mutation.
|
|
1134
|
+
* @throws {WalletNotProvidedError} If neither a linked signer nor a default wallet is configured.
|
|
1135
|
+
* @throws {MobileServerFailureError} On authentication errors, inaccessible or non-interactive content,
|
|
1136
|
+
* or `STALE_SOCIAL_FEED_LIKE_UPDATE`. Re-read the current state before submitting a new mutation after a conflict.
|
|
1137
|
+
*/
|
|
1138
|
+
async setFeedLike(
|
|
1139
|
+
params: MobileSetFeedLikeParams,
|
|
1140
|
+
): Promise<MobileSocialFeedLikeResult> {
|
|
1141
|
+
const request = await this.getSignedRequest('set_feed_like', params, {
|
|
1142
|
+
item_id: params.itemId,
|
|
1143
|
+
is_liked: params.isLiked,
|
|
1144
|
+
});
|
|
1145
|
+
return mapMobileSocialFeedLikeResult(await this.execute(request));
|
|
1146
|
+
}
|
|
1147
|
+
|
|
743
1148
|
/*
|
|
744
1149
|
Base Fns
|
|
745
1150
|
*/
|
|
@@ -783,9 +1188,9 @@ export class MobileClient {
|
|
|
783
1188
|
return response.data as MobileServerPublicQuerySuccessResponse<T>;
|
|
784
1189
|
}
|
|
785
1190
|
|
|
786
|
-
protected async publicExecute(
|
|
787
|
-
body:
|
|
788
|
-
): Promise<
|
|
1191
|
+
protected async publicExecute<T extends MobileServerPublicExecuteRequestType>(
|
|
1192
|
+
body: { type: T } & MobileServerPublicExecuteRequestByType[T],
|
|
1193
|
+
): Promise<MobileServerPublicExecuteSuccessResponse<T>> {
|
|
789
1194
|
const response = await this.axiosInstance.post<MobileServerExecuteResult>(
|
|
790
1195
|
`${this.opts.url}/public_execute`,
|
|
791
1196
|
body,
|
|
@@ -795,7 +1200,7 @@ export class MobileClient {
|
|
|
795
1200
|
this.checkServerStatus(response);
|
|
796
1201
|
|
|
797
1202
|
// checkServerStatus catches the failure result and throws the error, so the cast to the success response is acceptable here
|
|
798
|
-
return response.data as
|
|
1203
|
+
return response.data as MobileServerPublicExecuteSuccessResponse<T>;
|
|
799
1204
|
}
|
|
800
1205
|
|
|
801
1206
|
// `T` is inferred from the body's `type` rather than declared by the caller, for the same reason
|