@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
|
@@ -1,562 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
//#endregion
|
|
23
|
-
const require_dataMappers = require("./dataMappers.cjs");
|
|
24
|
-
const require_signing_buildSignedMobileRequest = require("./signing/buildSignedMobileRequest.cjs");
|
|
25
|
-
const require_types_MobileServerFailureError = require("./types/MobileServerFailureError.cjs");
|
|
26
|
-
const require_utils_serverResponseGuards = require("./utils/serverResponseGuards.cjs");
|
|
27
|
-
let _nadohq_shared = require("@nadohq/shared");
|
|
28
|
-
let axios = require("axios");
|
|
29
|
-
axios = __toESM(axios, 1);
|
|
30
|
-
//#region src/MobileClient.ts
|
|
31
|
-
/**
|
|
32
|
-
* Client for the Nado mobile service API: usernames, bios, avatars, public profile lookups, the global
|
|
33
|
-
* trade feed, session-based social feeds, the follower/following graph, privacy settings, and push
|
|
34
|
-
* notification device/preference management.
|
|
35
|
-
*/
|
|
36
|
-
var MobileClient = class {
|
|
37
|
-
constructor(opts) {
|
|
38
|
-
this.opts = opts;
|
|
39
|
-
this.axiosInstance = axios.default.create({
|
|
40
|
-
withCredentials: true,
|
|
41
|
-
validateStatus: () => true,
|
|
42
|
-
headers: (0, _nadohq_shared.getNadoClientTypeHeaders)(opts.clientType)
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Sets the linked signer for requests
|
|
47
|
-
*
|
|
48
|
-
* @param linkedSignerWalletClient The linkedSigner to use for all signatures. Set to null to revert to the chain signer
|
|
49
|
-
*/
|
|
50
|
-
setLinkedSigner(linkedSignerWalletClient) {
|
|
51
|
-
this.opts.linkedSignerWalletClient = linkedSignerWalletClient ?? void 0;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Returns the current server-owned avatar catalogue in display order.
|
|
55
|
-
*
|
|
56
|
-
* @throws {MobileServerFailureError} With `SERVICE_UNAVAILABLE` when avatar storage is not configured.
|
|
57
|
-
*/
|
|
58
|
-
async getAvatarPresets() {
|
|
59
|
-
return (await this.publicQuery({ type: "avatar_presets" })).presets.map(require_dataMappers.mapMobileAvatarPreset);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Checks whether a username derived from the given display name is available to claim.
|
|
63
|
-
*/
|
|
64
|
-
async getUsernameAvailability(params) {
|
|
65
|
-
const body = {
|
|
66
|
-
type: "username_availability",
|
|
67
|
-
display_name: params.displayName
|
|
68
|
-
};
|
|
69
|
-
const data = await this.publicQuery(body);
|
|
70
|
-
return {
|
|
71
|
-
username: data.username,
|
|
72
|
-
available: data.available
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Looks up public profiles, optionally with follower totals and a follow summary. Returns one profile per
|
|
77
|
-
* requested subaccount, in the requested order, so callers can correlate positionally. Every non-isolated
|
|
78
|
-
* subaccount resolves, with `username` and `displayName` `null` until a username is claimed. Private Mode
|
|
79
|
-
* does not hide the profile itself, only the account's activity.
|
|
80
|
-
*
|
|
81
|
-
* This is the only profile route, so use it for a single subaccount too. It is unsigned, which means
|
|
82
|
-
* `include.followSummary.viewAs` is an unauthenticated claim.
|
|
83
|
-
*
|
|
84
|
-
* @throws {MobileServerFailureError} With error code `INVALID_PROFILES_REQUEST` if `subaccounts` is empty,
|
|
85
|
-
* holds duplicates, or exceeds `MOBILE_PROFILES_MAX_BATCH_SIZE` (25), or `PROFILE_NOT_FOUND` if any
|
|
86
|
-
* requested subaccount — or the follow summary's `viewAs` — is in the engine-created isolated namespace.
|
|
87
|
-
* One isolated member fails the whole batch rather than being omitted.
|
|
88
|
-
*/
|
|
89
|
-
async getProfiles(params) {
|
|
90
|
-
const body = {
|
|
91
|
-
type: "profiles",
|
|
92
|
-
subaccounts: params.subaccounts.map(_nadohq_shared.subaccountToHex),
|
|
93
|
-
include: params.include ? require_dataMappers.mapMobileProfilesIncludeToServer(params.include) : void 0
|
|
94
|
-
};
|
|
95
|
-
return (await this.publicQuery(body)).profiles.map(require_dataMappers.mapMobilePublicProfile);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Searches claimed profiles by the start of their username, in ascending username order with an exact
|
|
99
|
-
* match first. Only current claimed identities match: an unnamed profile never does, and Private Mode does
|
|
100
|
-
* not hide one. Takes the same `include` as {@link MobileClient.getProfiles}, so a page can carry follower
|
|
101
|
-
* totals and a follow summary without a second request; as there, `include.followSummary.viewAs` is an
|
|
102
|
-
* unauthenticated claim on an unsigned route.
|
|
103
|
-
*
|
|
104
|
-
* Pagination is live rather than snapshot, so deduplicate matches by subaccount across pages. A cursor is
|
|
105
|
-
* bound to the query alone, so `include` and `limit` may change between pages.
|
|
106
|
-
*
|
|
107
|
-
* @throws {MobileServerFailureError} With error code `INVALID_PROFILE_SEARCH_REQUEST` if `query` is outside
|
|
108
|
-
* the username alphabet or length or `limit` is out of range (1-50, or 1-25 with an include),
|
|
109
|
-
* `INVALID_PROFILE_SEARCH_CURSOR` if the cursor is malformed or was issued for a different query (discard
|
|
110
|
-
* it and restart from the first page), or `PROFILE_NOT_FOUND` if `include.followSummary.viewAs` is in the
|
|
111
|
-
* engine-created isolated namespace.
|
|
112
|
-
*/
|
|
113
|
-
async searchProfiles(params) {
|
|
114
|
-
const body = {
|
|
115
|
-
type: "search_profiles",
|
|
116
|
-
...require_dataMappers.mapMobileProfileSearchParamsToServer(params)
|
|
117
|
-
};
|
|
118
|
-
return require_dataMappers.mapMobileProfileSearchPage(await this.publicQuery(body));
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Fetches a page of the accounts that follow the given Profile.
|
|
122
|
-
*
|
|
123
|
-
* Ordering depends on `viewAs`. With it, accounts the Viewer already follows come first, unfamiliar
|
|
124
|
-
* accounts second, and every row carries an `isFollowing`. Without it, the page is ordered by the listed
|
|
125
|
-
* relationship alone and no row carries an `isFollowing`. In both cases the newest listed relationship
|
|
126
|
-
* comes first within a group, with a bytes32 tie-break. The grouping is evaluated per request against the
|
|
127
|
-
* live graph, so following an account from inside the list moves it between groups on the next page —
|
|
128
|
-
* deduplicate by subaccount and do not re-sort locally.
|
|
129
|
-
*
|
|
130
|
-
* @throws {MobileServerFailureError} With error code `PROFILE_NOT_FOUND` if the viewed Profile or `viewAs`
|
|
131
|
-
* is isolated, `INVALID_FOLLOW_CURSOR` if the cursor is malformed or was issued for a different `viewAs`,
|
|
132
|
-
* Profile, or list direction (discard it and restart from the first page), or `INVALID_FOLLOW_LIMIT` if
|
|
133
|
-
* `limit` is outside 1–50.
|
|
134
|
-
*/
|
|
135
|
-
async getFollowers(params) {
|
|
136
|
-
const body = {
|
|
137
|
-
type: "followers",
|
|
138
|
-
...require_dataMappers.mapMobileFollowListParamsToServer(params)
|
|
139
|
-
};
|
|
140
|
-
return require_dataMappers.mapMobileFollowListPage(await this.publicQuery(body));
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Fetches a page of the accounts the given Profile follows. Ordering, cursor rules, and errors match
|
|
144
|
-
* {@link MobileClient.getFollowers}. When `viewAs` reads its own Following list every row is familiar, so
|
|
145
|
-
* every `isFollowing` is `true`.
|
|
146
|
-
*/
|
|
147
|
-
async getFollowing(params) {
|
|
148
|
-
const body = {
|
|
149
|
-
type: "following",
|
|
150
|
-
...require_dataMappers.mapMobileFollowListParamsToServer(params)
|
|
151
|
-
};
|
|
152
|
-
return require_dataMappers.mapMobileFollowListPage(await this.publicQuery(body));
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Fetches a page of the global trade feed: public perpetual trades, newest first, optionally filtered by a
|
|
156
|
-
* whole-dollar minimum notional (omitted means unfiltered). Trades by subaccounts that have not claimed a
|
|
157
|
-
* username are included with `null` name fields; only private accounts are filtered out. The feed is
|
|
158
|
-
* best-effort rather than authoritative history, and pagination is live (not snapshot), so deduplicate pages
|
|
159
|
-
* by {@link MobileFeedTrade.orderDigest}.
|
|
160
|
-
*
|
|
161
|
-
* @throws {MobileServerFailureError} With error code `INVALID_FEED_FILTER` if `minimumNotional` or
|
|
162
|
-
* `limit` is outside its allowed domain (fix the request; do not retry unchanged), or
|
|
163
|
-
* `INVALID_FEED_CURSOR` if the cursor is malformed or was issued for a different `minimumNotional`
|
|
164
|
-
* (discard the cursor and restart from the first page).
|
|
165
|
-
*/
|
|
166
|
-
async getFeed(params = {}) {
|
|
167
|
-
const body = {
|
|
168
|
-
type: "feed",
|
|
169
|
-
minimum_notional: params.minimumNotional,
|
|
170
|
-
limit: params.limit,
|
|
171
|
-
cursor: params.cursor
|
|
172
|
-
};
|
|
173
|
-
return require_dataMappers.mapMobileFeedPage(await this.publicQuery(body));
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Fetches chronological For You recommendations with server-side author/thread constraints.
|
|
177
|
-
* Always public, with optional viewAs for relationship state. Preserve the session, viewAs, filters, and limit
|
|
178
|
-
* when paging, including through empty pages with a nextCursor. A 6312 error requires a refresh.
|
|
179
|
-
* @param params - Filters, pagination, optional viewing account, and browser credential; no signing identity.
|
|
180
|
-
* @returns A fixed-session page with its ranking version and new-content watermark.
|
|
181
|
-
* @throws {MobileServerFailureError} On invalid parameters, session mismatch/expiry, or unavailable data.
|
|
182
|
-
*/
|
|
183
|
-
async getForYouFeed(params = {}) {
|
|
184
|
-
const body = {
|
|
185
|
-
type: "for_you_feed",
|
|
186
|
-
market_category: params.marketCategory,
|
|
187
|
-
...require_dataMappers.mapMobileSocialFeedListParamsToServer(params),
|
|
188
|
-
...require_dataMappers.mapMobileSocialFeedReadParamsToServer(params)
|
|
189
|
-
};
|
|
190
|
-
return require_dataMappers.mapMobileSocialFeedRankedPage(await this.publicQuery(body));
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Fetches chronological content by qualified Top Traders, with official account PnL badges.
|
|
194
|
-
* Always public; neither a wallet nor one-click trading setup is required.
|
|
195
|
-
* @param params - Filters, pagination, optional viewing account, and browser credential.
|
|
196
|
-
* @returns A page with its qualification cohort; an unavailable cohort fails instead of returning an empty ranking.
|
|
197
|
-
* @throws {MobileServerFailureError} On request/session errors or unavailable cohort data.
|
|
198
|
-
*/
|
|
199
|
-
async getTopTradersFeed(params = {}) {
|
|
200
|
-
const body = {
|
|
201
|
-
type: "top_traders_feed",
|
|
202
|
-
market_category: params.marketCategory,
|
|
203
|
-
...require_dataMappers.mapMobileSocialFeedListParamsToServer(params),
|
|
204
|
-
...require_dataMappers.mapMobileSocialFeedReadParamsToServer(params)
|
|
205
|
-
};
|
|
206
|
-
return require_dataMappers.mapMobileSocialFeedTopTradersPage(await this.publicQuery(body));
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Fetches public content by authors followed by viewAs, without a signature. One-way following is sufficient.
|
|
210
|
-
* @param params - Required viewing account on every request, filters, pagination, and browser credential.
|
|
211
|
-
* @returns A chronological Friends page and reading session.
|
|
212
|
-
* @throws {MobileServerFailureError} On invalid viewing account, session errors, or feed query failure.
|
|
213
|
-
*/
|
|
214
|
-
async getFriendsFeed(params) {
|
|
215
|
-
const body = {
|
|
216
|
-
type: "friends_feed",
|
|
217
|
-
market_category: params.marketCategory,
|
|
218
|
-
...require_dataMappers.mapMobileSocialFeedListParamsToServer(params),
|
|
219
|
-
view_as: (0, _nadohq_shared.subaccountToHex)(params.viewAs),
|
|
220
|
-
viewer_token: params.viewerToken
|
|
221
|
-
};
|
|
222
|
-
return require_dataMappers.mapMobileSocialFeedRankedPage(await this.publicQuery(body));
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Fetches an author's content visible to viewAs, including that account's own hidden content.
|
|
226
|
-
* @param params - Target identity, filters, pagination, and optional public viewing account.
|
|
227
|
-
* @returns An author page without main-feed ranking or cohort fields.
|
|
228
|
-
* @throws {MobileServerFailureError} On invalid parameters, session errors, or inaccessible content.
|
|
229
|
-
*/
|
|
230
|
-
async getProfileFeed(params) {
|
|
231
|
-
const body = {
|
|
232
|
-
type: "profile_feed",
|
|
233
|
-
subaccount: (0, _nadohq_shared.subaccountToHex)(params.subaccount),
|
|
234
|
-
market_category: params.marketCategory,
|
|
235
|
-
...require_dataMappers.mapMobileSocialFeedListParamsToServer(params),
|
|
236
|
-
...require_dataMappers.mapMobileSocialFeedReadParamsToServer(params)
|
|
237
|
-
};
|
|
238
|
-
return require_dataMappers.mapMobileSocialFeedPage(await this.publicQuery(body));
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Fetches published content for one market.
|
|
242
|
-
* @param params - Product ID, content/size filters, pagination, and public viewing account.
|
|
243
|
-
* @returns A market page without main-feed ranking fields.
|
|
244
|
-
* @throws {MobileServerFailureError} On an unknown market, session errors, or unavailable data.
|
|
245
|
-
*/
|
|
246
|
-
async getMarketFeed(params) {
|
|
247
|
-
const body = {
|
|
248
|
-
type: "market_feed",
|
|
249
|
-
product_id: params.productId,
|
|
250
|
-
...require_dataMappers.mapMobileSocialFeedListParamsToServer(params),
|
|
251
|
-
...require_dataMappers.mapMobileSocialFeedReadParamsToServer(params)
|
|
252
|
-
};
|
|
253
|
-
return require_dataMappers.mapMobileSocialFeedPage(await this.publicQuery(body));
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Fetches already published content for a position lifecycle. This is not full position history
|
|
257
|
-
* and includes hidden content owned by viewAs under account_view. It does not recreate suppressed activity.
|
|
258
|
-
* @param params - Position UUID, filters, pagination, and public viewing account.
|
|
259
|
-
* @returns A fixed-session position feed page.
|
|
260
|
-
* @throws {MobileServerFailureError} On inaccessible content, session errors, or unavailable data.
|
|
261
|
-
*/
|
|
262
|
-
async getPositionFeed(params) {
|
|
263
|
-
const body = {
|
|
264
|
-
type: "position_feed",
|
|
265
|
-
position_id: params.positionId,
|
|
266
|
-
...require_dataMappers.mapMobileSocialFeedListParamsToServer(params),
|
|
267
|
-
...require_dataMappers.mapMobileSocialFeedReadParamsToServer(params)
|
|
268
|
-
};
|
|
269
|
-
return require_dataMappers.mapMobileSocialFeedPage(await this.publicQuery(body));
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Reads one item visible to viewAs, including that account's own hidden content.
|
|
273
|
-
* Creates an item session directly when sessionId is omitted.
|
|
274
|
-
* @param params - Item UUID, preview limit, and optional existing session/read identity.
|
|
275
|
-
* @returns The complete item and authorized reading session.
|
|
276
|
-
* @throws {MobileServerFailureError} On inaccessible content or session mismatch/expiry.
|
|
277
|
-
*/
|
|
278
|
-
async getFeedItem(params) {
|
|
279
|
-
const body = {
|
|
280
|
-
type: "feed_item",
|
|
281
|
-
item_id: params.itemId,
|
|
282
|
-
comment_preview_limit: params.commentPreviewLimit,
|
|
283
|
-
session_id: params.sessionId,
|
|
284
|
-
...require_dataMappers.mapMobileSocialFeedReadParamsToServer(params)
|
|
285
|
-
};
|
|
286
|
-
return require_dataMappers.mapMobileSocialFeedItemResponse(await this.publicQuery(body));
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Polls authorized visible items and positions without inserting or reordering list members.
|
|
290
|
-
* Increment requestSeq across the entire session, including viewport changes; never reset it for a new viewport.
|
|
291
|
-
* Accept only the current session and viewportRevision's latest requestSeq; discard stale patches and cursors together.
|
|
292
|
-
* Updates currently always return reset=true. Apply current author details, follow state, and badges even if the item version is unchanged.
|
|
293
|
-
* Null patches clear values;
|
|
294
|
-
* omitted fields leave them unchanged. Stop polling off-screen and refresh on error 6312.
|
|
295
|
-
* @param params - Session, visible IDs, update baseline, sequence, and matching read identity.
|
|
296
|
-
* @returns Item/position patches, revoked targets, and a new-content hint.
|
|
297
|
-
* @throws {MobileServerFailureError} On invalid or unauthorized targets, session expiry, or unavailable data.
|
|
298
|
-
*/
|
|
299
|
-
async getFeedUpdates(params) {
|
|
300
|
-
const body = {
|
|
301
|
-
type: "feed_updates",
|
|
302
|
-
session_id: params.sessionId,
|
|
303
|
-
visible_item_ids: params.visibleItemIds,
|
|
304
|
-
visible_position_ids: params.visiblePositionIds,
|
|
305
|
-
update_cursor: params.updateCursor,
|
|
306
|
-
viewport_revision: params.viewportRevision,
|
|
307
|
-
request_seq: params.requestSeq,
|
|
308
|
-
viewer_token: params.viewerToken
|
|
309
|
-
};
|
|
310
|
-
return require_dataMappers.mapMobileSocialFeedUpdates(await this.publicQuery(body));
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Fetches the push notification preferences of the wallet that owns the given Expo push token. Unsigned —
|
|
314
|
-
* the token identifies the wallet on its own. Falls back to the backend's defaults if the wallet has never
|
|
315
|
-
* updated its preferences.
|
|
316
|
-
*
|
|
317
|
-
* @throws {MobileServerFailureError} With error code `INVALID_EXPO_TOKEN` if the token is malformed, or is
|
|
318
|
-
* not currently registered to a wallet.
|
|
319
|
-
*/
|
|
320
|
-
async getNotificationPreferences(params) {
|
|
321
|
-
const body = {
|
|
322
|
-
type: "notification_preferences",
|
|
323
|
-
expo_token: params.expoToken
|
|
324
|
-
};
|
|
325
|
-
return require_dataMappers.mapMobileNotificationPreferences((await this.publicQuery(body)).preferences);
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Resolves the wallet that an Expo push token is currently registered to, along with the redacted metadata
|
|
329
|
-
* of the device that registered it. Unsigned — the token identifies the wallet on its own. Use it to check
|
|
330
|
-
* whether a locally held token is still active and which wallet currently owns it, since registering the
|
|
331
|
-
* same token under another wallet transfers ownership.
|
|
332
|
-
*
|
|
333
|
-
* @throws {MobileServerFailureError} With error code `INVALID_EXPO_TOKEN` if the token is malformed, or is
|
|
334
|
-
* not currently registered to a wallet — including a token that was unregistered. The backend does not
|
|
335
|
-
* distinguish those cases.
|
|
336
|
-
*/
|
|
337
|
-
async getRegisteredWallet(params) {
|
|
338
|
-
const body = {
|
|
339
|
-
type: "registered_wallet",
|
|
340
|
-
expo_token: params.expoToken
|
|
341
|
-
};
|
|
342
|
-
return require_dataMappers.mapMobileRegisteredWallet(await this.publicQuery(body));
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Unregisters an Expo push token, stopping delivery to that device. Unsigned, so it still works at logout
|
|
346
|
-
* when a wallet signature may no longer be obtainable. Idempotent: unregistering an inactive or unknown
|
|
347
|
-
* well-formed token succeeds.
|
|
348
|
-
*
|
|
349
|
-
* A registration that commits after this call re-activates the token, so stop or await any in-flight
|
|
350
|
-
* {@link MobileClient.registerExpoToken} before unregistering.
|
|
351
|
-
*
|
|
352
|
-
* @throws {MobileServerFailureError} With error code `INVALID_EXPO_TOKEN` if the token is malformed.
|
|
353
|
-
*/
|
|
354
|
-
async unregisterExpoToken(params) {
|
|
355
|
-
const body = {
|
|
356
|
-
type: "unregister_expo_token",
|
|
357
|
-
expo_token: params.expoToken
|
|
358
|
-
};
|
|
359
|
-
return this.publicExecute(body);
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Replaces the push notification preferences of the wallet that owns the given Expo push token. Possession
|
|
363
|
-
* of an active token is the credential rather than a signature, so anyone holding the token can overwrite
|
|
364
|
-
* that wallet's preferences. The backend requires `schemaVersion` of 1, exactly one entry per known
|
|
365
|
-
* category, and empty `scopes` on every entry.
|
|
366
|
-
*
|
|
367
|
-
* Writes are last-write-wins on commit order rather than ordered by a client nonce, so callers must
|
|
368
|
-
* serialize their own preference writes.
|
|
369
|
-
*
|
|
370
|
-
* @throws {MobileServerFailureError} With error code `INVALID_PREFERENCES` if those rules are violated, or
|
|
371
|
-
* `INVALID_EXPO_TOKEN` if the token is malformed or is not currently registered to a wallet.
|
|
372
|
-
*/
|
|
373
|
-
async updateNotificationPreferences(params) {
|
|
374
|
-
const body = {
|
|
375
|
-
type: "update_preferences",
|
|
376
|
-
expo_token: params.expoToken,
|
|
377
|
-
preferences: require_dataMappers.mapMobileNotificationPreferencesToServer(params.preferences)
|
|
378
|
-
};
|
|
379
|
-
return this.publicExecute(body);
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* Updates the biography, or clears it when the text is whitespace-only.
|
|
383
|
-
*
|
|
384
|
-
* Serialize this with {@link MobileClient.setAvatar}, {@link MobileClient.setUsername} and
|
|
385
|
-
* {@link MobileClient.setPrivateMode} for the same subaccount: all share the identity update nonce.
|
|
386
|
-
*
|
|
387
|
-
* @throws {MobileServerFailureError} With `INVALID_BIO` for exceeding `MOBILE_BIO_MAX_LENGTH` or null
|
|
388
|
-
* characters, `INVALID_IDENTITY_TARGET` for an isolated subaccount, or `STALE_IDENTITY_UPDATE` when a
|
|
389
|
-
* later write has committed (re-read the profile before retrying).
|
|
390
|
-
*/
|
|
391
|
-
async setBio(params) {
|
|
392
|
-
const signedRequest = await this.getSignedRequest("set_bio", params, { bio: params.bio });
|
|
393
|
-
return this.execute(signedRequest);
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Creates a short-lived upload grant. The caller uploads an image meeting {@link MobileAvatarUpload}'s requirements;
|
|
397
|
-
* file access and transport remain platform-specific. This does not change the saved avatar.
|
|
398
|
-
*
|
|
399
|
-
* @throws {MobileServerFailureError} With `INVALID_AVATAR` for a zero or oversized upload,
|
|
400
|
-
* `INVALID_IDENTITY_TARGET` for an isolated subaccount, or `SERVICE_UNAVAILABLE` when storage is unavailable.
|
|
401
|
-
*/
|
|
402
|
-
async createAvatarUpload(params) {
|
|
403
|
-
const signedRequest = await this.getSignedRequest("create_avatar_upload", params, { content_length: params.contentLength });
|
|
404
|
-
return require_dataMappers.mapMobileAvatarUpload(await this.execute(signedRequest));
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Publishes a preset/staged upload, or clears the saved avatar when avatar is null.
|
|
408
|
-
* Uploaded JPEG/PNG images must be square, at most 4096 × 4096 pixels, and within
|
|
409
|
-
* `MOBILE_AVATAR_MAX_UPLOAD_BYTES`. A successful PUT can still fail this publication check.
|
|
410
|
-
*
|
|
411
|
-
* Serialize identity writes for the same subaccount; see {@link MobileClient.setBio}.
|
|
412
|
-
*
|
|
413
|
-
* @throws {MobileServerFailureError} With `INVALID_AVATAR` for an invalid preset, staging key, or image,
|
|
414
|
-
* `INVALID_IDENTITY_TARGET` for an isolated subaccount, `SERVICE_UNAVAILABLE` when storage is unavailable,
|
|
415
|
-
* or `STALE_IDENTITY_UPDATE` when a later write has committed (re-read the profile before retrying).
|
|
416
|
-
*/
|
|
417
|
-
async setAvatar(params) {
|
|
418
|
-
const signedRequest = await this.getSignedRequest("set_avatar", params, { avatar: require_dataMappers.mapMobileAvatarSelectionToServer(params.avatar) });
|
|
419
|
-
return this.execute(signedRequest);
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* Sets a subaccount's username, derived from the given display name. Upserts: the same call claims a first
|
|
423
|
-
* username and renames an existing one, so callers never need to read the current identity first.
|
|
424
|
-
*
|
|
425
|
-
* Serialize identity writes for the same subaccount; see {@link MobileClient.setBio}.
|
|
426
|
-
*
|
|
427
|
-
* @throws {MobileServerFailureError} With error code `INVALID_DISPLAY_NAME` if the display name violates
|
|
428
|
-
* `MOBILE_DISPLAY_NAME_PATTERN`, `USERNAME_UNAVAILABLE` if the derived username is reserved or already
|
|
429
|
-
* taken by another subaccount, `INVALID_IDENTITY_TARGET` if the sender is in the engine-created isolated
|
|
430
|
-
* namespace, or `STALE_IDENTITY_UPDATE` if another identity write for this subaccount committed with a
|
|
431
|
-
* later nonce (re-read the identity before retrying).
|
|
432
|
-
*/
|
|
433
|
-
async setUsername(params) {
|
|
434
|
-
const signedRequest = await this.getSignedRequest("set_username", params, { display_name: params.displayName });
|
|
435
|
-
return this.execute(signedRequest);
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Sets whether a subaccount's profile is private.
|
|
439
|
-
* Serialize identity writes for the same subaccount; see {@link MobileClient.setBio}.
|
|
440
|
-
*/
|
|
441
|
-
async setPrivateMode(params) {
|
|
442
|
-
const signedRequest = await this.getSignedRequest("set_private_mode", params, { private_mode: params.privateMode });
|
|
443
|
-
return this.execute(signedRequest);
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Registers an Expo push token for the wallet, transferring active ownership of the token if another
|
|
447
|
-
* wallet had registered it. Idempotent per `(wallet, token)`.
|
|
448
|
-
*
|
|
449
|
-
* @throws {MobileServerFailureError} With error code `INVALID_EXPO_TOKEN` if the token is not a valid Expo
|
|
450
|
-
* push token, or `INVALID_DEVICE_METADATA` if `locale` (max 35 chars) or `appVersion` (max 64 chars) is
|
|
451
|
-
* too long.
|
|
452
|
-
*/
|
|
453
|
-
async registerExpoToken(params) {
|
|
454
|
-
const signedRequest = await this.getSignedRequest("register_expo_token", params, {
|
|
455
|
-
expo_token: params.expoToken,
|
|
456
|
-
platform: params.platform,
|
|
457
|
-
locale: params.locale ?? null,
|
|
458
|
-
app_version: params.appVersion ?? null
|
|
459
|
-
});
|
|
460
|
-
return this.execute(signedRequest);
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* Sets whether the signing subaccount follows a Profile. Both directions are idempotent: following again
|
|
464
|
-
* keeps the original relationship creation time, so it does not move the account in recency order, and
|
|
465
|
-
* unfollowing a relationship that does not exist succeeds with `isFollowing: false`. Unfollowing deletes
|
|
466
|
-
* the relationship rather than deactivating it, so a later follow gets a new creation time and moves the
|
|
467
|
-
* account to the front of recency order.
|
|
468
|
-
*
|
|
469
|
-
* Only `isFollowing: true` is checked against the canonical Query DB subaccount index, so unfollowing still
|
|
470
|
-
* works while that index lags.
|
|
471
|
-
*
|
|
472
|
-
* @throws {MobileServerFailureError} With error code `INVALID_FOLLOW_TARGET` if the target is the sender or
|
|
473
|
-
* either party is isolated, `FOLLOWER_NOT_ELIGIBLE` if the sender is not yet in the canonical Query DB
|
|
474
|
-
* subaccount index, or `FOLLOWING_NOT_FOUND` if the target is not. Both index errors are transient for an
|
|
475
|
-
* account that is being recorded, so they are retryable after catch-up — unlike `INVALID_FOLLOW_TARGET`.
|
|
476
|
-
*/
|
|
477
|
-
async setFollow(params) {
|
|
478
|
-
const signedRequest = await this.getSignedRequest("set_follow", params, {
|
|
479
|
-
subaccount: (0, _nadohq_shared.subaccountToHex)(params.target),
|
|
480
|
-
is_following: params.isFollowing
|
|
481
|
-
});
|
|
482
|
-
return require_dataMappers.mapMobileFollowMutationResult(await this.execute(signedRequest));
|
|
483
|
-
}
|
|
484
|
-
/**
|
|
485
|
-
* Sets whether the signing subaccount follows each of up to `MOBILE_FOLLOW_BATCH_MAX_SIZE` (25) Profiles in
|
|
486
|
-
* one signed request, which costs far less of the shared IP rate limit than one {@link MobileClient.setFollow}
|
|
487
|
-
* per target. The server validates the whole list before writing and commits every target in one database
|
|
488
|
-
* transaction, so the batch either fully applies or changes nothing. Each target has the same idempotent
|
|
489
|
-
* semantics as `setFollow`, so resending a batch is safe.
|
|
490
|
-
*
|
|
491
|
-
* Targets are lowercased before signing but not deduplicated, and two spellings of one subaccount are a
|
|
492
|
-
* duplicate. Longer lists must be split by the caller; each request commits on its own, so earlier chunks
|
|
493
|
-
* stay applied when a later one fails.
|
|
494
|
-
*
|
|
495
|
-
* @returns One result per target, in request order, carrying each target's post-commit follower count.
|
|
496
|
-
* @throws {MobileServerFailureError} With error code `INVALID_FOLLOW_BATCH` if `targets` is empty, holds
|
|
497
|
-
* duplicates, or exceeds the maximum, or `INVALID_FOLLOW_TARGET` if any target is the sender or either party
|
|
498
|
-
* is isolated. Either rejects the whole batch before any write, so do not retry it unchanged.
|
|
499
|
-
*/
|
|
500
|
-
async setFollowBatch(params) {
|
|
501
|
-
const signedRequest = await this.getSignedRequest("set_follow_batch", params, {
|
|
502
|
-
subaccounts: params.targets.map(_nadohq_shared.subaccountToHex),
|
|
503
|
-
is_following: params.isFollowing
|
|
504
|
-
});
|
|
505
|
-
return require_dataMappers.mapMobileFollowBatchResult(await this.execute(signedRequest));
|
|
506
|
-
}
|
|
507
|
-
async getSignedRequest(type, params, innerParams) {
|
|
508
|
-
const walletClient = this.opts.linkedSignerWalletClient ?? this.opts.walletClient;
|
|
509
|
-
if (walletClient == null) throw new _nadohq_shared.WalletNotProvidedError();
|
|
510
|
-
const inner = {
|
|
511
|
-
type,
|
|
512
|
-
...innerParams
|
|
513
|
-
};
|
|
514
|
-
return require_signing_buildSignedMobileRequest.buildSignedMobileRequest({
|
|
515
|
-
...params,
|
|
516
|
-
walletClient,
|
|
517
|
-
inner
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
async publicQuery(body) {
|
|
521
|
-
const response = await this.axiosInstance.post(`${this.opts.url}/public_query`, body);
|
|
522
|
-
this.checkResponseStatus(response);
|
|
523
|
-
this.checkServerStatus(response);
|
|
524
|
-
return response.data;
|
|
525
|
-
}
|
|
526
|
-
async publicExecute(body) {
|
|
527
|
-
const response = await this.axiosInstance.post(`${this.opts.url}/public_execute`, body);
|
|
528
|
-
this.checkResponseStatus(response);
|
|
529
|
-
this.checkServerStatus(response);
|
|
530
|
-
return response.data;
|
|
531
|
-
}
|
|
532
|
-
async execute(body) {
|
|
533
|
-
const response = await this.axiosInstance.post(`${this.opts.url}/execute`, body);
|
|
534
|
-
this.checkResponseStatus(response);
|
|
535
|
-
this.checkServerStatus(response);
|
|
536
|
-
return response.data;
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Validates the HTTP status before interpreting the body. Unlike the engine, the mobile backend returns
|
|
540
|
-
* failure envelopes with non-2xx statuses (e.g. 404 for `PROFILE_NOT_FOUND`), so a non-2xx response with a
|
|
541
|
-
* failure envelope still throws the typed error; anything else is a transport-level error.
|
|
542
|
-
*/
|
|
543
|
-
checkResponseStatus(response) {
|
|
544
|
-
if (response.status >= 200 && response.status < 300) return;
|
|
545
|
-
if (require_utils_serverResponseGuards.isMobileServerFailureResponse(response.data)) throw new require_types_MobileServerFailureError.MobileServerFailureError(response.data, response.status);
|
|
546
|
-
throw new Error(`Unexpected response from mobile service: ${response.status} ${response.statusText}. Data: ${JSON.stringify(response.data)}`);
|
|
547
|
-
}
|
|
548
|
-
checkServerStatus(response) {
|
|
549
|
-
const { data } = response;
|
|
550
|
-
if (require_utils_serverResponseGuards.isMobileServerFailureResponse(data)) throw new require_types_MobileServerFailureError.MobileServerFailureError(data, response.status);
|
|
551
|
-
if (!require_utils_serverResponseGuards.isMobileServerSuccessResponse(data)) throw new Error(`Unexpected response from mobile service: missing success envelope. Data: ${JSON.stringify(data)}`);
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
//#endregion
|
|
555
|
-
Object.defineProperty(exports, "MobileClient", {
|
|
556
|
-
enumerable: true,
|
|
557
|
-
get: function() {
|
|
558
|
-
return MobileClient;
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
|
|
562
|
-
//# sourceMappingURL=MobileClient-aDxiM_Kf.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MobileClient-aDxiM_Kf.cjs","names":["mapMobileAvatarPreset","subaccountToHex","mapMobileProfilesIncludeToServer","mapMobilePublicProfile","mapMobileProfileSearchParamsToServer","mapMobileProfileSearchPage","mapMobileFollowListParamsToServer","mapMobileFollowListPage","mapMobileFeedPage","mapMobileSocialFeedListParamsToServer","mapMobileSocialFeedReadParamsToServer","mapMobileSocialFeedRankedPage","mapMobileSocialFeedTopTradersPage","mapMobileSocialFeedPage","mapMobileSocialFeedItemResponse","mapMobileSocialFeedUpdates","mapMobileNotificationPreferences","mapMobileRegisteredWallet","mapMobileNotificationPreferencesToServer","mapMobileAvatarUpload","mapMobileAvatarSelectionToServer","mapMobileFollowMutationResult","mapMobileFollowBatchResult","WalletNotProvidedError","buildSignedMobileRequest","isMobileServerFailureResponse","MobileServerFailureError","isMobileServerSuccessResponse"],"sources":["../src/MobileClient.ts"],"sourcesContent":["import {\n getNadoClientTypeHeaders,\n subaccountToHex,\n WalletClientWithAccount,\n WalletNotProvidedError,\n} from '@nadohq/shared';\nimport axios, { AxiosInstance, AxiosResponse } from 'axios';\nimport {\n mapMobileAvatarPreset,\n mapMobileAvatarSelectionToServer,\n mapMobileAvatarUpload,\n mapMobileFeedPage,\n mapMobileFollowBatchResult,\n mapMobileFollowListPage,\n mapMobileFollowListParamsToServer,\n mapMobileFollowMutationResult,\n mapMobileNotificationPreferences,\n mapMobileNotificationPreferencesToServer,\n mapMobileProfileSearchPage,\n mapMobileProfileSearchParamsToServer,\n mapMobileProfilesIncludeToServer,\n mapMobilePublicProfile,\n mapMobileRegisteredWallet,\n mapMobileSocialFeedItemResponse,\n mapMobileSocialFeedListParamsToServer,\n mapMobileSocialFeedPage,\n mapMobileSocialFeedRankedPage,\n mapMobileSocialFeedReadParamsToServer,\n mapMobileSocialFeedTopTradersPage,\n mapMobileSocialFeedUpdates,\n} from './dataMappers';\nimport {\n buildSignedMobileRequest,\n MobileSignedInner,\n MobileSignedInnerByType,\n MobileSignedInnerParams,\n MobileSignedRequest,\n} from './signing';\nimport {\n GetMobileFeedItemParams,\n GetMobileFeedParams,\n GetMobileFeedUpdatesParams,\n GetMobileFollowersParams,\n GetMobileFollowingParams,\n GetMobileForYouFeedParams,\n GetMobileFriendsFeedParams,\n GetMobileMarketFeedParams,\n GetMobileNotificationPreferencesParams,\n GetMobilePositionFeedParams,\n GetMobileProfileFeedParams,\n GetMobileProfilesParams,\n GetMobileRegisteredWalletParams,\n GetMobileTopTradersFeedParams,\n GetMobileUsernameAvailabilityParams,\n MobileAvatarPreset,\n MobileAvatarUpload,\n MobileCreateAvatarUploadParams,\n MobileFeedPage,\n MobileFollowBatchResultItem,\n MobileFollowListPage,\n MobileFollowMutationResult,\n MobileNotificationPreferences,\n MobileProfileSearchPage,\n MobilePublicProfile,\n MobileRegisteredWallet,\n MobileRegisterExpoTokenParams,\n MobileSetAvatarParams,\n MobileSetBioParams,\n MobileSetFollowBatchParams,\n MobileSetFollowParams,\n MobileSetPrivateModeParams,\n MobileSetUsernameParams,\n MobileSignedRequestParams,\n MobileSocialFeedItemResponse,\n MobileSocialFeedPage,\n MobileSocialFeedRankedPage,\n MobileSocialFeedTopTradersPage,\n MobileSocialFeedUpdates,\n MobileUnregisterExpoTokenParams,\n MobileUpdateNotificationPreferencesParams,\n MobileUsernameAvailability,\n SearchMobileProfilesParams,\n} from './types/clientTypes';\nimport { MobileServerFailureError } from './types/MobileServerFailureError';\nimport { MobileServerSuccessResponse } from './types/serverBaseTypes';\nimport {\n MobileServerExecuteResult,\n MobileServerExecuteSuccessResponse,\n MobileServerPublicExecuteRequest,\n} from './types/serverExecuteTypes';\nimport {\n MobileServerPublicQueryRequest,\n MobileServerPublicQuerySuccessResponse,\n} from './types/serverQueryTypes';\nimport {\n MobileServerExecuteRequestType,\n MobileServerPublicQueryRequestByType,\n MobileServerPublicQueryRequestType,\n} from './types/serverRequestTypes';\nimport {\n isMobileServerFailureResponse,\n isMobileServerSuccessResponse,\n} from './utils/serverResponseGuards';\n\n/**\n * Options for constructing a {@link MobileClient}.\n */\nexport interface MobileClientOpts {\n /**\n * Base URL of the mobile service API, e.g. {@link MOBILE_CLIENT_ENDPOINTS}.\n */\n url: string;\n /**\n * Wallet client used to sign requests.\n */\n walletClient?: WalletClientWithAccount;\n /**\n * If provided, this signer is used instead of `walletClient` for all signed requests.\n */\n linkedSignerWalletClient?: WalletClientWithAccount;\n /**\n * If provided, identifies the calling client, sent as a header with every request.\n */\n clientType?: string;\n}\n\n/**\n * Client for the Nado mobile service API: usernames, bios, avatars, public profile lookups, the global\n * trade feed, session-based social feeds, the follower/following graph, privacy settings, and push\n * notification device/preference management.\n */\nexport class MobileClient {\n readonly opts: MobileClientOpts;\n readonly axiosInstance: AxiosInstance;\n\n constructor(opts: MobileClientOpts) {\n this.opts = opts;\n this.axiosInstance = axios.create({\n withCredentials: true,\n // We have custom logic to validate response status and create an appropriate error\n validateStatus: () => true,\n headers: getNadoClientTypeHeaders(opts.clientType),\n });\n }\n\n /**\n * Sets the linked signer for requests\n *\n * @param linkedSignerWalletClient The linkedSigner to use for all signatures. Set to null to revert to the chain signer\n */\n public setLinkedSigner(\n linkedSignerWalletClient: WalletClientWithAccount | null,\n ) {\n this.opts.linkedSignerWalletClient = linkedSignerWalletClient ?? undefined;\n }\n\n /*\n Public queries\n */\n\n /**\n * Returns the current server-owned avatar catalogue in display order.\n *\n * @throws {MobileServerFailureError} With `SERVICE_UNAVAILABLE` when avatar storage is not configured.\n */\n async getAvatarPresets(): Promise<MobileAvatarPreset[]> {\n const body: MobileServerPublicQueryRequest<'avatar_presets'> = {\n type: 'avatar_presets',\n };\n const data = await this.publicQuery(body);\n return data.presets.map(mapMobileAvatarPreset);\n }\n\n /**\n * Checks whether a username derived from the given display name is available to claim.\n */\n async getUsernameAvailability(\n params: GetMobileUsernameAvailabilityParams,\n ): Promise<MobileUsernameAvailability> {\n const body: MobileServerPublicQueryRequest<'username_availability'> = {\n type: 'username_availability',\n display_name: params.displayName,\n };\n const data = await this.publicQuery(body);\n return { username: data.username, available: data.available };\n }\n\n /**\n * Looks up public profiles, optionally with follower totals and a follow summary. Returns one profile per\n * requested subaccount, in the requested order, so callers can correlate positionally. Every non-isolated\n * subaccount resolves, with `username` and `displayName` `null` until a username is claimed. Private Mode\n * does not hide the profile itself, only the account's activity.\n *\n * This is the only profile route, so use it for a single subaccount too. It is unsigned, which means\n * `include.followSummary.viewAs` is an unauthenticated claim.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_PROFILES_REQUEST` if `subaccounts` is empty,\n * holds duplicates, or exceeds `MOBILE_PROFILES_MAX_BATCH_SIZE` (25), or `PROFILE_NOT_FOUND` if any\n * requested subaccount — or the follow summary's `viewAs` — is in the engine-created isolated namespace.\n * One isolated member fails the whole batch rather than being omitted.\n */\n async getProfiles(\n params: GetMobileProfilesParams,\n ): Promise<MobilePublicProfile[]> {\n const body: MobileServerPublicQueryRequest<'profiles'> = {\n type: 'profiles',\n subaccounts: params.subaccounts.map(subaccountToHex),\n include: params.include\n ? mapMobileProfilesIncludeToServer(params.include)\n : undefined,\n };\n const data = await this.publicQuery(body);\n return data.profiles.map(mapMobilePublicProfile);\n }\n\n /**\n * Searches claimed profiles by the start of their username, in ascending username order with an exact\n * match first. Only current claimed identities match: an unnamed profile never does, and Private Mode does\n * not hide one. Takes the same `include` as {@link MobileClient.getProfiles}, so a page can carry follower\n * totals and a follow summary without a second request; as there, `include.followSummary.viewAs` is an\n * unauthenticated claim on an unsigned route.\n *\n * Pagination is live rather than snapshot, so deduplicate matches by subaccount across pages. A cursor is\n * bound to the query alone, so `include` and `limit` may change between pages.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_PROFILE_SEARCH_REQUEST` if `query` is outside\n * the username alphabet or length or `limit` is out of range (1-50, or 1-25 with an include),\n * `INVALID_PROFILE_SEARCH_CURSOR` if the cursor is malformed or was issued for a different query (discard\n * it and restart from the first page), or `PROFILE_NOT_FOUND` if `include.followSummary.viewAs` is in the\n * engine-created isolated namespace.\n */\n async searchProfiles(\n params: SearchMobileProfilesParams,\n ): Promise<MobileProfileSearchPage> {\n const body: MobileServerPublicQueryRequest<'search_profiles'> = {\n type: 'search_profiles',\n ...mapMobileProfileSearchParamsToServer(params),\n };\n const data = await this.publicQuery(body);\n return mapMobileProfileSearchPage(data);\n }\n\n /**\n * Fetches a page of the accounts that follow the given Profile.\n *\n * Ordering depends on `viewAs`. With it, accounts the Viewer already follows come first, unfamiliar\n * accounts second, and every row carries an `isFollowing`. Without it, the page is ordered by the listed\n * relationship alone and no row carries an `isFollowing`. In both cases the newest listed relationship\n * comes first within a group, with a bytes32 tie-break. The grouping is evaluated per request against the\n * live graph, so following an account from inside the list moves it between groups on the next page —\n * deduplicate by subaccount and do not re-sort locally.\n *\n * @throws {MobileServerFailureError} With error code `PROFILE_NOT_FOUND` if the viewed Profile or `viewAs`\n * is isolated, `INVALID_FOLLOW_CURSOR` if the cursor is malformed or was issued for a different `viewAs`,\n * Profile, or list direction (discard it and restart from the first page), or `INVALID_FOLLOW_LIMIT` if\n * `limit` is outside 1–50.\n */\n async getFollowers(\n params: GetMobileFollowersParams,\n ): Promise<MobileFollowListPage> {\n const body: MobileServerPublicQueryRequest<'followers'> = {\n type: 'followers',\n ...mapMobileFollowListParamsToServer(params),\n };\n const data = await this.publicQuery(body);\n return mapMobileFollowListPage(data);\n }\n\n /**\n * Fetches a page of the accounts the given Profile follows. Ordering, cursor rules, and errors match\n * {@link MobileClient.getFollowers}. When `viewAs` reads its own Following list every row is familiar, so\n * every `isFollowing` is `true`.\n */\n async getFollowing(\n params: GetMobileFollowingParams,\n ): Promise<MobileFollowListPage> {\n const body: MobileServerPublicQueryRequest<'following'> = {\n type: 'following',\n ...mapMobileFollowListParamsToServer(params),\n };\n const data = await this.publicQuery(body);\n return mapMobileFollowListPage(data);\n }\n\n /**\n * Fetches a page of the global trade feed: public perpetual trades, newest first, optionally filtered by a\n * whole-dollar minimum notional (omitted means unfiltered). Trades by subaccounts that have not claimed a\n * username are included with `null` name fields; only private accounts are filtered out. The feed is\n * best-effort rather than authoritative history, and pagination is live (not snapshot), so deduplicate pages\n * by {@link MobileFeedTrade.orderDigest}.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_FEED_FILTER` if `minimumNotional` or\n * `limit` is outside its allowed domain (fix the request; do not retry unchanged), or\n * `INVALID_FEED_CURSOR` if the cursor is malformed or was issued for a different `minimumNotional`\n * (discard the cursor and restart from the first page).\n */\n async getFeed(params: GetMobileFeedParams = {}): Promise<MobileFeedPage> {\n const body: MobileServerPublicQueryRequest<'feed'> = {\n type: 'feed',\n minimum_notional: params.minimumNotional,\n limit: params.limit,\n cursor: params.cursor,\n };\n const data = await this.publicQuery(body);\n return mapMobileFeedPage(data);\n }\n\n /**\n * Fetches chronological For You recommendations with server-side author/thread constraints.\n * Always public, with optional viewAs for relationship state. Preserve the session, viewAs, filters, and limit\n * when paging, including through empty pages with a nextCursor. A 6312 error requires a refresh.\n * @param params - Filters, pagination, optional viewing account, and browser credential; no signing identity.\n * @returns A fixed-session page with its ranking version and new-content watermark.\n * @throws {MobileServerFailureError} On invalid parameters, session mismatch/expiry, or unavailable data.\n */\n async getForYouFeed(\n params: GetMobileForYouFeedParams = {},\n ): Promise<MobileSocialFeedRankedPage> {\n const body: MobileServerPublicQueryRequest<'for_you_feed'> = {\n type: 'for_you_feed',\n market_category: params.marketCategory,\n ...mapMobileSocialFeedListParamsToServer(params),\n ...mapMobileSocialFeedReadParamsToServer(params),\n };\n const data = await this.publicQuery(body);\n return mapMobileSocialFeedRankedPage(data);\n }\n\n /**\n * Fetches chronological content by qualified Top Traders, with official account PnL badges.\n * Always public; neither a wallet nor one-click trading setup is required.\n * @param params - Filters, pagination, optional viewing account, and browser credential.\n * @returns A page with its qualification cohort; an unavailable cohort fails instead of returning an empty ranking.\n * @throws {MobileServerFailureError} On request/session errors or unavailable cohort data.\n */\n async getTopTradersFeed(\n params: GetMobileTopTradersFeedParams = {},\n ): Promise<MobileSocialFeedTopTradersPage> {\n const body: MobileServerPublicQueryRequest<'top_traders_feed'> = {\n type: 'top_traders_feed',\n market_category: params.marketCategory,\n ...mapMobileSocialFeedListParamsToServer(params),\n ...mapMobileSocialFeedReadParamsToServer(params),\n };\n const data = await this.publicQuery(body);\n return mapMobileSocialFeedTopTradersPage(data);\n }\n\n /**\n * Fetches public content by authors followed by viewAs, without a signature. One-way following is sufficient.\n * @param params - Required viewing account on every request, filters, pagination, and browser credential.\n * @returns A chronological Friends page and reading session.\n * @throws {MobileServerFailureError} On invalid viewing account, session errors, or feed query failure.\n */\n async getFriendsFeed(\n params: GetMobileFriendsFeedParams,\n ): Promise<MobileSocialFeedRankedPage> {\n const body: MobileServerPublicQueryRequest<'friends_feed'> = {\n type: 'friends_feed',\n market_category: params.marketCategory,\n ...mapMobileSocialFeedListParamsToServer(params),\n view_as: subaccountToHex(params.viewAs),\n viewer_token: params.viewerToken,\n };\n const data = await this.publicQuery(body);\n return mapMobileSocialFeedRankedPage(data);\n }\n\n /**\n * Fetches an author's content visible to viewAs, including that account's own hidden content.\n * @param params - Target identity, filters, pagination, and optional public viewing account.\n * @returns An author page without main-feed ranking or cohort fields.\n * @throws {MobileServerFailureError} On invalid parameters, session errors, or inaccessible content.\n */\n async getProfileFeed(\n params: GetMobileProfileFeedParams,\n ): Promise<MobileSocialFeedPage> {\n const body: MobileServerPublicQueryRequest<'profile_feed'> = {\n type: 'profile_feed',\n subaccount: subaccountToHex(params.subaccount),\n market_category: params.marketCategory,\n ...mapMobileSocialFeedListParamsToServer(params),\n ...mapMobileSocialFeedReadParamsToServer(params),\n };\n const data = await this.publicQuery(body);\n return mapMobileSocialFeedPage(data);\n }\n\n /**\n * Fetches published content for one market.\n * @param params - Product ID, content/size filters, pagination, and public viewing account.\n * @returns A market page without main-feed ranking fields.\n * @throws {MobileServerFailureError} On an unknown market, session errors, or unavailable data.\n */\n async getMarketFeed(\n params: GetMobileMarketFeedParams,\n ): Promise<MobileSocialFeedPage> {\n const body: MobileServerPublicQueryRequest<'market_feed'> = {\n type: 'market_feed',\n product_id: params.productId,\n ...mapMobileSocialFeedListParamsToServer(params),\n ...mapMobileSocialFeedReadParamsToServer(params),\n };\n const data = await this.publicQuery(body);\n return mapMobileSocialFeedPage(data);\n }\n\n /**\n * Fetches already published content for a position lifecycle. This is not full position history\n * and includes hidden content owned by viewAs under account_view. It does not recreate suppressed activity.\n * @param params - Position UUID, filters, pagination, and public viewing account.\n * @returns A fixed-session position feed page.\n * @throws {MobileServerFailureError} On inaccessible content, session errors, or unavailable data.\n */\n async getPositionFeed(\n params: GetMobilePositionFeedParams,\n ): Promise<MobileSocialFeedPage> {\n const body: MobileServerPublicQueryRequest<'position_feed'> = {\n type: 'position_feed',\n position_id: params.positionId,\n ...mapMobileSocialFeedListParamsToServer(params),\n ...mapMobileSocialFeedReadParamsToServer(params),\n };\n const data = await this.publicQuery(body);\n return mapMobileSocialFeedPage(data);\n }\n\n /**\n * Reads one item visible to viewAs, including that account's own hidden content.\n * Creates an item session directly when sessionId is omitted.\n * @param params - Item UUID, preview limit, and optional existing session/read identity.\n * @returns The complete item and authorized reading session.\n * @throws {MobileServerFailureError} On inaccessible content or session mismatch/expiry.\n */\n async getFeedItem(\n params: GetMobileFeedItemParams,\n ): Promise<MobileSocialFeedItemResponse> {\n const body: MobileServerPublicQueryRequest<'feed_item'> = {\n type: 'feed_item',\n item_id: params.itemId,\n comment_preview_limit: params.commentPreviewLimit,\n session_id: params.sessionId,\n ...mapMobileSocialFeedReadParamsToServer(params),\n };\n const data = await this.publicQuery(body);\n return mapMobileSocialFeedItemResponse(data);\n }\n\n /**\n * Polls authorized visible items and positions without inserting or reordering list members.\n * Increment requestSeq across the entire session, including viewport changes; never reset it for a new viewport.\n * Accept only the current session and viewportRevision's latest requestSeq; discard stale patches and cursors together.\n * Updates currently always return reset=true. Apply current author details, follow state, and badges even if the item version is unchanged.\n * Null patches clear values;\n * omitted fields leave them unchanged. Stop polling off-screen and refresh on error 6312.\n * @param params - Session, visible IDs, update baseline, sequence, and matching read identity.\n * @returns Item/position patches, revoked targets, and a new-content hint.\n * @throws {MobileServerFailureError} On invalid or unauthorized targets, session expiry, or unavailable data.\n */\n async getFeedUpdates(\n params: GetMobileFeedUpdatesParams,\n ): Promise<MobileSocialFeedUpdates> {\n const body: MobileServerPublicQueryRequest<'feed_updates'> = {\n type: 'feed_updates',\n session_id: params.sessionId,\n visible_item_ids: params.visibleItemIds,\n visible_position_ids: params.visiblePositionIds,\n update_cursor: params.updateCursor,\n viewport_revision: params.viewportRevision,\n request_seq: params.requestSeq,\n viewer_token: params.viewerToken,\n };\n const data = await this.publicQuery(body);\n return mapMobileSocialFeedUpdates(data);\n }\n\n /**\n * Fetches the push notification preferences of the wallet that owns the given Expo push token. Unsigned —\n * the token identifies the wallet on its own. Falls back to the backend's defaults if the wallet has never\n * updated its preferences.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_EXPO_TOKEN` if the token is malformed, or is\n * not currently registered to a wallet.\n */\n async getNotificationPreferences(\n params: GetMobileNotificationPreferencesParams,\n ): Promise<MobileNotificationPreferences> {\n const body: MobileServerPublicQueryRequest<'notification_preferences'> = {\n type: 'notification_preferences',\n expo_token: params.expoToken,\n };\n const data = await this.publicQuery(body);\n return mapMobileNotificationPreferences(data.preferences);\n }\n\n /**\n * Resolves the wallet that an Expo push token is currently registered to, along with the redacted metadata\n * of the device that registered it. Unsigned — the token identifies the wallet on its own. Use it to check\n * whether a locally held token is still active and which wallet currently owns it, since registering the\n * same token under another wallet transfers ownership.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_EXPO_TOKEN` if the token is malformed, or is\n * not currently registered to a wallet — including a token that was unregistered. The backend does not\n * distinguish those cases.\n */\n async getRegisteredWallet(\n params: GetMobileRegisteredWalletParams,\n ): Promise<MobileRegisteredWallet> {\n const body: MobileServerPublicQueryRequest<'registered_wallet'> = {\n type: 'registered_wallet',\n expo_token: params.expoToken,\n };\n const data = await this.publicQuery(body);\n return mapMobileRegisteredWallet(data);\n }\n\n /*\n Public executes\n */\n\n /**\n * Unregisters an Expo push token, stopping delivery to that device. Unsigned, so it still works at logout\n * when a wallet signature may no longer be obtainable. Idempotent: unregistering an inactive or unknown\n * well-formed token succeeds.\n *\n * A registration that commits after this call re-activates the token, so stop or await any in-flight\n * {@link MobileClient.registerExpoToken} before unregistering.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_EXPO_TOKEN` if the token is malformed.\n */\n async unregisterExpoToken(\n params: MobileUnregisterExpoTokenParams,\n ): Promise<MobileServerSuccessResponse> {\n const body: MobileServerPublicExecuteRequest<'unregister_expo_token'> = {\n type: 'unregister_expo_token',\n expo_token: params.expoToken,\n };\n return this.publicExecute(body);\n }\n\n /**\n * Replaces the push notification preferences of the wallet that owns the given Expo push token. Possession\n * of an active token is the credential rather than a signature, so anyone holding the token can overwrite\n * that wallet's preferences. The backend requires `schemaVersion` of 1, exactly one entry per known\n * category, and empty `scopes` on every entry.\n *\n * Writes are last-write-wins on commit order rather than ordered by a client nonce, so callers must\n * serialize their own preference writes.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_PREFERENCES` if those rules are violated, or\n * `INVALID_EXPO_TOKEN` if the token is malformed or is not currently registered to a wallet.\n */\n async updateNotificationPreferences(\n params: MobileUpdateNotificationPreferencesParams,\n ): Promise<MobileServerSuccessResponse> {\n const body: MobileServerPublicExecuteRequest<'update_preferences'> = {\n type: 'update_preferences',\n expo_token: params.expoToken,\n preferences: mapMobileNotificationPreferencesToServer(params.preferences),\n };\n return this.publicExecute(body);\n }\n\n /*\n Signed executes\n */\n\n /**\n * Updates the biography, or clears it when the text is whitespace-only.\n *\n * Serialize this with {@link MobileClient.setAvatar}, {@link MobileClient.setUsername} and\n * {@link MobileClient.setPrivateMode} for the same subaccount: all share the identity update nonce.\n *\n * @throws {MobileServerFailureError} With `INVALID_BIO` for exceeding `MOBILE_BIO_MAX_LENGTH` or null\n * characters, `INVALID_IDENTITY_TARGET` for an isolated subaccount, or `STALE_IDENTITY_UPDATE` when a\n * later write has committed (re-read the profile before retrying).\n */\n async setBio(\n params: MobileSetBioParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest('set_bio', params, {\n bio: params.bio,\n });\n return this.execute(signedRequest);\n }\n\n /**\n * Creates a short-lived upload grant. The caller uploads an image meeting {@link MobileAvatarUpload}'s requirements;\n * file access and transport remain platform-specific. This does not change the saved avatar.\n *\n * @throws {MobileServerFailureError} With `INVALID_AVATAR` for a zero or oversized upload,\n * `INVALID_IDENTITY_TARGET` for an isolated subaccount, or `SERVICE_UNAVAILABLE` when storage is unavailable.\n */\n async createAvatarUpload(\n params: MobileCreateAvatarUploadParams,\n ): Promise<MobileAvatarUpload> {\n const signedRequest = await this.getSignedRequest(\n 'create_avatar_upload',\n params,\n { content_length: params.contentLength },\n );\n const data = await this.execute(signedRequest);\n return mapMobileAvatarUpload(data);\n }\n\n /**\n * Publishes a preset/staged upload, or clears the saved avatar when avatar is null.\n * Uploaded JPEG/PNG images must be square, at most 4096 × 4096 pixels, and within\n * `MOBILE_AVATAR_MAX_UPLOAD_BYTES`. A successful PUT can still fail this publication check.\n *\n * Serialize identity writes for the same subaccount; see {@link MobileClient.setBio}.\n *\n * @throws {MobileServerFailureError} With `INVALID_AVATAR` for an invalid preset, staging key, or image,\n * `INVALID_IDENTITY_TARGET` for an isolated subaccount, `SERVICE_UNAVAILABLE` when storage is unavailable,\n * or `STALE_IDENTITY_UPDATE` when a later write has committed (re-read the profile before retrying).\n */\n async setAvatar(\n params: MobileSetAvatarParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest('set_avatar', params, {\n avatar: mapMobileAvatarSelectionToServer(params.avatar),\n });\n return this.execute(signedRequest);\n }\n\n /**\n * Sets a subaccount's username, derived from the given display name. Upserts: the same call claims a first\n * username and renames an existing one, so callers never need to read the current identity first.\n *\n * Serialize identity writes for the same subaccount; see {@link MobileClient.setBio}.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_DISPLAY_NAME` if the display name violates\n * `MOBILE_DISPLAY_NAME_PATTERN`, `USERNAME_UNAVAILABLE` if the derived username is reserved or already\n * taken by another subaccount, `INVALID_IDENTITY_TARGET` if the sender is in the engine-created isolated\n * namespace, or `STALE_IDENTITY_UPDATE` if another identity write for this subaccount committed with a\n * later nonce (re-read the identity before retrying).\n */\n async setUsername(\n params: MobileSetUsernameParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest('set_username', params, {\n display_name: params.displayName,\n });\n return this.execute(signedRequest);\n }\n\n /**\n * Sets whether a subaccount's profile is private.\n * Serialize identity writes for the same subaccount; see {@link MobileClient.setBio}.\n */\n async setPrivateMode(\n params: MobileSetPrivateModeParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest(\n 'set_private_mode',\n params,\n { private_mode: params.privateMode },\n );\n return this.execute(signedRequest);\n }\n\n /**\n * Registers an Expo push token for the wallet, transferring active ownership of the token if another\n * wallet had registered it. Idempotent per `(wallet, token)`.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_EXPO_TOKEN` if the token is not a valid Expo\n * push token, or `INVALID_DEVICE_METADATA` if `locale` (max 35 chars) or `appVersion` (max 64 chars) is\n * too long.\n */\n async registerExpoToken(\n params: MobileRegisterExpoTokenParams,\n ): Promise<MobileServerSuccessResponse> {\n const signedRequest = await this.getSignedRequest(\n 'register_expo_token',\n params,\n {\n expo_token: params.expoToken,\n platform: params.platform,\n locale: params.locale ?? null,\n app_version: params.appVersion ?? null,\n },\n );\n return this.execute(signedRequest);\n }\n\n /**\n * Sets whether the signing subaccount follows a Profile. Both directions are idempotent: following again\n * keeps the original relationship creation time, so it does not move the account in recency order, and\n * unfollowing a relationship that does not exist succeeds with `isFollowing: false`. Unfollowing deletes\n * the relationship rather than deactivating it, so a later follow gets a new creation time and moves the\n * account to the front of recency order.\n *\n * Only `isFollowing: true` is checked against the canonical Query DB subaccount index, so unfollowing still\n * works while that index lags.\n *\n * @throws {MobileServerFailureError} With error code `INVALID_FOLLOW_TARGET` if the target is the sender or\n * either party is isolated, `FOLLOWER_NOT_ELIGIBLE` if the sender is not yet in the canonical Query DB\n * subaccount index, or `FOLLOWING_NOT_FOUND` if the target is not. Both index errors are transient for an\n * account that is being recorded, so they are retryable after catch-up — unlike `INVALID_FOLLOW_TARGET`.\n */\n async setFollow(\n params: MobileSetFollowParams,\n ): Promise<MobileFollowMutationResult> {\n const signedRequest = await this.getSignedRequest('set_follow', params, {\n subaccount: subaccountToHex(params.target),\n is_following: params.isFollowing,\n });\n const data = await this.execute(signedRequest);\n return mapMobileFollowMutationResult(data);\n }\n\n /**\n * Sets whether the signing subaccount follows each of up to `MOBILE_FOLLOW_BATCH_MAX_SIZE` (25) Profiles in\n * one signed request, which costs far less of the shared IP rate limit than one {@link MobileClient.setFollow}\n * per target. The server validates the whole list before writing and commits every target in one database\n * transaction, so the batch either fully applies or changes nothing. Each target has the same idempotent\n * semantics as `setFollow`, so resending a batch is safe.\n *\n * Targets are lowercased before signing but not deduplicated, and two spellings of one subaccount are a\n * duplicate. Longer lists must be split by the caller; each request commits on its own, so earlier chunks\n * stay applied when a later one fails.\n *\n * @returns One result per target, in request order, carrying each target's post-commit follower count.\n * @throws {MobileServerFailureError} With error code `INVALID_FOLLOW_BATCH` if `targets` is empty, holds\n * duplicates, or exceeds the maximum, or `INVALID_FOLLOW_TARGET` if any target is the sender or either party\n * is isolated. Either rejects the whole batch before any write, so do not retry it unchanged.\n */\n async setFollowBatch(\n params: MobileSetFollowBatchParams,\n ): Promise<MobileFollowBatchResultItem[]> {\n const signedRequest = await this.getSignedRequest(\n 'set_follow_batch',\n params,\n {\n subaccounts: params.targets.map(subaccountToHex),\n is_following: params.isFollowing,\n },\n );\n const data = await this.execute(signedRequest);\n return mapMobileFollowBatchResult(data);\n }\n\n /*\n Base Fns\n */\n\n // Returns the request narrowed to `type` so `execute` can infer its response from the request it is given,\n // instead of being told the type a second time at the call site.\n protected async getSignedRequest<T extends MobileSignedInner['type']>(\n type: T,\n params: MobileSignedRequestParams,\n innerParams: MobileSignedInnerParams<T>,\n ): Promise<MobileSignedRequest<MobileSignedInnerByType<T>>> {\n // Use the linked signer if provided, otherwise use the default signer provided to the client\n const walletClient =\n this.opts.linkedSignerWalletClient ?? this.opts.walletClient;\n\n if (walletClient == null) {\n throw new WalletNotProvidedError();\n }\n\n const inner = {\n type,\n ...innerParams,\n } as unknown as MobileSignedInnerByType<T>;\n return buildSignedMobileRequest({ ...params, walletClient, inner });\n }\n\n // Spelled out as an intersection rather than `MobileServerPublicQueryRequest<T>`: the latter is an indexed\n // access on a mapped type, which is not an inference site, so `T` would always widen to the full union.\n protected async publicQuery<T extends MobileServerPublicQueryRequestType>(\n body: { type: T } & MobileServerPublicQueryRequestByType[T],\n ): Promise<MobileServerPublicQuerySuccessResponse<T>> {\n const response = await this.axiosInstance.post<unknown>(\n `${this.opts.url}/public_query`,\n body,\n );\n\n this.checkResponseStatus(response);\n this.checkServerStatus(response);\n\n // checkServerStatus throws on failure responses so the cast to the success response is acceptable here\n return response.data as MobileServerPublicQuerySuccessResponse<T>;\n }\n\n protected async publicExecute(\n body: MobileServerPublicExecuteRequest,\n ): Promise<MobileServerSuccessResponse> {\n const response = await this.axiosInstance.post<MobileServerExecuteResult>(\n `${this.opts.url}/public_execute`,\n body,\n );\n\n this.checkResponseStatus(response);\n this.checkServerStatus(response);\n\n // checkServerStatus catches the failure result and throws the error, so the cast to the success response is acceptable here\n return response.data as MobileServerSuccessResponse;\n }\n\n // `T` is inferred from the body's `type` rather than declared by the caller, for the same reason\n // `publicQuery` spells its body out as an intersection: an indexed access is not an inference site.\n protected async execute<T extends MobileServerExecuteRequestType>(\n body: MobileSignedRequest & { type: T },\n ): Promise<MobileServerExecuteSuccessResponse<T>> {\n const response = await this.axiosInstance.post<MobileServerExecuteResult>(\n `${this.opts.url}/execute`,\n body,\n );\n\n this.checkResponseStatus(response);\n this.checkServerStatus(response);\n\n // checkServerStatus catches the failure result and throws the error, so the cast to the success response is acceptable here\n return response.data as MobileServerExecuteSuccessResponse<T>;\n }\n\n /**\n * Validates the HTTP status before interpreting the body. Unlike the engine, the mobile backend returns\n * failure envelopes with non-2xx statuses (e.g. 404 for `PROFILE_NOT_FOUND`), so a non-2xx response with a\n * failure envelope still throws the typed error; anything else is a transport-level error.\n */\n private checkResponseStatus(response: AxiosResponse<unknown>) {\n if (response.status >= 200 && response.status < 300) {\n return;\n }\n if (isMobileServerFailureResponse(response.data)) {\n throw new MobileServerFailureError(response.data, response.status);\n }\n throw new Error(\n `Unexpected response from mobile service: ${response.status} ${response.statusText}. Data: ${JSON.stringify(response.data)}`,\n );\n }\n\n private checkServerStatus(response: AxiosResponse<unknown>) {\n const { data } = response;\n\n if (isMobileServerFailureResponse(data)) {\n throw new MobileServerFailureError(data, response.status);\n }\n if (!isMobileServerSuccessResponse(data)) {\n throw new Error(\n `Unexpected response from mobile service: missing success envelope. Data: ${JSON.stringify(data)}`,\n );\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmIA,IAAa,eAAb,MAA0B;CAIxB,YAAY,MAAwB;EAClC,KAAK,OAAO;EACZ,KAAK,gBAAgB,MAAA,QAAM,OAAO;GAChC,iBAAiB;GAEjB,sBAAsB;GACtB,UAAA,GAAA,eAAA,0BAAkC,KAAK,UAAU;EACnD,CAAC;CACH;;;;;;CAOA,gBACE,0BACA;EACA,KAAK,KAAK,2BAA2B,4BAA4B,KAAA;CACnE;;;;;;CAWA,MAAM,mBAAkD;EAKtD,QAAO,MADY,KAAK,YAAY,EAFlC,MAAM,iBAE+B,CAAC,GAC5B,QAAQ,IAAIA,oBAAAA,qBAAqB;CAC/C;;;;CAKA,MAAM,wBACJ,QACqC;EACrC,MAAM,OAAgE;GACpE,MAAM;GACN,cAAc,OAAO;EACvB;EACA,MAAM,OAAO,MAAM,KAAK,YAAY,IAAI;EACxC,OAAO;GAAE,UAAU,KAAK;GAAU,WAAW,KAAK;EAAU;CAC9D;;;;;;;;;;;;;;;CAgBA,MAAM,YACJ,QACgC;EAChC,MAAM,OAAmD;GACvD,MAAM;GACN,aAAa,OAAO,YAAY,IAAIC,eAAAA,eAAe;GACnD,SAAS,OAAO,UACZ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