@nadohq/mobile-client 0.64.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -7
- package/dist/MobileClient-M4oC4lrX.cjs +1101 -0
- package/dist/MobileClient-M4oC4lrX.cjs.map +1 -0
- package/dist/MobileClient.cjs +1 -1
- package/dist/MobileClient.d.cts +306 -10
- package/dist/MobileClient.d.cts.map +1 -1
- package/dist/MobileClient.d.ts +306 -10
- package/dist/MobileClient.d.ts.map +1 -1
- package/dist/MobileClient.js +544 -5
- package/dist/MobileClient.js.map +1 -1
- package/dist/{MobileServerFailureError-Dd3c6P_Z.d.ts → MobileServerFailureError-C9iqNsxI.d.ts} +2 -3
- package/dist/MobileServerFailureError-C9iqNsxI.d.ts.map +1 -0
- package/dist/{MobileServerFailureError-Bpa_WA9f.d.cts → MobileServerFailureError-MtS2reel.d.cts} +2 -3
- package/dist/MobileServerFailureError-MtS2reel.d.cts.map +1 -0
- package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.cts +15 -0
- package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.cts.map +1 -0
- package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.ts +15 -0
- package/dist/MobileUnsupportedFeedItemError-BsZvW8i2.d.ts.map +1 -0
- package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.cts +15 -0
- package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.cts.map +1 -0
- package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.ts +15 -0
- package/dist/MobileUnsupportedNotificationRouteError-DpiNBvvY.d.ts.map +1 -0
- package/dist/{buildSignedMobileRequest-Cb1T74xV.d.ts → buildSignedMobileRequest-BR-KJhIF.d.ts} +2 -2
- package/dist/{buildSignedMobileRequest-Cb1T74xV.d.ts.map → buildSignedMobileRequest-BR-KJhIF.d.ts.map} +1 -1
- package/dist/{buildSignedMobileRequest-NHbMAPzd.d.cts → buildSignedMobileRequest-DyKCK34Y.d.cts} +2 -2
- package/dist/{buildSignedMobileRequest-NHbMAPzd.d.cts.map → buildSignedMobileRequest-DyKCK34Y.d.cts.map} +1 -1
- package/dist/{canonicalize-BBYGh17w.d.ts → canonicalize-Bv6UIAbR.d.ts} +2 -2
- package/dist/canonicalize-Bv6UIAbR.d.ts.map +1 -0
- package/dist/{canonicalize-BF_SiNvO.d.cts → canonicalize-CWh3XZzj.d.cts} +2 -2
- package/dist/canonicalize-CWh3XZzj.d.cts.map +1 -0
- package/dist/clientTypes-BUn5_OzK.d.ts +1665 -0
- package/dist/clientTypes-BUn5_OzK.d.ts.map +1 -0
- package/dist/clientTypes-DOpUcu80.d.cts +1665 -0
- package/dist/clientTypes-DOpUcu80.d.cts.map +1 -0
- package/dist/dataMappers.cjs +691 -14
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.d.cts +254 -8
- package/dist/dataMappers.d.cts.map +1 -1
- package/dist/dataMappers.d.ts +254 -8
- package/dist/dataMappers.d.ts.map +1 -1
- package/dist/dataMappers.js +651 -15
- package/dist/dataMappers.js.map +1 -1
- package/dist/{eip712MethodByType-BSx11xG-.d.cts → eip712MethodByType-CJ6BoayT.d.cts} +2 -2
- package/dist/eip712MethodByType-CJ6BoayT.d.cts.map +1 -0
- package/dist/{eip712MethodByType-DkiAjCLs.d.ts → eip712MethodByType-Dx4mvgni.d.ts} +2 -2
- package/dist/eip712MethodByType-Dx4mvgni.d.ts.map +1 -0
- package/dist/{feed-DTJlsg8W.d.ts → feed-DErOLaoY.d.cts} +4 -2
- package/dist/feed-DErOLaoY.d.cts.map +1 -0
- package/dist/{feed-DTJlsg8W.d.cts → feed-DErOLaoY.d.ts} +4 -2
- package/dist/feed-DErOLaoY.d.ts.map +1 -0
- package/dist/index.cjs +9 -2
- package/dist/index.d.cts +15 -16
- package/dist/index.d.ts +15 -16
- package/dist/index.js +5 -3
- package/dist/{mobileErrorCodes-3LtreeZM.d.ts → mobileErrorCodes-vD6rbFuF.d.cts} +25 -6
- package/dist/mobileErrorCodes-vD6rbFuF.d.cts.map +1 -0
- package/dist/{mobileErrorCodes-3LtreeZM.d.cts → mobileErrorCodes-vD6rbFuF.d.ts} +25 -6
- package/dist/mobileErrorCodes-vD6rbFuF.d.ts.map +1 -0
- package/dist/{payloadHash-BOWGjqdb.d.cts → payloadHash-CdkF2Ocr.d.cts} +2 -2
- package/dist/payloadHash-CdkF2Ocr.d.cts.map +1 -0
- package/dist/{payloadHash-Bzf4CtjV.d.ts → payloadHash-HD29K77M.d.ts} +2 -2
- package/dist/payloadHash-HD29K77M.d.ts.map +1 -0
- package/dist/serverExecuteTypes-5JyyIXRK.d.ts +178 -0
- package/dist/serverExecuteTypes-5JyyIXRK.d.ts.map +1 -0
- package/dist/serverExecuteTypes-CHrQ9Rtq.d.cts +178 -0
- package/dist/serverExecuteTypes-CHrQ9Rtq.d.cts.map +1 -0
- package/dist/serverModelTypes-CGUZCi0y.d.cts +938 -0
- package/dist/serverModelTypes-CGUZCi0y.d.cts.map +1 -0
- package/dist/serverModelTypes-CGUZCi0y.d.ts +938 -0
- package/dist/serverModelTypes-CGUZCi0y.d.ts.map +1 -0
- package/dist/{serverResponseGuards-BU1Xv_tG.d.ts → serverResponseGuards-Bvw8ltYJ.d.ts} +2 -2
- package/dist/{serverResponseGuards-BU1Xv_tG.d.ts.map → serverResponseGuards-Bvw8ltYJ.d.ts.map} +1 -1
- package/dist/{serverResponseGuards-Dkdok0Sm.d.cts → serverResponseGuards-i1njcYKN.d.cts} +2 -2
- package/dist/{serverResponseGuards-Dkdok0Sm.d.cts.map → serverResponseGuards-i1njcYKN.d.cts.map} +1 -1
- package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
- package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
- package/dist/signing/canonicalize.cjs +86 -0
- package/dist/signing/canonicalize.cjs.map +1 -1
- package/dist/signing/canonicalize.d.cts +1 -1
- package/dist/signing/canonicalize.d.ts +1 -1
- package/dist/signing/canonicalize.js +86 -0
- package/dist/signing/canonicalize.js.map +1 -1
- package/dist/signing/eip712MethodByType.cjs +12 -0
- package/dist/signing/eip712MethodByType.cjs.map +1 -1
- package/dist/signing/eip712MethodByType.d.cts +1 -1
- package/dist/signing/eip712MethodByType.d.ts +1 -1
- package/dist/signing/eip712MethodByType.js +12 -0
- package/dist/signing/eip712MethodByType.js.map +1 -1
- package/dist/signing/index.d.cts +5 -5
- package/dist/signing/index.d.ts +5 -5
- package/dist/signing/payloadHash.cjs +1 -1
- package/dist/signing/payloadHash.d.cts +1 -1
- package/dist/signing/payloadHash.d.ts +1 -1
- package/dist/signing/payloadHash.js +1 -1
- package/dist/signing/types.d.cts +1 -1
- package/dist/signing/types.d.ts +1 -1
- package/dist/types/MobileServerFailureError.d.cts +1 -1
- package/dist/types/MobileServerFailureError.d.ts +1 -1
- package/dist/types/MobileUnsupportedFeedItemError.cjs +19 -0
- package/dist/types/MobileUnsupportedFeedItemError.cjs.map +1 -0
- package/dist/types/MobileUnsupportedFeedItemError.d.cts +2 -0
- package/dist/types/MobileUnsupportedFeedItemError.d.ts +2 -0
- package/dist/types/MobileUnsupportedFeedItemError.js +18 -0
- package/dist/types/MobileUnsupportedFeedItemError.js.map +1 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.cjs +19 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.cjs.map +1 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.d.cts +2 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.d.ts +2 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.js +18 -0
- package/dist/types/MobileUnsupportedNotificationRouteError.js.map +1 -0
- package/dist/types/clientTypes.d.cts +2 -2
- package/dist/types/clientTypes.d.ts +2 -2
- package/dist/types/index.cjs +6 -0
- package/dist/types/index.d.cts +9 -9
- package/dist/types/index.d.ts +9 -9
- package/dist/types/index.js +4 -2
- package/dist/types/mobileErrorCodes.cjs +39 -1
- package/dist/types/mobileErrorCodes.cjs.map +1 -1
- package/dist/types/mobileErrorCodes.d.cts +1 -1
- package/dist/types/mobileErrorCodes.d.ts +1 -1
- package/dist/types/mobileErrorCodes.js +39 -1
- package/dist/types/mobileErrorCodes.js.map +1 -1
- package/dist/types/serverBaseTypes.d.cts +1 -1
- package/dist/types/serverBaseTypes.d.ts +1 -1
- package/dist/types/serverExecuteTypes.d.cts +2 -2
- package/dist/types/serverExecuteTypes.d.ts +2 -2
- package/dist/types/serverModelTypes.cjs +15 -0
- package/dist/types/serverModelTypes.cjs.map +1 -1
- package/dist/types/serverModelTypes.d.cts +2 -2
- package/dist/types/serverModelTypes.d.ts +2 -2
- package/dist/types/serverModelTypes.js +14 -1
- package/dist/types/serverModelTypes.js.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +2 -2
- package/dist/types/serverQueryTypes.d.ts +2 -2
- package/dist/types/serverRequestTypes.d.cts +2 -2
- package/dist/types/serverRequestTypes.d.ts +2 -2
- package/dist/types-C9YE4EIt.d.cts +794 -0
- package/dist/types-C9YE4EIt.d.cts.map +1 -0
- package/dist/types-Cwy1y_9x.d.ts +794 -0
- package/dist/types-Cwy1y_9x.d.ts.map +1 -0
- package/dist/utils/buildMobileFeedImageMultipart.cjs +31 -0
- package/dist/utils/buildMobileFeedImageMultipart.cjs.map +1 -0
- package/dist/utils/buildMobileFeedImageMultipart.d.cts +15 -0
- package/dist/utils/buildMobileFeedImageMultipart.d.cts.map +1 -0
- package/dist/utils/buildMobileFeedImageMultipart.d.ts +15 -0
- package/dist/utils/buildMobileFeedImageMultipart.d.ts.map +1 -0
- package/dist/utils/buildMobileFeedImageMultipart.js +30 -0
- package/dist/utils/buildMobileFeedImageMultipart.js.map +1 -0
- package/dist/utils/feed.cjs +3 -0
- package/dist/utils/feed.cjs.map +1 -1
- package/dist/utils/feed.d.cts +2 -2
- package/dist/utils/feed.d.ts +2 -2
- package/dist/utils/feed.js +3 -1
- package/dist/utils/feed.js.map +1 -1
- package/dist/utils/index.cjs +2 -1
- package/dist/utils/index.d.cts +3 -3
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +2 -2
- package/dist/utils/serverResponseGuards.d.cts +1 -1
- package/dist/utils/serverResponseGuards.d.ts +1 -1
- package/package.json +3 -3
- package/src/MobileClient.ts +789 -7
- package/src/dataMappers.test.ts +848 -0
- package/src/dataMappers.ts +924 -17
- package/src/feedImages.test.ts +309 -0
- package/src/notifications.test.ts +950 -0
- package/src/signing/canonicalize.ts +119 -0
- package/src/signing/eip712MethodByType.ts +15 -0
- package/src/signing/signing.test.ts +362 -0
- package/src/signing/types.ts +108 -13
- package/src/socialFeed.test.ts +38 -2
- package/src/types/MobileUnsupportedFeedItemError.ts +18 -0
- package/src/types/MobileUnsupportedNotificationRouteError.ts +16 -0
- package/src/types/clientTypes.ts +1012 -34
- package/src/types/index.ts +2 -0
- package/src/types/mobileErrorCodes.ts +38 -0
- package/src/types/serverExecuteTypes.ts +112 -3
- package/src/types/serverModelTypes.ts +581 -28
- package/src/types/serverQueryTypes.ts +212 -5
- package/src/types/serverRequestTypes.ts +213 -13
- package/src/utils/buildMobileFeedImageMultipart.test.ts +45 -0
- package/src/utils/buildMobileFeedImageMultipart.ts +36 -0
- package/src/utils/feed.ts +3 -0
- package/dist/MobileClient-aDxiM_Kf.cjs +0 -562
- package/dist/MobileClient-aDxiM_Kf.cjs.map +0 -1
- package/dist/MobileServerFailureError-Bpa_WA9f.d.cts.map +0 -1
- package/dist/MobileServerFailureError-Dd3c6P_Z.d.ts.map +0 -1
- package/dist/canonicalize-BBYGh17w.d.ts.map +0 -1
- package/dist/canonicalize-BF_SiNvO.d.cts.map +0 -1
- package/dist/clientTypes-BWFKo9oE.d.cts +0 -844
- package/dist/clientTypes-BWFKo9oE.d.cts.map +0 -1
- package/dist/clientTypes-DCTiUV0H.d.ts +0 -844
- package/dist/clientTypes-DCTiUV0H.d.ts.map +0 -1
- package/dist/eip712MethodByType-BSx11xG-.d.cts.map +0 -1
- package/dist/eip712MethodByType-DkiAjCLs.d.ts.map +0 -1
- package/dist/feed-DTJlsg8W.d.cts.map +0 -1
- package/dist/feed-DTJlsg8W.d.ts.map +0 -1
- package/dist/mobileErrorCodes-3LtreeZM.d.cts.map +0 -1
- package/dist/mobileErrorCodes-3LtreeZM.d.ts.map +0 -1
- package/dist/payloadHash-BOWGjqdb.d.cts.map +0 -1
- package/dist/payloadHash-Bzf4CtjV.d.ts.map +0 -1
- package/dist/serverBaseTypes-DWf3iGWy.d.ts +0 -25
- package/dist/serverBaseTypes-DWf3iGWy.d.ts.map +0 -1
- package/dist/serverBaseTypes-KREDe2M9.d.cts +0 -25
- package/dist/serverBaseTypes-KREDe2M9.d.cts.map +0 -1
- package/dist/serverExecuteTypes-DVRa6ifu.d.cts +0 -89
- package/dist/serverExecuteTypes-DVRa6ifu.d.cts.map +0 -1
- package/dist/serverExecuteTypes-DlYZCp1f.d.ts +0 -89
- package/dist/serverExecuteTypes-DlYZCp1f.d.ts.map +0 -1
- package/dist/serverModelTypes-DAqEyYtB.d.cts +0 -508
- package/dist/serverModelTypes-DAqEyYtB.d.cts.map +0 -1
- package/dist/serverModelTypes-DAqEyYtB.d.ts +0 -508
- package/dist/serverModelTypes-DAqEyYtB.d.ts.map +0 -1
- package/dist/serverQueryTypes-BFdwq0Z2.d.ts +0 -171
- package/dist/serverQueryTypes-BFdwq0Z2.d.ts.map +0 -1
- package/dist/serverQueryTypes-DNdMpmDr.d.cts +0 -171
- package/dist/serverQueryTypes-DNdMpmDr.d.cts.map +0 -1
- package/dist/serverRequestTypes-BNA7FCY6.d.ts +0 -200
- package/dist/serverRequestTypes-BNA7FCY6.d.ts.map +0 -1
- package/dist/serverRequestTypes-CxDRFKfv.d.cts +0 -200
- package/dist/serverRequestTypes-CxDRFKfv.d.cts.map +0 -1
- package/dist/types-BCr2G5gS.d.cts +0 -84
- package/dist/types-BCr2G5gS.d.cts.map +0 -1
- package/dist/types-C18k-9Vy.d.ts +0 -84
- package/dist/types-C18k-9Vy.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -48,7 +48,13 @@ await mobile.setUsername({
|
|
|
48
48
|
|
|
49
49
|
`getAvatarPresets`, `getUsernameAvailability`, `getProfiles`, `searchProfiles`, `getFollowers`, `getFollowing`, `getFeed`,
|
|
50
50
|
`getNotificationPreferences`, `getRegisteredWallet`, `getForYouFeed`, `getTopTradersFeed`,
|
|
51
|
-
`getFriendsFeed`, `getProfileFeed`, `getMarketFeed`, `getPositionFeed`, `getFeedItem`, `getFeedUpdates
|
|
51
|
+
`getFriendsFeed`, `getProfileFeed`, `getMarketFeed`, `getPositionFeed`, `getFeedItem`, `getFeedUpdates`,
|
|
52
|
+
`getSelfFeedPositions`, `resolveFeedPosition`, `resolveFeedAction`, `getFeedChartDrawing`, `getFeedComments`,
|
|
53
|
+
`getPositionHistory`, `getPositionChart`, `getPositionWatchers`.
|
|
54
|
+
|
|
55
|
+
`getNotificationRegistrationV2` and `getNotificationSettingsV2` use an active Expo token as their credential,
|
|
56
|
+
not a wallet signature. Before displaying wallet settings, compare the wallet returned by `getRegisteredWallet`
|
|
57
|
+
with the connected wallet (case-insensitively).
|
|
52
58
|
|
|
53
59
|
`getProfiles` is the only profile route: it batches up to 25 subaccounts, returns them in the requested order,
|
|
54
60
|
and carries follower totals (`include.followCounts`) and a follow summary (`include.followSummary.viewAs`) as
|
|
@@ -68,19 +74,130 @@ page is ordered by the listed relationship alone and `isFollowing` is absent rat
|
|
|
68
74
|
|
|
69
75
|
`getFeed` returns the global trade feed. Session-based feeds include `getForYouFeed`, `getTopTradersFeed`,
|
|
70
76
|
and `getFriendsFeed` (requires `viewAs`), plus `getProfileFeed`, `getMarketFeed`, and `getPositionFeed`.
|
|
71
|
-
`getFeedItem` reads one item; `
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
`getFeedItem` reads one item; pass `viewEventId` when the user navigates into the detail so a later
|
|
78
|
+
`recordFeedViews` can count that visit, and omit it for prefetch. `getFeedUpdates` polls session patches
|
|
79
|
+
using the returned `viewerToken`. All are unsigned. Profile, position, and item reads include the `viewAs`
|
|
80
|
+
account's own hidden content under `account_view`; the viewing account is not proof of wallet ownership.
|
|
81
|
+
Prices are decimal `BigNumber` values; quantities, notionals, and PnL retain x18 units. See method and
|
|
82
|
+
parameter JSDoc for session and polling rules.
|
|
83
|
+
|
|
84
|
+
`getSelfFeedPositions`, `resolveFeedPosition`, and `resolveFeedAction` require `viewAs` and return eligibility
|
|
85
|
+
hints for that account, not authenticated permissions. `getFeedComments` supports anchored, bidirectional
|
|
86
|
+
thread pagination. Lists, details, and history return parsed drawings and readable comment previews;
|
|
87
|
+
`getFeedChartDrawing` refreshes a drawing independently when needed.
|
|
88
|
+
|
|
89
|
+
`getPositionHistory` returns the full action/take timeline, distinct from published-only `getPositionFeed`,
|
|
90
|
+
and a position-mode session for navigation and updates. `getPositionChart` returns candles and action markers,
|
|
91
|
+
keeping execution and liquidation Oracle prices separate. `getPositionWatchers` reads visitor counts without
|
|
92
|
+
registering presence. Watching account previews are self-reported, not proof of account ownership.
|
|
75
93
|
|
|
76
94
|
### Public Executes
|
|
77
95
|
|
|
78
|
-
`unregisterExpoToken`, `updateNotificationPreferences`. These are authenticated by possession of an active Expo
|
|
96
|
+
`unregisterExpoToken`, `updateNotificationPreferences`, `updateNotificationSettingsV2`. These are authenticated by possession of an active Expo
|
|
79
97
|
push token rather than a wallet signature, so they still work at logout when a signature may be unobtainable.
|
|
80
98
|
|
|
99
|
+
`recordFeedViews` and `setPositionPresence` use reading-session credentials rather than wallet signatures.
|
|
100
|
+
Exposure follows `readSession.viewTracking.mode === 'detail_visit'`: after the primary detail target is shown
|
|
101
|
+
in the foreground, call `recordFeedViews` with the same `viewEventId` previously sent to `getFeedItem`, plus
|
|
102
|
+
that response's `sessionId` / `viewerToken` and exactly one detail-target `itemId`. Reuse the event on retries
|
|
103
|
+
for the same visit; generate a new UUID only after leaving and re-entering. Fetch image bytes with
|
|
104
|
+
`getFeedImageBytes` using the same session credentials and paths from `images` / `thumbnail.url`. Legitimate
|
|
105
|
+
session reads renew the idle expiration; use the latest `expiresAtMs` rather than treating the first value as
|
|
106
|
+
fixed.
|
|
107
|
+
|
|
108
|
+
For React Native `Image` or expo-image, use `getFeedImageRequest` to pass the authenticated
|
|
109
|
+
URL and headers directly without converting bytes to base64:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
const { url, headers } = mobile.getFeedImageRequest({
|
|
113
|
+
path: image.url,
|
|
114
|
+
sessionId: readSession.sessionId,
|
|
115
|
+
viewerToken: readSession.viewerToken,
|
|
116
|
+
});
|
|
117
|
+
const source = { uri: url, headers };
|
|
118
|
+
```
|
|
119
|
+
|
|
81
120
|
### Signed Executes
|
|
82
121
|
|
|
83
|
-
`setUsername`, `setBio`, `createAvatarUpload`, `setAvatar`, `setPrivateMode`, `registerExpoToken`, `setFollow
|
|
122
|
+
`setUsername`, `setBio`, `createAvatarUpload`, `setAvatar`, `setPrivateMode`, `registerExpoToken`, `setFollow`,
|
|
123
|
+
`createFeedPost`, `createFeedComment`, `createFeedPostImageUpload`, `createFeedCommentImageUpload`,
|
|
124
|
+
`createFeedChartDrawing`, `updateFeedChartDrawing`, `setFeedLike`, `registerExpoTokenV2`,
|
|
125
|
+
`updateNotificationSubscriptions`, `recordProductEvents`.
|
|
126
|
+
|
|
127
|
+
Upload images one at a time with the multipart helpers (≤ 2 MiB whole request), then pass ordered ready
|
|
128
|
+
`imageIds` to `createFeedPost` / `createFeedComment`. The SDK throws `RangeError` before requesting a signature or sending a request
|
|
129
|
+
that exceeds `MOBILE_FEED_IMAGE_MAX_REQUEST_BYTES`, including the signed payload and multipart framing.
|
|
130
|
+
Unconfigured image storage returns `SOCIAL_FEED_DATA_UNAVAILABLE` (6320, HTTP 503).
|
|
131
|
+
Posts still require nonblank text or a drawing; comments
|
|
132
|
+
still require nonblank text. See method and parameter JSDoc for publication, retries, mention offsets, drawing
|
|
133
|
+
data, and mutation ordering.
|
|
134
|
+
|
|
135
|
+
### Signed Queries
|
|
136
|
+
|
|
137
|
+
`getNotificationSubscriptions` and `getNotificationInboxV2` use wallet authentication on `/query`.
|
|
138
|
+
They do not require an Expo token or system push permission. The configured linked signer is supported.
|
|
139
|
+
|
|
140
|
+
### Notifications V2
|
|
141
|
+
|
|
142
|
+
The notification v2 operations are available on `MobileClient`, including `client.context.mobileClient` from
|
|
143
|
+
`@nadohq/client`. Settings, capabilities, subscriptions, inbox data, and product events use camelCase SDK models.
|
|
144
|
+
The SDK maps requests to snake_case wire fields and removes the success envelope from read results.
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
const auth = {
|
|
148
|
+
subaccountOwner: walletClient.account.address,
|
|
149
|
+
subaccountName: 'default',
|
|
150
|
+
chainId: ink.id,
|
|
151
|
+
verifyingAddr: '0x...' as const,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
await mobile.registerExpoTokenV2({
|
|
155
|
+
...auth,
|
|
156
|
+
expoToken,
|
|
157
|
+
platform: 'ios',
|
|
158
|
+
capabilities: {
|
|
159
|
+
payloadVersions: [2],
|
|
160
|
+
typeIds: ['order_fill', 'new_follower'],
|
|
161
|
+
routes: ['portfolio', 'profile'],
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
const registration = await mobile.getNotificationRegistrationV2({ expoToken });
|
|
165
|
+
const current = await mobile.getNotificationSettingsV2({ expoToken });
|
|
166
|
+
const saved = await mobile.updateNotificationSettingsV2({
|
|
167
|
+
expoToken,
|
|
168
|
+
expectedRevision: current.revision,
|
|
169
|
+
settings: { ...current.settings, positionThresholds: [25] },
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const subscriptions = await mobile.getNotificationSubscriptions(auth);
|
|
173
|
+
await mobile.updateNotificationSubscriptions({
|
|
174
|
+
...auth,
|
|
175
|
+
update: {
|
|
176
|
+
expectedRevision: subscriptions.revision,
|
|
177
|
+
market: { productId: 2, subscribed: true },
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
const updatedSubscriptions = await mobile.getNotificationSubscriptions(auth);
|
|
181
|
+
const inbox = await mobile.getNotificationInboxV2({ ...auth, limit: 20 });
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- Declare only types/routes the application handles. Re-registration advances the generation and cancels
|
|
185
|
+
old pending deliveries; calling legacy `registerExpoToken` resets capabilities to v1.
|
|
186
|
+
- Settings replacement requires every field. Settings and subscription revisions are independent.
|
|
187
|
+
On `MOBILE_ERROR_CODES.NOTIFICATION_REVISION_CONFLICT` (6203), re-read and merge only the current user change.
|
|
188
|
+
- A subscription update selects exactly one operation; omit the other operations and the SDK sends them as `null`. Successful subscription
|
|
189
|
+
updates return only status, so re-query even after repeated ON/OFF. Favorites import merges once, never replaces.
|
|
190
|
+
- Enabling a bell requires following the target. Unfollowing clears its bell without advancing the subscription
|
|
191
|
+
revision; refresh subscriptions after follow mutations. Bells are Identity-scoped; markets are wallet-scoped.
|
|
192
|
+
Pass `traderBell.subaccount` as a `Subaccount` (`subaccountOwner` and `subaccountName`); the SDK encodes it for signing.
|
|
193
|
+
- Inbox pages are accepted intents, not delivery/read receipts. There is no title/body, unread count, mark-read,
|
|
194
|
+
or delete operation. Do not use the unimplemented legacy `notification_history` route.
|
|
195
|
+
An unknown destination rejects the page with `MobileUnsupportedNotificationRouteError`.
|
|
196
|
+
- `recordProductEvents({ ...auth, events })` accepts 1-50 events atomically. Provide the fields required by `eventName`,
|
|
197
|
+
actual millisecond timestamps, and stable `clientEventId` UUIDs across retries. The SDK fills unused wire fields with `null`. Supported
|
|
198
|
+
names are `notif_opened`, `market_viewed`, `chart_opened`, and `search`; obtain analytics consent first.
|
|
199
|
+
- Legacy preferences remain supported and synchronize overlapping v2 fields. Keep legacy push parsing because
|
|
200
|
+
order notifications may use a v1 fallback even for v2 registrations.
|
|
84
201
|
|
|
85
202
|
### Linked Signers
|
|
86
203
|
|