@nadohq/mobile-client 0.54.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/README.md +4 -4
  2. package/dist/{MobileClient-BbTaqTzi.cjs → MobileClient-DjNpN7Dw.cjs} +55 -4
  3. package/dist/MobileClient-DjNpN7Dw.cjs.map +1 -0
  4. package/dist/MobileClient.cjs +1 -1
  5. package/dist/MobileClient.d.cts +49 -9
  6. package/dist/MobileClient.d.cts.map +1 -1
  7. package/dist/MobileClient.d.ts +49 -9
  8. package/dist/MobileClient.d.ts.map +1 -1
  9. package/dist/MobileClient.js +55 -4
  10. package/dist/MobileClient.js.map +1 -1
  11. package/dist/{MobileServerFailureError-B2og8e5O.d.ts → MobileServerFailureError-DvtkMAVX.d.ts} +3 -3
  12. package/dist/{MobileServerFailureError-B2og8e5O.d.ts.map → MobileServerFailureError-DvtkMAVX.d.ts.map} +1 -1
  13. package/dist/{MobileServerFailureError-BrLtaHnU.d.cts → MobileServerFailureError-kbMi1Ntc.d.cts} +3 -3
  14. package/dist/{MobileServerFailureError-BrLtaHnU.d.cts.map → MobileServerFailureError-kbMi1Ntc.d.cts.map} +1 -1
  15. package/dist/{buildSignedMobileRequest-CZ-EdxYI.d.cts → buildSignedMobileRequest-DBWN0z0u.d.cts} +2 -2
  16. package/dist/{buildSignedMobileRequest-CZ-EdxYI.d.cts.map → buildSignedMobileRequest-DBWN0z0u.d.cts.map} +1 -1
  17. package/dist/{buildSignedMobileRequest-CoAVSDPx.d.ts → buildSignedMobileRequest-lSIJmG6D.d.ts} +2 -2
  18. package/dist/{buildSignedMobileRequest-CoAVSDPx.d.ts.map → buildSignedMobileRequest-lSIJmG6D.d.ts.map} +1 -1
  19. package/dist/{canonicalize-BC-JICjp.d.ts → canonicalize-Cx3lCVpm.d.ts} +2 -2
  20. package/dist/canonicalize-Cx3lCVpm.d.ts.map +1 -0
  21. package/dist/{canonicalize-0_B6UOxO.d.cts → canonicalize-DNgB8Jsm.d.cts} +2 -2
  22. package/dist/canonicalize-DNgB8Jsm.d.cts.map +1 -0
  23. package/dist/{clientTypes-YF5d8bvg.d.cts → clientTypes-DnPE1zZO.d.cts} +64 -12
  24. package/dist/clientTypes-DnPE1zZO.d.cts.map +1 -0
  25. package/dist/{clientTypes-P4LAjreY.d.ts → clientTypes-ws9CDHw4.d.ts} +64 -12
  26. package/dist/clientTypes-ws9CDHw4.d.ts.map +1 -0
  27. package/dist/dataMappers.cjs +39 -3
  28. package/dist/dataMappers.cjs.map +1 -1
  29. package/dist/dataMappers.d.cts +18 -6
  30. package/dist/dataMappers.d.cts.map +1 -1
  31. package/dist/dataMappers.d.ts +18 -6
  32. package/dist/dataMappers.d.ts.map +1 -1
  33. package/dist/dataMappers.js +37 -4
  34. package/dist/dataMappers.js.map +1 -1
  35. package/dist/{eip712MethodByType-DWtLyPY7.d.ts → eip712MethodByType-Bmu9PYx6.d.ts} +2 -2
  36. package/dist/eip712MethodByType-Bmu9PYx6.d.ts.map +1 -0
  37. package/dist/{eip712MethodByType-sHQ-VTHd.d.cts → eip712MethodByType-T7dfjmC_.d.cts} +2 -2
  38. package/dist/eip712MethodByType-T7dfjmC_.d.cts.map +1 -0
  39. package/dist/index.cjs +5 -1
  40. package/dist/index.d.cts +16 -15
  41. package/dist/index.d.ts +16 -15
  42. package/dist/index.js +2 -1
  43. package/dist/{mobileErrorCodes-DccrM4NI.d.ts → mobileErrorCodes-B3kTLit_.d.cts} +4 -2
  44. package/dist/mobileErrorCodes-B3kTLit_.d.cts.map +1 -0
  45. package/dist/{mobileErrorCodes-DccrM4NI.d.cts → mobileErrorCodes-B3kTLit_.d.ts} +4 -2
  46. package/dist/mobileErrorCodes-B3kTLit_.d.ts.map +1 -0
  47. package/dist/{payloadHash-CSgTglN4.d.cts → payloadHash-Brc5ceFq.d.cts} +2 -2
  48. package/dist/payloadHash-Brc5ceFq.d.cts.map +1 -0
  49. package/dist/{payloadHash-qsU1DEF0.d.ts → payloadHash-cZgv7NSo.d.ts} +2 -2
  50. package/dist/payloadHash-cZgv7NSo.d.ts.map +1 -0
  51. package/dist/profile-BozA3yVP.d.cts +16 -0
  52. package/dist/profile-BozA3yVP.d.cts.map +1 -0
  53. package/dist/profile-BozA3yVP.d.ts +16 -0
  54. package/dist/profile-BozA3yVP.d.ts.map +1 -0
  55. package/dist/{serverBaseTypes-DKCLDn3x.d.ts → serverBaseTypes-CWBdZomv.d.ts} +2 -2
  56. package/dist/{serverBaseTypes-DKCLDn3x.d.ts.map → serverBaseTypes-CWBdZomv.d.ts.map} +1 -1
  57. package/dist/{serverBaseTypes-CuMsGXgc.d.cts → serverBaseTypes-CcWT_ZBe.d.cts} +2 -2
  58. package/dist/{serverBaseTypes-CuMsGXgc.d.cts.map → serverBaseTypes-CcWT_ZBe.d.cts.map} +1 -1
  59. package/dist/{serverExecuteTypes-TPX0GCgv.d.cts → serverExecuteTypes-CgjzwBaA.d.cts} +24 -5
  60. package/dist/serverExecuteTypes-CgjzwBaA.d.cts.map +1 -0
  61. package/dist/{serverExecuteTypes-DKG1mqy1.d.ts → serverExecuteTypes-jyr5aO5q.d.ts} +24 -5
  62. package/dist/serverExecuteTypes-jyr5aO5q.d.ts.map +1 -0
  63. package/dist/{serverModelTypes-MlqdaMRd.d.ts → serverModelTypes-DAqEyYtB.d.cts} +25 -7
  64. package/dist/serverModelTypes-DAqEyYtB.d.cts.map +1 -0
  65. package/dist/{serverModelTypes-MlqdaMRd.d.cts → serverModelTypes-DAqEyYtB.d.ts} +25 -7
  66. package/dist/serverModelTypes-DAqEyYtB.d.ts.map +1 -0
  67. package/dist/{serverQueryTypes-BLUe10AI.d.ts → serverQueryTypes-DPRP61yA.d.ts} +14 -5
  68. package/dist/serverQueryTypes-DPRP61yA.d.ts.map +1 -0
  69. package/dist/{serverQueryTypes-BZOoJBpb.d.cts → serverQueryTypes-H_mI6fPl.d.cts} +14 -5
  70. package/dist/serverQueryTypes-H_mI6fPl.d.cts.map +1 -0
  71. package/dist/{serverRequestTypes-BULjZnnz.d.ts → serverRequestTypes-BY0f5woc.d.ts} +5 -3
  72. package/dist/serverRequestTypes-BY0f5woc.d.ts.map +1 -0
  73. package/dist/{serverRequestTypes-XbnLUsXT.d.cts → serverRequestTypes-DGGqQMK3.d.cts} +5 -3
  74. package/dist/serverRequestTypes-DGGqQMK3.d.cts.map +1 -0
  75. package/dist/{serverResponseGuards-DY_8lAo7.d.ts → serverResponseGuards-BGHTBbtz.d.ts} +2 -2
  76. package/dist/{serverResponseGuards-DY_8lAo7.d.ts.map → serverResponseGuards-BGHTBbtz.d.ts.map} +1 -1
  77. package/dist/{serverResponseGuards-DIj9MIrJ.d.cts → serverResponseGuards-DGhrUL_c.d.cts} +2 -2
  78. package/dist/{serverResponseGuards-DIj9MIrJ.d.cts.map → serverResponseGuards-DGhrUL_c.d.cts.map} +1 -1
  79. package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
  80. package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
  81. package/dist/signing/canonicalize.cjs +25 -0
  82. package/dist/signing/canonicalize.cjs.map +1 -1
  83. package/dist/signing/canonicalize.d.cts +1 -1
  84. package/dist/signing/canonicalize.d.ts +1 -1
  85. package/dist/signing/canonicalize.js +25 -0
  86. package/dist/signing/canonicalize.js.map +1 -1
  87. package/dist/signing/eip712MethodByType.cjs +3 -0
  88. package/dist/signing/eip712MethodByType.cjs.map +1 -1
  89. package/dist/signing/eip712MethodByType.d.cts +1 -1
  90. package/dist/signing/eip712MethodByType.d.ts +1 -1
  91. package/dist/signing/eip712MethodByType.js +3 -0
  92. package/dist/signing/eip712MethodByType.js.map +1 -1
  93. package/dist/signing/index.d.cts +5 -5
  94. package/dist/signing/index.d.ts +5 -5
  95. package/dist/signing/payloadHash.d.cts +1 -1
  96. package/dist/signing/payloadHash.d.ts +1 -1
  97. package/dist/signing/types.d.cts +1 -1
  98. package/dist/signing/types.d.ts +1 -1
  99. package/dist/types/MobileServerFailureError.d.cts +1 -1
  100. package/dist/types/MobileServerFailureError.d.ts +1 -1
  101. package/dist/types/clientTypes.d.cts +2 -2
  102. package/dist/types/clientTypes.d.ts +2 -2
  103. package/dist/types/index.d.cts +9 -9
  104. package/dist/types/index.d.ts +9 -9
  105. package/dist/types/mobileErrorCodes.cjs +4 -0
  106. package/dist/types/mobileErrorCodes.cjs.map +1 -1
  107. package/dist/types/mobileErrorCodes.d.cts +1 -1
  108. package/dist/types/mobileErrorCodes.d.ts +1 -1
  109. package/dist/types/mobileErrorCodes.js +4 -0
  110. package/dist/types/mobileErrorCodes.js.map +1 -1
  111. package/dist/types/serverBaseTypes.d.cts +1 -1
  112. package/dist/types/serverBaseTypes.d.ts +1 -1
  113. package/dist/types/serverExecuteTypes.d.cts +2 -2
  114. package/dist/types/serverExecuteTypes.d.ts +2 -2
  115. package/dist/types/serverModelTypes.cjs.map +1 -1
  116. package/dist/types/serverModelTypes.d.cts +2 -2
  117. package/dist/types/serverModelTypes.d.ts +2 -2
  118. package/dist/types/serverModelTypes.js.map +1 -1
  119. package/dist/types/serverQueryTypes.d.cts +2 -2
  120. package/dist/types/serverQueryTypes.d.ts +2 -2
  121. package/dist/types/serverRequestTypes.d.cts +1 -1
  122. package/dist/types/serverRequestTypes.d.ts +1 -1
  123. package/dist/{types-B_4veFLc.d.ts → types-B021odcS.d.ts} +12 -3
  124. package/dist/types-B021odcS.d.ts.map +1 -0
  125. package/dist/{types-CwpXP7xM.d.cts → types-l47aSWtA.d.cts} +12 -3
  126. package/dist/types-l47aSWtA.d.cts.map +1 -0
  127. package/dist/utils/index.cjs +4 -0
  128. package/dist/utils/index.d.cts +3 -2
  129. package/dist/utils/index.d.ts +3 -2
  130. package/dist/utils/index.js +2 -1
  131. package/dist/utils/profile.cjs +22 -0
  132. package/dist/utils/profile.cjs.map +1 -0
  133. package/dist/utils/profile.d.cts +2 -0
  134. package/dist/utils/profile.d.ts +2 -0
  135. package/dist/utils/profile.js +19 -0
  136. package/dist/utils/profile.js.map +1 -0
  137. package/dist/utils/serverResponseGuards.d.cts +1 -1
  138. package/dist/utils/serverResponseGuards.d.ts +1 -1
  139. package/package.json +3 -3
  140. package/src/MobileClient.ts +85 -3
  141. package/src/dataMappers.ts +49 -4
  142. package/src/signing/canonicalize.ts +20 -0
  143. package/src/signing/eip712MethodByType.ts +3 -0
  144. package/src/signing/signing.test.ts +67 -1
  145. package/src/signing/types.ts +10 -1
  146. package/src/types/clientTypes.ts +73 -9
  147. package/src/types/mobileErrorCodes.ts +4 -0
  148. package/src/types/serverExecuteTypes.ts +21 -1
  149. package/src/types/serverModelTypes.ts +31 -5
  150. package/src/types/serverQueryTypes.ts +11 -0
  151. package/src/types/serverRequestTypes.ts +2 -0
  152. package/src/utils/index.ts +1 -0
  153. package/src/utils/profile.test.ts +22 -0
  154. package/src/utils/profile.ts +16 -0
  155. package/dist/MobileClient-BbTaqTzi.cjs.map +0 -1
  156. package/dist/canonicalize-0_B6UOxO.d.cts.map +0 -1
  157. package/dist/canonicalize-BC-JICjp.d.ts.map +0 -1
  158. package/dist/clientTypes-P4LAjreY.d.ts.map +0 -1
  159. package/dist/clientTypes-YF5d8bvg.d.cts.map +0 -1
  160. package/dist/eip712MethodByType-DWtLyPY7.d.ts.map +0 -1
  161. package/dist/eip712MethodByType-sHQ-VTHd.d.cts.map +0 -1
  162. package/dist/mobileErrorCodes-DccrM4NI.d.cts.map +0 -1
  163. package/dist/mobileErrorCodes-DccrM4NI.d.ts.map +0 -1
  164. package/dist/payloadHash-CSgTglN4.d.cts.map +0 -1
  165. package/dist/payloadHash-qsU1DEF0.d.ts.map +0 -1
  166. package/dist/serverExecuteTypes-DKG1mqy1.d.ts.map +0 -1
  167. package/dist/serverExecuteTypes-TPX0GCgv.d.cts.map +0 -1
  168. package/dist/serverModelTypes-MlqdaMRd.d.cts.map +0 -1
  169. package/dist/serverModelTypes-MlqdaMRd.d.ts.map +0 -1
  170. package/dist/serverQueryTypes-BLUe10AI.d.ts.map +0 -1
  171. package/dist/serverQueryTypes-BZOoJBpb.d.cts.map +0 -1
  172. package/dist/serverRequestTypes-BULjZnnz.d.ts.map +0 -1
  173. package/dist/serverRequestTypes-XbnLUsXT.d.cts.map +0 -1
  174. package/dist/types-B_4veFLc.d.ts.map +0 -1
  175. package/dist/types-CwpXP7xM.d.cts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MobileClient.js","names":[],"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 mapMobileFeedPage,\n mapMobileFollowListPage,\n mapMobileFollowListParamsToServer,\n mapMobileFollowMutationResult,\n mapMobileNotificationPreferences,\n mapMobileNotificationPreferencesToServer,\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 MobileFeedPage,\n MobileFollowListPage,\n MobileFollowMutationResult,\n MobileNotificationPreferences,\n MobilePublicProfile,\n MobileRegisteredWallet,\n MobileRegisterExpoTokenParams,\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} 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, public profile lookups, the global trade feed,\n * session-based social feeds, the follower/following graph, privacy settings, and push notification\n * 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 * 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 * 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 * 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 * @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 */\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 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":";;;;;;;;;;;;;AAoHA,IAAa,eAAb,MAA0B;CAIxB,YAAY,MAAwB;EAClC,KAAK,OAAO;EACZ,KAAK,gBAAgB,MAAM,OAAO;GAChC,iBAAiB;GAEjB,sBAAsB;GACtB,SAAS,yBAAyB,KAAK,UAAU;EACnD,CAAC;CACH;;;;;;CAOA,gBACE,0BACA;EACA,KAAK,KAAK,2BAA2B,4BAA4B,KAAA;CACnE;;;;CASA,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,IAAI,eAAe;GACnD,SAAS,OAAO,UACZ,i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IAAI,MACR,4EAA4E,KAAK,UAAU,IAAI,GACjG;CAEJ;AACF"}
1
+ {"version":3,"file":"MobileClient.js","names":[],"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 mapMobileFollowListPage,\n mapMobileFollowListParamsToServer,\n mapMobileFollowMutationResult,\n mapMobileNotificationPreferences,\n mapMobileNotificationPreferencesToServer,\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 MobileFollowListPage,\n MobileFollowMutationResult,\n MobileNotificationPreferences,\n MobilePublicProfile,\n MobileRegisteredWallet,\n MobileRegisterExpoTokenParams,\n MobileSetAvatarParams,\n MobileSetBioParams,\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} 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 * 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 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":";;;;;;;;;;;;;AA4HA,IAAa,eAAb,MAA0B;CAIxB,YAAY,MAAwB;EAClC,KAAK,OAAO;EACZ,KAAK,gBAAgB,MAAM,OAAO;GAChC,iBAAiB;GAEjB,sBAAsB;GACtB,SAAS,yB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AAG;EACL;EACA,OAAO,yBAAyB;GAAE,GAAG;GAAQ;GAAc;EAAM,CAAC;CACpE;CAIA,MAAgB,YACd,MACoD;EACpD,MAAM,WAAW,MAAM,KAAK,cAAc,KACxC,GAAG,KAAK,KAAK,IAAI,gBACjB,IACF;EAEA,KAAK,oBAAoB,QAAQ;EACjC,KAAK,kBAAkB,QAAQ;EAG/B,OAAO,SAAS;CAClB;CAEA,MAAgB,cACd,MACsC;EACtC,MAAM,WAAW,MAAM,KAAK,cAAc,KACxC,GAAG,KAAK,KAAK,IAAI,kBACjB,IACF;EAEA,KAAK,oBAAoB,QAAQ;EACjC,KAAK,kBAAkB,QAAQ;EAG/B,OAAO,SAAS;CAClB;CAIA,MAAgB,QACd,MACgD;EAChD,MAAM,WAAW,MAAM,KAAK,cAAc,KACxC,GAAG,KAAK,KAAK,IAAI,WACjB,IACF;EAEA,KAAK,oBAAoB,QAAQ;EACjC,KAAK,kBAAkB,QAAQ;EAG/B,OAAO,SAAS;CAClB;;;;;;CAOA,oBAA4B,UAAkC;EAC5D,IAAI,SAAS,UAAU,OAAO,SAAS,SAAS,KAC9C;EAEF,IAAI,8BAA8B,SAAS,IAAI,GAC7C,MAAM,IAAI,yBAAyB,SAAS,MAAM,SAAS,MAAM;EAEnE,MAAM,IAAI,MACR,4CAA4C,SAAS,OAAO,GAAG,SAAS,WAAW,UAAU,KAAK,UAAU,SAAS,IAAI,GAC3H;CACF;CAEA,kBAA0B,UAAkC;EAC1D,MAAM,EAAE,SAAS;EAEjB,IAAI,8BAA8B,IAAI,GACpC,MAAM,IAAI,yBAAyB,MAAM,SAAS,MAAM;EAE1D,IAAI,CAAC,8BAA8B,IAAI,GACrC,MAAM,IAAI,MACR,4EAA4E,KAAK,UAAU,IAAI,GACjG;CAEJ;AACF"}
@@ -1,5 +1,5 @@
1
- import { c as MobileServerRequestType } from "./serverRequestTypes-BULjZnnz.js";
2
- import { t as MobileServerFailureResponse } from "./serverBaseTypes-DKCLDn3x.js";
1
+ import { c as MobileServerRequestType } from "./serverRequestTypes-BY0f5woc.js";
2
+ import { t as MobileServerFailureResponse } from "./serverBaseTypes-CWBdZomv.js";
3
3
  import { BaseServerFailureError } from "@nadohq/shared";
4
4
 
5
5
  //#region src/types/MobileServerFailureError.d.ts
@@ -20,4 +20,4 @@ declare class MobileServerFailureError extends BaseServerFailureError {
20
20
  }
21
21
  //#endregion
22
22
  export { MobileServerFailureError as t };
23
- //# sourceMappingURL=MobileServerFailureError-B2og8e5O.d.ts.map
23
+ //# sourceMappingURL=MobileServerFailureError-DvtkMAVX.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MobileServerFailureError-B2og8e5O.d.ts","names":[],"sources":["../src/types/src/types/MobileServerFailureError.ts"],"mappings":";;;;;;;AASA;;;cAAa,wBAAA,SAAiC,sBAAA;EAAA,SAC3B,YAAA,EAAc,2BAAA;EAAA,SACd,WAAA,EAAa,uBAAA;EAFc;;;;EAAA,SAQnC,UAAA;cAEG,YAAA,EAAc,2BAAA,EAA6B,UAAA;AAAA"}
1
+ {"version":3,"file":"MobileServerFailureError-DvtkMAVX.d.ts","names":[],"sources":["../src/types/src/types/MobileServerFailureError.ts"],"mappings":";;;;;;;AASA;;;cAAa,wBAAA,SAAiC,sBAAA;EAAA,SAC3B,YAAA,EAAc,2BAAA;EAAA,SACd,WAAA,EAAa,uBAAA;EAFc;;;;EAAA,SAQnC,UAAA;cAEG,YAAA,EAAc,2BAAA,EAA6B,UAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import { c as MobileServerRequestType } from "./serverRequestTypes-XbnLUsXT.cjs";
2
- import { t as MobileServerFailureResponse } from "./serverBaseTypes-CuMsGXgc.cjs";
1
+ import { c as MobileServerRequestType } from "./serverRequestTypes-DGGqQMK3.cjs";
2
+ import { t as MobileServerFailureResponse } from "./serverBaseTypes-CcWT_ZBe.cjs";
3
3
  import { BaseServerFailureError } from "@nadohq/shared";
4
4
 
5
5
  //#region src/types/MobileServerFailureError.d.ts
@@ -20,4 +20,4 @@ declare class MobileServerFailureError extends BaseServerFailureError {
20
20
  }
21
21
  //#endregion
22
22
  export { MobileServerFailureError as t };
23
- //# sourceMappingURL=MobileServerFailureError-BrLtaHnU.d.cts.map
23
+ //# sourceMappingURL=MobileServerFailureError-kbMi1Ntc.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MobileServerFailureError-BrLtaHnU.d.cts","names":[],"sources":["../src/types/src/types/MobileServerFailureError.ts"],"mappings":";;;;;;;AASA;;;cAAa,wBAAA,SAAiC,sBAAA;EAAA,SAC3B,YAAA,EAAc,2BAAA;EAAA,SACd,WAAA,EAAa,uBAAA;EAFc;;;;EAAA,SAQnC,UAAA;cAEG,YAAA,EAAc,2BAAA,EAA6B,UAAA;AAAA"}
1
+ {"version":3,"file":"MobileServerFailureError-kbMi1Ntc.d.cts","names":[],"sources":["../src/types/src/types/MobileServerFailureError.ts"],"mappings":";;;;;;;AASA;;;cAAa,wBAAA,SAAiC,sBAAA;EAAA,SAC3B,YAAA,EAAc,2BAAA;EAAA,SACd,WAAA,EAAa,uBAAA;EAFc;;;;EAAA,SAQnC,UAAA;cAEG,YAAA,EAAc,2BAAA,EAA6B,UAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { a as MobileSignedRequest, n as MobileSignedInner, t as BuildSignedMobileRequestParams } from "./types-CwpXP7xM.cjs";
1
+ import { a as MobileSignedRequest, n as MobileSignedInner, t as BuildSignedMobileRequestParams } from "./types-l47aSWtA.cjs";
2
2
 
3
3
  //#region src/signing/buildSignedMobileRequest.d.ts
4
4
  /**
@@ -11,4 +11,4 @@ declare function buildSignedMobileRequest<T extends MobileSignedInner>(params: B
11
11
  }): Promise<MobileSignedRequest<T>>;
12
12
  //#endregion
13
13
  export { buildSignedMobileRequest as t };
14
- //# sourceMappingURL=buildSignedMobileRequest-CZ-EdxYI.d.cts.map
14
+ //# sourceMappingURL=buildSignedMobileRequest-DBWN0z0u.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildSignedMobileRequest-CZ-EdxYI.d.cts","names":[],"sources":["../src/signing/src/signing/buildSignedMobileRequest.ts"],"mappings":";;;;;AAgBA;;;iBAAsB,wBAAA,WAAmC,iBAAA,CAAA,CACvD,MAAA,EAAQ,8BAAA;EAAmC,KAAA,EAAO,CAAA;AAAA,IACjD,OAAA,CAAQ,mBAAA,CAAoB,CAAA"}
1
+ {"version":3,"file":"buildSignedMobileRequest-DBWN0z0u.d.cts","names":[],"sources":["../src/signing/src/signing/buildSignedMobileRequest.ts"],"mappings":";;;;;AAgBA;;;iBAAsB,wBAAA,WAAmC,iBAAA,CAAA,CACvD,MAAA,EAAQ,8BAAA;EAAmC,KAAA,EAAO,CAAA;AAAA,IACjD,OAAA,CAAQ,mBAAA,CAAoB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { a as MobileSignedRequest, n as MobileSignedInner, t as BuildSignedMobileRequestParams } from "./types-B_4veFLc.js";
1
+ import { a as MobileSignedRequest, n as MobileSignedInner, t as BuildSignedMobileRequestParams } from "./types-B021odcS.js";
2
2
 
3
3
  //#region src/signing/buildSignedMobileRequest.d.ts
4
4
  /**
@@ -11,4 +11,4 @@ declare function buildSignedMobileRequest<T extends MobileSignedInner>(params: B
11
11
  }): Promise<MobileSignedRequest<T>>;
12
12
  //#endregion
13
13
  export { buildSignedMobileRequest as t };
14
- //# sourceMappingURL=buildSignedMobileRequest-CoAVSDPx.d.ts.map
14
+ //# sourceMappingURL=buildSignedMobileRequest-lSIJmG6D.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildSignedMobileRequest-CoAVSDPx.d.ts","names":[],"sources":["../src/signing/src/signing/buildSignedMobileRequest.ts"],"mappings":";;;;;AAgBA;;;iBAAsB,wBAAA,WAAmC,iBAAA,CAAA,CACvD,MAAA,EAAQ,8BAAA;EAAmC,KAAA,EAAO,CAAA;AAAA,IACjD,OAAA,CAAQ,mBAAA,CAAoB,CAAA"}
1
+ {"version":3,"file":"buildSignedMobileRequest-lSIJmG6D.d.ts","names":[],"sources":["../src/signing/src/signing/buildSignedMobileRequest.ts"],"mappings":";;;;;AAgBA;;;iBAAsB,wBAAA,WAAmC,iBAAA,CAAA,CACvD,MAAA,EAAQ,8BAAA;EAAmC,KAAA,EAAO,CAAA;AAAA,IACjD,OAAA,CAAQ,mBAAA,CAAoB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { n as MobileSignedInner } from "./types-B_4veFLc.js";
1
+ import { n as MobileSignedInner } from "./types-B021odcS.js";
2
2
 
3
3
  //#region src/signing/canonicalize.d.ts
4
4
  /**
@@ -11,4 +11,4 @@ import { n as MobileSignedInner } from "./types-B_4veFLc.js";
11
11
  declare function canonicalizeMobileInner(inner: MobileSignedInner): MobileSignedInner;
12
12
  //#endregion
13
13
  export { canonicalizeMobileInner as t };
14
- //# sourceMappingURL=canonicalize-BC-JICjp.d.ts.map
14
+ //# sourceMappingURL=canonicalize-Cx3lCVpm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonicalize-Cx3lCVpm.d.ts","names":[],"sources":["../src/signing/src/signing/canonicalize.ts"],"mappings":";;;;;AASA;;;;;iBAAgB,uBAAA,CACd,KAAA,EAAO,iBAAA,GACN,iBAAiB"}
@@ -1,4 +1,4 @@
1
- import { n as MobileSignedInner } from "./types-CwpXP7xM.cjs";
1
+ import { n as MobileSignedInner } from "./types-l47aSWtA.cjs";
2
2
 
3
3
  //#region src/signing/canonicalize.d.ts
4
4
  /**
@@ -11,4 +11,4 @@ import { n as MobileSignedInner } from "./types-CwpXP7xM.cjs";
11
11
  declare function canonicalizeMobileInner(inner: MobileSignedInner): MobileSignedInner;
12
12
  //#endregion
13
13
  export { canonicalizeMobileInner as t };
14
- //# sourceMappingURL=canonicalize-0_B6UOxO.d.cts.map
14
+ //# sourceMappingURL=canonicalize-DNgB8Jsm.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonicalize-DNgB8Jsm.d.cts","names":[],"sources":["../src/signing/src/signing/canonicalize.ts"],"mappings":";;;;;AASA;;;;;iBAAgB,uBAAA,CACd,KAAA,EAAO,iBAAA,GACN,iBAAiB"}
@@ -1,9 +1,43 @@
1
- import { $ as MobileSocialFeedTraderDataStatus, B as MobileSocialFeedLeverage, G as MobileSocialFeedPositionDisplayBasis, H as MobileSocialFeedPnlBasis, J as MobileSocialFeedSourceCategory, K as MobileSocialFeedPositionState, Q as MobileSocialFeedTraderBadgeCode, R as MobileSocialFeedCohortStatus, U as MobileSocialFeedPnlMode, V as MobileSocialFeedMarketCategory, W as MobileSocialFeedPnlQuality, X as MobileSocialFeedTradeCardAction, Z as MobileSocialFeedTradeSizeChangeAction, a as MobileFeedTradePosition, c as MobileNotificationCategory, et as MobileSocialFeedType, i as MobileFeedMarginMode, l as MobileNotificationPlatform, o as MobileFeedTradePositionDirection, q as MobileSocialFeedReadSessionMode, tt as MobileSocialFeedUnavailableTarget, z as MobileSocialFeedHistoryQuality } from "./serverModelTypes-MlqdaMRd.cjs";
1
+ import { $ as MobileSocialFeedTradeSizeChangeAction, B as MobileSocialFeedCohortStatus, G as MobileSocialFeedPnlMode, H as MobileSocialFeedLeverage, J as MobileSocialFeedPositionState, K as MobileSocialFeedPnlQuality, Q as MobileSocialFeedTradeCardAction, U as MobileSocialFeedMarketCategory, V as MobileSocialFeedHistoryQuality, W as MobileSocialFeedPnlBasis, X as MobileSocialFeedSourceCategory, Y as MobileSocialFeedReadSessionMode, a as MobileFeedTradePosition, c as MobileNotificationCategory, et as MobileSocialFeedTraderBadgeCode, i as MobileFeedMarginMode, l as MobileNotificationPlatform, nt as MobileSocialFeedType, o as MobileFeedTradePositionDirection, q as MobileSocialFeedPositionDisplayBasis, rt as MobileSocialFeedUnavailableTarget, tt as MobileSocialFeedTraderDataStatus } from "./serverModelTypes-DAqEyYtB.cjs";
2
2
  import { SignatureParams, Subaccount } from "@nadohq/shared";
3
3
  import { Hex } from "viem";
4
4
  import BigNumber from "bignumber.js";
5
5
 
6
6
  //#region src/types/clientTypes.d.ts
7
+ /**
8
+ * Server-owned preset presented in catalogue order.
9
+ */
10
+ interface MobileAvatarPreset {
11
+ /** Stable preset ID used by setAvatar. */
12
+ id: string;
13
+ /** Public image URL. Fall back to a generated icon if the image fails to load, e.g. after retirement. */
14
+ avatarUrl: string;
15
+ }
16
+ /**
17
+ * A preset or staged upload to publish. Pass null to clear an avatar.
18
+ */
19
+ type MobileAvatarSelection = {
20
+ /** Shared catalogue selection. */type: 'preset'; /** Stable catalogue ID. */
21
+ id: string;
22
+ } | {
23
+ /** An uploaded image awaiting publication. */type: 'upload'; /** Key returned by createAvatarUpload. */
24
+ uploadKey: string;
25
+ };
26
+ /**
27
+ * Upload a square JPEG or PNG (up to 4096 × 4096 pixels and `MOBILE_AVATAR_MAX_UPLOAD_BYTES` bytes)
28
+ * using PUT, then publish uploadKey through setAvatar. Publication validates the image; a successful PUT
29
+ * alone does not mean it is accepted.
30
+ */
31
+ interface MobileAvatarUpload {
32
+ /** Staging key, bound to the requesting subaccount. */
33
+ uploadKey: string;
34
+ /** Short-lived signed PUT URL. */
35
+ uploadUrl: string;
36
+ /** Send unchanged, even for PNG: the signed Content-Type is image/jpeg. */
37
+ headers: Record<string, string>;
38
+ /** Upload URL lifetime in seconds from issuance, not from when the response is received. */
39
+ expiresInSeconds: number;
40
+ }
7
41
  /**
8
42
  * A subaccount's public profile, as returned by an unsigned profile lookup. Private Mode hides the account's
9
43
  * activity, not its profile, so `privateMode` is exposed here too. A subaccount with no identity row still
@@ -12,12 +46,9 @@ import BigNumber from "bignumber.js";
12
46
  * The last three fields are `undefined` unless the matching {@link MobileProfilesInclude} asked for them —
13
47
  * absent means "not requested" rather than "none".
14
48
  */
15
- interface MobilePublicProfile {
16
- subaccount: Hex;
17
- /** Canonical, lowercased handle, or `null` if no username has been claimed. */
18
- username: string | null;
19
- /** User-facing name as claimed, or `null` if no username has been claimed. */
20
- displayName: string | null;
49
+ interface MobilePublicProfile extends MobileIdentitySummary {
50
+ /** Public biography, or null when unset. */
51
+ bio: string | null;
21
52
  privateMode: boolean;
22
53
  /**
23
54
  * Exact count at query time rather than a cached counter, including unnamed and private accounts — Private
@@ -34,11 +65,11 @@ interface MobilePublicProfile {
34
65
  */
35
66
  interface MobileIdentitySummary {
36
67
  subaccount: Hex;
37
- /** `null` when the account has not claimed a username; render a local fallback label from `subaccount`. */
68
+ /** Canonical, lowercased handle; when null, render a local fallback label from `subaccount`. */
38
69
  username: string | null;
39
- /** `null` when the account has not claimed a username; render a local fallback label from `subaccount`. */
70
+ /** User-facing name as claimed; when null, render a local fallback label from `subaccount`. */
40
71
  displayName: string | null;
41
- /** Reserved for a future avatar source; `null` until one is implemented. */
72
+ /** Published avatar URL. Use a generated icon when null or when the image fails to load. */
42
73
  avatarUrl: string | null;
43
74
  }
44
75
  /**
@@ -253,6 +284,27 @@ interface GetMobileFeedParams {
253
284
  */
254
285
  cursor?: string;
255
286
  }
287
+ /**
288
+ * Params for {@link MobileClient.setBio}.
289
+ */
290
+ interface MobileSetBioParams extends MobileSignedRequestParams {
291
+ /** Up to `MOBILE_BIO_MAX_LENGTH` (150) Unicode code points without null characters. Whitespace-only text clears the bio. */
292
+ bio: string;
293
+ }
294
+ /**
295
+ * Params for {@link MobileClient.setAvatar}.
296
+ */
297
+ interface MobileSetAvatarParams extends MobileSignedRequestParams {
298
+ /** Null clears the saved image. */
299
+ avatar: MobileAvatarSelection | null;
300
+ }
301
+ /**
302
+ * Params for {@link MobileClient.createAvatarUpload}.
303
+ */
304
+ interface MobileCreateAvatarUploadParams extends MobileSignedRequestParams {
305
+ /** Image size as an integer number of bytes, from 1 to `MOBILE_AVATAR_MAX_UPLOAD_BYTES` (5 MiB). */
306
+ contentLength: number;
307
+ }
256
308
  /**
257
309
  * Params for {@link MobileClient.setUsername}.
258
310
  */
@@ -727,5 +779,5 @@ type GetMobileFeedUpdatesParams = {
727
779
  viewerToken: string;
728
780
  };
729
781
  //#endregion
730
- export { MobileSocialFeedRankedPage as $, MobileRegisterExpoTokenParams as A, MobileSocialFeedCohortCoverage as B, MobileFollowSummary as C, MobileNotificationPreferences as D, MobileNotificationPreferenceScope as E, MobileSignedRequestParams as F, MobileSocialFeedItemPatch as G, MobileSocialFeedInteraction as H, MobileSocialFeedAuthor as I, MobileSocialFeedMarket as J, MobileSocialFeedItemResponse as K, MobileSocialFeedCapabilities as L, MobileSetFollowParams as M, MobileSetPrivateModeParams as N, MobileProfilesInclude as O, MobileSetUsernameParams as P, MobileSocialFeedPositionPatch as Q, MobileSocialFeedCategorizedParams as R, MobileFollowMutationResult as S, MobileNotificationCategoryPreference as T, MobileSocialFeedItem as U, MobileSocialFeedCommentPreview as V, MobileSocialFeedItemBase as W, MobileSocialFeedPnl as X, MobileSocialFeedPage as Y, MobileSocialFeedPositionCard as Z, MobileFeedMargin as _, GetMobileFollowersParams as a, MobileSocialFeedTradeRowBase as at, MobileFollowListAccount as b, GetMobileFriendsFeedParams as c, MobileSocialFeedViewTracking as ct, GetMobilePositionFeedParams as d, MobileUsernameAvailability as dt, MobileSocialFeedReadParams as et, GetMobileProfileFeedParams as f, MobileWithExpoTokenParams as ft, GetMobileUsernameAvailabilityParams as g, GetMobileTopTradersFeedParams as h, GetMobileFollowListParams as i, MobileSocialFeedTradeRow as it, MobileRegisteredWallet as j, MobilePublicProfile as k, GetMobileMarketFeedParams as l, MobileUnregisterExpoTokenParams as lt, GetMobileRegisteredWalletParams as m, GetMobileFeedParams as n, MobileSocialFeedTopTradersPage as nt, GetMobileFollowingParams as o, MobileSocialFeedTraderBadge as ot, GetMobileProfilesParams as p, MobileSocialFeedListParams as q, GetMobileFeedUpdatesParams as r, MobileSocialFeedTradeCard as rt, GetMobileForYouFeedParams as s, MobileSocialFeedUpdates as st, GetMobileFeedItemParams as t, MobileSocialFeedReadSession as tt, GetMobileNotificationPreferencesParams as u, MobileUpdateNotificationPreferencesParams as ut, MobileFeedPage as v, MobileIdentitySummary as w, MobileFollowListPage as x, MobileFeedTrade as y, MobileSocialFeedCohort as z };
731
- //# sourceMappingURL=clientTypes-YF5d8bvg.d.cts.map
782
+ export { MobileSocialFeedListParams as $, MobileNotificationPreferenceScope as A, MobileSetUsernameParams as B, MobileFeedTrade as C, MobileFollowSummary as D, MobileFollowMutationResult as E, MobileRegisteredWallet as F, MobileSocialFeedCohort as G, MobileSocialFeedAuthor as H, MobileSetAvatarParams as I, MobileSocialFeedInteraction as J, MobileSocialFeedCohortCoverage as K, MobileSetBioParams as L, MobileProfilesInclude as M, MobilePublicProfile as N, MobileIdentitySummary as O, MobileRegisterExpoTokenParams as P, MobileSocialFeedItemResponse as Q, MobileSetFollowParams as R, MobileFeedPage as S, MobileFollowListPage as T, MobileSocialFeedCapabilities as U, MobileSignedRequestParams as V, MobileSocialFeedCategorizedParams as W, MobileSocialFeedItemBase as X, MobileSocialFeedItem as Y, MobileSocialFeedItemPatch as Z, MobileAvatarPreset as _, MobileUsernameAvailability as _t, GetMobileFollowersParams as a, MobileSocialFeedRankedPage as at, MobileCreateAvatarUploadParams as b, GetMobileFriendsFeedParams as c, MobileSocialFeedTopTradersPage as ct, GetMobilePositionFeedParams as d, MobileSocialFeedTradeRowBase as dt, MobileSocialFeedMarket as et, GetMobileProfileFeedParams as f, MobileSocialFeedTraderBadge as ft, GetMobileUsernameAvailabilityParams as g, MobileUpdateNotificationPreferencesParams as gt, GetMobileTopTradersFeedParams as h, MobileUnregisterExpoTokenParams as ht, GetMobileFollowListParams as i, MobileSocialFeedPositionPatch as it, MobileNotificationPreferences as j, MobileNotificationCategoryPreference as k, GetMobileMarketFeedParams as l, MobileSocialFeedTradeCard as lt, GetMobileRegisteredWalletParams as m, MobileSocialFeedViewTracking as mt, GetMobileFeedParams as n, MobileSocialFeedPnl as nt, GetMobileFollowingParams as o, MobileSocialFeedReadParams as ot, GetMobileProfilesParams as p, MobileSocialFeedUpdates as pt, MobileSocialFeedCommentPreview as q, GetMobileFeedUpdatesParams as r, MobileSocialFeedPositionCard as rt, GetMobileForYouFeedParams as s, MobileSocialFeedReadSession as st, GetMobileFeedItemParams as t, MobileSocialFeedPage as tt, GetMobileNotificationPreferencesParams as u, MobileSocialFeedTradeRow as ut, MobileAvatarSelection as v, MobileWithExpoTokenParams as vt, MobileFollowListAccount as w, MobileFeedMargin as x, MobileAvatarUpload as y, MobileSetPrivateModeParams as z };
783
+ //# sourceMappingURL=clientTypes-DnPE1zZO.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientTypes-DnPE1zZO.d.cts","names":[],"sources":["../src/types/src/types/clientTypes.ts"],"mappings":";;;;;;;;AA+BA;UAAiB,kBAAA;;EAEf,EAAA;EAES;EAAT,SAAS;AAAA;;;;KAMC,qBAAA;EASN,kCANA,IAAA,YAQS;EANT,EAAA;AAAA;EAc6B,8CAV7B,IAAA,YAgBW;EAdX,SAAA;AAAA;;;;;AAgBY;UARD,kBAAA;EAmBoB;EAjBnC,SAAA;EAiBgE;EAfhE,SAAA;EAiBA;EAfA,OAAA,EAAS,MAAM;EAqBf;EAnBA,gBAAA;AAAA;;;AAsBmC;AAOrC;;;;;UAlBiB,mBAAA,SAA4B,qBAAqB;EAqBhE;EAnBA,GAAA;EACA,WAAA;EAsBS;AAAA;AAQX;;EAzBE,aAAA;EACA,cAAA;EA0BA;EAxBA,aAAA,GAAgB,mBAAA;AAAA;;;AA+BiB;AAMnC;UA9BiB,qBAAA;EACf,UAAA,EAAY,GAAG;EA8BgB;EA5B/B,QAAA;EA4BU;EA1BV,WAAA;EAmCA;EAjCA,SAAA;AAAA;AAyCF;;;;;AAAA,UAjCiB,mBAAA;EAoCf;EAlCA,WAAA;EAkCU;EAhCV,eAAA;EAuCyC;;;AAG5B;EArCb,UAAA,EAAY,qBAAqB;AAAA;;;AA6CxB;UAvCM,uBAAA;EACf,QAAA,EAAU,qBAAqB;;;;;;;EAO/B,WAAA;EAiDe;EA/Cf,aAAA;AAAA;;;;;;UAQe,oBAAA;EACf,QAAA,EAAU,uBAAuB;EAwCjC;EAtCA,UAAA;AAAA;;;;;UA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,cAAA,YAvBwC;EAyBxC,kBAAA,YAtBE;EAwBF,YAAA,kBAxBY;EA0BZ,gBAAA,UAtBiC;EAwBjC,UAAA,UAxB8D;EA0B9D,WAAA;AAAA"}
@@ -1,9 +1,43 @@
1
- import { $ as MobileSocialFeedTraderDataStatus, B as MobileSocialFeedLeverage, G as MobileSocialFeedPositionDisplayBasis, H as MobileSocialFeedPnlBasis, J as MobileSocialFeedSourceCategory, K as MobileSocialFeedPositionState, Q as MobileSocialFeedTraderBadgeCode, R as MobileSocialFeedCohortStatus, U as MobileSocialFeedPnlMode, V as MobileSocialFeedMarketCategory, W as MobileSocialFeedPnlQuality, X as MobileSocialFeedTradeCardAction, Z as MobileSocialFeedTradeSizeChangeAction, a as MobileFeedTradePosition, c as MobileNotificationCategory, et as MobileSocialFeedType, i as MobileFeedMarginMode, l as MobileNotificationPlatform, o as MobileFeedTradePositionDirection, q as MobileSocialFeedReadSessionMode, tt as MobileSocialFeedUnavailableTarget, z as MobileSocialFeedHistoryQuality } from "./serverModelTypes-MlqdaMRd.js";
1
+ import { $ as MobileSocialFeedTradeSizeChangeAction, B as MobileSocialFeedCohortStatus, G as MobileSocialFeedPnlMode, H as MobileSocialFeedLeverage, J as MobileSocialFeedPositionState, K as MobileSocialFeedPnlQuality, Q as MobileSocialFeedTradeCardAction, U as MobileSocialFeedMarketCategory, V as MobileSocialFeedHistoryQuality, W as MobileSocialFeedPnlBasis, X as MobileSocialFeedSourceCategory, Y as MobileSocialFeedReadSessionMode, a as MobileFeedTradePosition, c as MobileNotificationCategory, et as MobileSocialFeedTraderBadgeCode, i as MobileFeedMarginMode, l as MobileNotificationPlatform, nt as MobileSocialFeedType, o as MobileFeedTradePositionDirection, q as MobileSocialFeedPositionDisplayBasis, rt as MobileSocialFeedUnavailableTarget, tt as MobileSocialFeedTraderDataStatus } from "./serverModelTypes-DAqEyYtB.js";
2
2
  import { SignatureParams, Subaccount } from "@nadohq/shared";
3
3
  import { Hex } from "viem";
4
4
  import BigNumber from "bignumber.js";
5
5
 
6
6
  //#region src/types/clientTypes.d.ts
7
+ /**
8
+ * Server-owned preset presented in catalogue order.
9
+ */
10
+ interface MobileAvatarPreset {
11
+ /** Stable preset ID used by setAvatar. */
12
+ id: string;
13
+ /** Public image URL. Fall back to a generated icon if the image fails to load, e.g. after retirement. */
14
+ avatarUrl: string;
15
+ }
16
+ /**
17
+ * A preset or staged upload to publish. Pass null to clear an avatar.
18
+ */
19
+ type MobileAvatarSelection = {
20
+ /** Shared catalogue selection. */type: 'preset'; /** Stable catalogue ID. */
21
+ id: string;
22
+ } | {
23
+ /** An uploaded image awaiting publication. */type: 'upload'; /** Key returned by createAvatarUpload. */
24
+ uploadKey: string;
25
+ };
26
+ /**
27
+ * Upload a square JPEG or PNG (up to 4096 × 4096 pixels and `MOBILE_AVATAR_MAX_UPLOAD_BYTES` bytes)
28
+ * using PUT, then publish uploadKey through setAvatar. Publication validates the image; a successful PUT
29
+ * alone does not mean it is accepted.
30
+ */
31
+ interface MobileAvatarUpload {
32
+ /** Staging key, bound to the requesting subaccount. */
33
+ uploadKey: string;
34
+ /** Short-lived signed PUT URL. */
35
+ uploadUrl: string;
36
+ /** Send unchanged, even for PNG: the signed Content-Type is image/jpeg. */
37
+ headers: Record<string, string>;
38
+ /** Upload URL lifetime in seconds from issuance, not from when the response is received. */
39
+ expiresInSeconds: number;
40
+ }
7
41
  /**
8
42
  * A subaccount's public profile, as returned by an unsigned profile lookup. Private Mode hides the account's
9
43
  * activity, not its profile, so `privateMode` is exposed here too. A subaccount with no identity row still
@@ -12,12 +46,9 @@ import BigNumber from "bignumber.js";
12
46
  * The last three fields are `undefined` unless the matching {@link MobileProfilesInclude} asked for them —
13
47
  * absent means "not requested" rather than "none".
14
48
  */
15
- interface MobilePublicProfile {
16
- subaccount: Hex;
17
- /** Canonical, lowercased handle, or `null` if no username has been claimed. */
18
- username: string | null;
19
- /** User-facing name as claimed, or `null` if no username has been claimed. */
20
- displayName: string | null;
49
+ interface MobilePublicProfile extends MobileIdentitySummary {
50
+ /** Public biography, or null when unset. */
51
+ bio: string | null;
21
52
  privateMode: boolean;
22
53
  /**
23
54
  * Exact count at query time rather than a cached counter, including unnamed and private accounts — Private
@@ -34,11 +65,11 @@ interface MobilePublicProfile {
34
65
  */
35
66
  interface MobileIdentitySummary {
36
67
  subaccount: Hex;
37
- /** `null` when the account has not claimed a username; render a local fallback label from `subaccount`. */
68
+ /** Canonical, lowercased handle; when null, render a local fallback label from `subaccount`. */
38
69
  username: string | null;
39
- /** `null` when the account has not claimed a username; render a local fallback label from `subaccount`. */
70
+ /** User-facing name as claimed; when null, render a local fallback label from `subaccount`. */
40
71
  displayName: string | null;
41
- /** Reserved for a future avatar source; `null` until one is implemented. */
72
+ /** Published avatar URL. Use a generated icon when null or when the image fails to load. */
42
73
  avatarUrl: string | null;
43
74
  }
44
75
  /**
@@ -253,6 +284,27 @@ interface GetMobileFeedParams {
253
284
  */
254
285
  cursor?: string;
255
286
  }
287
+ /**
288
+ * Params for {@link MobileClient.setBio}.
289
+ */
290
+ interface MobileSetBioParams extends MobileSignedRequestParams {
291
+ /** Up to `MOBILE_BIO_MAX_LENGTH` (150) Unicode code points without null characters. Whitespace-only text clears the bio. */
292
+ bio: string;
293
+ }
294
+ /**
295
+ * Params for {@link MobileClient.setAvatar}.
296
+ */
297
+ interface MobileSetAvatarParams extends MobileSignedRequestParams {
298
+ /** Null clears the saved image. */
299
+ avatar: MobileAvatarSelection | null;
300
+ }
301
+ /**
302
+ * Params for {@link MobileClient.createAvatarUpload}.
303
+ */
304
+ interface MobileCreateAvatarUploadParams extends MobileSignedRequestParams {
305
+ /** Image size as an integer number of bytes, from 1 to `MOBILE_AVATAR_MAX_UPLOAD_BYTES` (5 MiB). */
306
+ contentLength: number;
307
+ }
256
308
  /**
257
309
  * Params for {@link MobileClient.setUsername}.
258
310
  */
@@ -727,5 +779,5 @@ type GetMobileFeedUpdatesParams = {
727
779
  viewerToken: string;
728
780
  };
729
781
  //#endregion
730
- export { MobileSocialFeedRankedPage as $, MobileRegisterExpoTokenParams as A, MobileSocialFeedCohortCoverage as B, MobileFollowSummary as C, MobileNotificationPreferences as D, MobileNotificationPreferenceScope as E, MobileSignedRequestParams as F, MobileSocialFeedItemPatch as G, MobileSocialFeedInteraction as H, MobileSocialFeedAuthor as I, MobileSocialFeedMarket as J, MobileSocialFeedItemResponse as K, MobileSocialFeedCapabilities as L, MobileSetFollowParams as M, MobileSetPrivateModeParams as N, MobileProfilesInclude as O, MobileSetUsernameParams as P, MobileSocialFeedPositionPatch as Q, MobileSocialFeedCategorizedParams as R, MobileFollowMutationResult as S, MobileNotificationCategoryPreference as T, MobileSocialFeedItem as U, MobileSocialFeedCommentPreview as V, MobileSocialFeedItemBase as W, MobileSocialFeedPnl as X, MobileSocialFeedPage as Y, MobileSocialFeedPositionCard as Z, MobileFeedMargin as _, GetMobileFollowersParams as a, MobileSocialFeedTradeRowBase as at, MobileFollowListAccount as b, GetMobileFriendsFeedParams as c, MobileSocialFeedViewTracking as ct, GetMobilePositionFeedParams as d, MobileUsernameAvailability as dt, MobileSocialFeedReadParams as et, GetMobileProfileFeedParams as f, MobileWithExpoTokenParams as ft, GetMobileUsernameAvailabilityParams as g, GetMobileTopTradersFeedParams as h, GetMobileFollowListParams as i, MobileSocialFeedTradeRow as it, MobileRegisteredWallet as j, MobilePublicProfile as k, GetMobileMarketFeedParams as l, MobileUnregisterExpoTokenParams as lt, GetMobileRegisteredWalletParams as m, GetMobileFeedParams as n, MobileSocialFeedTopTradersPage as nt, GetMobileFollowingParams as o, MobileSocialFeedTraderBadge as ot, GetMobileProfilesParams as p, MobileSocialFeedListParams as q, GetMobileFeedUpdatesParams as r, MobileSocialFeedTradeCard as rt, GetMobileForYouFeedParams as s, MobileSocialFeedUpdates as st, GetMobileFeedItemParams as t, MobileSocialFeedReadSession as tt, GetMobileNotificationPreferencesParams as u, MobileUpdateNotificationPreferencesParams as ut, MobileFeedPage as v, MobileIdentitySummary as w, MobileFollowListPage as x, MobileFeedTrade as y, MobileSocialFeedCohort as z };
731
- //# sourceMappingURL=clientTypes-P4LAjreY.d.ts.map
782
+ export { MobileSocialFeedListParams as $, MobileNotificationPreferenceScope as A, MobileSetUsernameParams as B, MobileFeedTrade as C, MobileFollowSummary as D, MobileFollowMutationResult as E, MobileRegisteredWallet as F, MobileSocialFeedCohort as G, MobileSocialFeedAuthor as H, MobileSetAvatarParams as I, MobileSocialFeedInteraction as J, MobileSocialFeedCohortCoverage as K, MobileSetBioParams as L, MobileProfilesInclude as M, MobilePublicProfile as N, MobileIdentitySummary as O, MobileRegisterExpoTokenParams as P, MobileSocialFeedItemResponse as Q, MobileSetFollowParams as R, MobileFeedPage as S, MobileFollowListPage as T, MobileSocialFeedCapabilities as U, MobileSignedRequestParams as V, MobileSocialFeedCategorizedParams as W, MobileSocialFeedItemBase as X, MobileSocialFeedItem as Y, MobileSocialFeedItemPatch as Z, MobileAvatarPreset as _, MobileUsernameAvailability as _t, GetMobileFollowersParams as a, MobileSocialFeedRankedPage as at, MobileCreateAvatarUploadParams as b, GetMobileFriendsFeedParams as c, MobileSocialFeedTopTradersPage as ct, GetMobilePositionFeedParams as d, MobileSocialFeedTradeRowBase as dt, MobileSocialFeedMarket as et, GetMobileProfileFeedParams as f, MobileSocialFeedTraderBadge as ft, GetMobileUsernameAvailabilityParams as g, MobileUpdateNotificationPreferencesParams as gt, GetMobileTopTradersFeedParams as h, MobileUnregisterExpoTokenParams as ht, GetMobileFollowListParams as i, MobileSocialFeedPositionPatch as it, MobileNotificationPreferences as j, MobileNotificationCategoryPreference as k, GetMobileMarketFeedParams as l, MobileSocialFeedTradeCard as lt, GetMobileRegisteredWalletParams as m, MobileSocialFeedViewTracking as mt, GetMobileFeedParams as n, MobileSocialFeedPnl as nt, GetMobileFollowingParams as o, MobileSocialFeedReadParams as ot, GetMobileProfilesParams as p, MobileSocialFeedUpdates as pt, MobileSocialFeedCommentPreview as q, GetMobileFeedUpdatesParams as r, MobileSocialFeedPositionCard as rt, GetMobileForYouFeedParams as s, MobileSocialFeedReadSession as st, GetMobileFeedItemParams as t, MobileSocialFeedPage as tt, GetMobileNotificationPreferencesParams as u, MobileSocialFeedTradeRow as ut, MobileAvatarSelection as v, MobileWithExpoTokenParams as vt, MobileFollowListAccount as w, MobileFeedMargin as x, MobileAvatarUpload as y, MobileSetPrivateModeParams as z };
783
+ //# sourceMappingURL=clientTypes-ws9CDHw4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientTypes-ws9CDHw4.d.ts","names":[],"sources":["../src/types/src/types/clientTypes.ts"],"mappings":";;;;;;;;AA+BA;UAAiB,kBAAA;;EAEf,EAAA;EAES;EAAT,SAAS;AAAA;;;;KAMC,qBAAA;EASN,kCANA,IAAA,YAQS;EANT,EAAA;AAAA;EAc6B,8CAV7B,IAAA,YAgBW;EAdX,SAAA;AAAA;;;;;AAgBY;UARD,kBAAA;EAmBoB;EAjBnC,SAAA;EAiBgE;EAfhE,SAAA;EAiBA;EAfA,OAAA,EAAS,MAAM;EAqBf;EAnBA,gBAAA;AAAA;;;AAsBmC;AAOrC;;;;;UAlBiB,mBAAA,SAA4B,qBAAqB;EAqBhE;EAnBA,GAAA;EACA,WAAA;EAsBS;AAAA;AAQX;;EAzBE,aAAA;EACA,cAAA;EA0BA;EAxBA,aAAA,GAAgB,mBAAA;AAAA;;;AA+BiB;AAMnC;UA9BiB,qBAAA;EACf,UAAA,EAAY,GAAG;EA8BgB;EA5B/B,QAAA;EA4BU;EA1BV,WAAA;EAmCA;EAjCA,SAAA;AAAA;AAyCF;;;;;AAAA,UAjCiB,mBAAA;EAoCf;EAlCA,WAAA;EAkCU;EAhCV,eAAA;EAuCyC;;;AAG5B;EArCb,UAAA,EAAY,qBAAqB;AAAA;;;AA6CxB;UAvCM,uBAAA;EACf,QAAA,EAAU,qBAAqB;;;;;;;EAO/B,WAAA;EAiDe;EA/Cf,aAAA;AAAA;;;;;;UAQe,oBAAA;EACf,QAAA,EAAU,uBAAu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