@nadohq/mobile-client 0.37.0 → 0.41.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 +10 -10
- package/dist/{MobileClient-C9S_o_eC.cjs → MobileClient-Duy7MvxN.cjs} +39 -46
- package/dist/MobileClient-Duy7MvxN.cjs.map +1 -0
- package/dist/MobileClient.cjs +1 -1
- package/dist/MobileClient.d.cts +29 -31
- package/dist/MobileClient.d.cts.map +1 -1
- package/dist/MobileClient.d.ts +29 -31
- package/dist/MobileClient.d.ts.map +1 -1
- package/dist/MobileClient.js +39 -46
- package/dist/MobileClient.js.map +1 -1
- package/dist/{MobileServerFailureError-CVK3aLOi.d.cts → MobileServerFailureError-BvQYrxjx.d.cts} +3 -3
- package/dist/{MobileServerFailureError-CVK3aLOi.d.cts.map → MobileServerFailureError-BvQYrxjx.d.cts.map} +1 -1
- package/dist/{MobileServerFailureError-D-76n3pS.d.ts → MobileServerFailureError-CrNpL_L4.d.ts} +3 -3
- package/dist/{MobileServerFailureError-D-76n3pS.d.ts.map → MobileServerFailureError-CrNpL_L4.d.ts.map} +1 -1
- package/dist/{buildSignedMobileRequest-42meR4yV.d.ts → buildSignedMobileRequest-BqLRFLKV.d.ts} +2 -2
- package/dist/{buildSignedMobileRequest-42meR4yV.d.ts.map → buildSignedMobileRequest-BqLRFLKV.d.ts.map} +1 -1
- package/dist/{buildSignedMobileRequest-BDxji7Vy.d.cts → buildSignedMobileRequest-DkkwEqIu.d.cts} +2 -2
- package/dist/{buildSignedMobileRequest-BDxji7Vy.d.cts.map → buildSignedMobileRequest-DkkwEqIu.d.cts.map} +1 -1
- package/dist/{canonicalize-BebHhHcF.d.ts → canonicalize-BRhCpYm1.d.ts} +2 -2
- package/dist/canonicalize-BRhCpYm1.d.ts.map +1 -0
- package/dist/{canonicalize-CIDJLLgg.d.cts → canonicalize-DtpaaA2B.d.cts} +2 -2
- package/dist/canonicalize-DtpaaA2B.d.cts.map +1 -0
- package/dist/{clientTypes-2I3x4TTt.d.ts → clientTypes-CB_itU4Z.d.ts} +26 -21
- package/dist/clientTypes-CB_itU4Z.d.ts.map +1 -0
- package/dist/{clientTypes-tLld8E6J.d.cts → clientTypes-CceWsQzi.d.cts} +26 -21
- package/dist/clientTypes-CceWsQzi.d.cts.map +1 -0
- package/dist/dataMappers.cjs +16 -2
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.d.cts +13 -7
- package/dist/dataMappers.d.cts.map +1 -1
- package/dist/dataMappers.d.ts +13 -7
- package/dist/dataMappers.d.ts.map +1 -1
- package/dist/dataMappers.js +15 -2
- package/dist/dataMappers.js.map +1 -1
- package/dist/{eip712MethodByType-2-vyN5SU.d.cts → eip712MethodByType-1xUkvTIp.d.cts} +2 -2
- package/dist/eip712MethodByType-1xUkvTIp.d.cts.map +1 -0
- package/dist/{eip712MethodByType-CAVpvZoS.d.ts → eip712MethodByType-CrqBJIrp.d.ts} +2 -2
- package/dist/eip712MethodByType-CrqBJIrp.d.ts.map +1 -0
- package/dist/endpoints.cjs +3 -3
- package/dist/endpoints.cjs.map +1 -1
- package/dist/endpoints.js +3 -3
- package/dist/endpoints.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/{payloadHash-BVPYKdk4.d.cts → payloadHash-CIo8Hkh6.d.cts} +2 -2
- package/dist/payloadHash-CIo8Hkh6.d.cts.map +1 -0
- package/dist/{payloadHash-DMqE5aMo.d.ts → payloadHash-Cv4WwZCZ.d.ts} +2 -2
- package/dist/payloadHash-Cv4WwZCZ.d.ts.map +1 -0
- package/dist/{serverBaseTypes-DPB1vEvv.d.ts → serverBaseTypes-C2JGib--.d.ts} +2 -2
- package/dist/{serverBaseTypes-DPB1vEvv.d.ts.map → serverBaseTypes-C2JGib--.d.ts.map} +1 -1
- package/dist/{serverBaseTypes-BybrVE6L.d.cts → serverBaseTypes-YkCmgmt1.d.cts} +2 -2
- package/dist/{serverBaseTypes-BybrVE6L.d.cts.map → serverBaseTypes-YkCmgmt1.d.cts.map} +1 -1
- package/dist/{serverExecuteTypes-ih4Xbr3J.d.ts → serverExecuteTypes-C2NoNEwu.d.ts} +3 -3
- package/dist/{serverExecuteTypes-ih4Xbr3J.d.ts.map → serverExecuteTypes-C2NoNEwu.d.ts.map} +1 -1
- package/dist/{serverExecuteTypes-DoR0InCd.d.cts → serverExecuteTypes-DPZbs9ym.d.cts} +3 -3
- package/dist/{serverExecuteTypes-DoR0InCd.d.cts.map → serverExecuteTypes-DPZbs9ym.d.cts.map} +1 -1
- package/dist/{serverModelTypes-KSm0CAcF.d.cts → serverModelTypes-CDcRlRtw.d.ts} +8 -5
- package/dist/serverModelTypes-CDcRlRtw.d.ts.map +1 -0
- package/dist/{serverModelTypes-DV-eARP8.d.ts → serverModelTypes-CUzqFA6x.d.cts} +8 -5
- package/dist/serverModelTypes-CUzqFA6x.d.cts.map +1 -0
- package/dist/{serverQueryTypes-LygPrZn7.d.ts → serverQueryTypes-B0xI1G39.d.ts} +16 -27
- package/dist/serverQueryTypes-B0xI1G39.d.ts.map +1 -0
- package/dist/{serverQueryTypes-B9OOpiJB.d.cts → serverQueryTypes-RdcIqRnM.d.cts} +16 -27
- package/dist/serverQueryTypes-RdcIqRnM.d.cts.map +1 -0
- package/dist/{serverRequestTypes-q4xTJHk0.d.cts → serverRequestTypes-Ddws3yXc.d.cts} +35 -20
- package/dist/serverRequestTypes-Ddws3yXc.d.cts.map +1 -0
- package/dist/{serverRequestTypes-BDXIPjtw.d.ts → serverRequestTypes-Dv9NR-hQ.d.ts} +35 -20
- package/dist/serverRequestTypes-Dv9NR-hQ.d.ts.map +1 -0
- package/dist/{serverResponseGuards-BcdkKV30.d.ts → serverResponseGuards-BjIzucYt.d.ts} +2 -2
- package/dist/{serverResponseGuards-BcdkKV30.d.ts.map → serverResponseGuards-BjIzucYt.d.ts.map} +1 -1
- package/dist/{serverResponseGuards-k6xK1bZ1.d.cts → serverResponseGuards-Dg9WbqBA.d.cts} +2 -2
- package/dist/{serverResponseGuards-k6xK1bZ1.d.cts.map → serverResponseGuards-Dg9WbqBA.d.cts.map} +1 -1
- package/dist/signing/buildSignedMobileRequest.cjs +1 -1
- package/dist/signing/buildSignedMobileRequest.d.cts +1 -1
- package/dist/signing/buildSignedMobileRequest.d.ts +1 -1
- package/dist/signing/canonicalize.cjs +0 -12
- 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 +0 -12
- package/dist/signing/canonicalize.js.map +1 -1
- package/dist/signing/eip712MethodByType.cjs +1 -3
- 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 +1 -3
- 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/types.d.cts +1 -1
- package/dist/signing/types.d.ts +1 -1
- package/dist/types/MobileServerFailureError.cjs +1 -1
- package/dist/types/MobileServerFailureError.d.cts +1 -1
- package/dist/types/MobileServerFailureError.d.ts +1 -1
- package/dist/types/clientTypes.d.cts +2 -2
- package/dist/types/clientTypes.d.ts +2 -2
- package/dist/types/index.d.cts +8 -8
- package/dist/types/index.d.ts +8 -8
- package/dist/types/mobileErrorCodes.cjs +1 -1
- package/dist/types/serverBaseTypes.d.cts +1 -1
- package/dist/types/serverBaseTypes.d.ts +1 -1
- package/dist/types/serverExecuteTypes.d.cts +1 -1
- package/dist/types/serverExecuteTypes.d.ts +1 -1
- package/dist/types/serverModelTypes.cjs.map +1 -1
- package/dist/types/serverModelTypes.d.cts +1 -1
- package/dist/types/serverModelTypes.d.ts +1 -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-B8lDIhBP.d.ts → types-BIIvIzG2.d.ts} +3 -13
- package/dist/types-BIIvIzG2.d.ts.map +1 -0
- package/dist/{types-CClB00EN.d.cts → types-UmYaeq1C.d.cts} +3 -13
- package/dist/types-UmYaeq1C.d.cts.map +1 -0
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/serverResponseGuards.d.cts +1 -1
- package/dist/utils/serverResponseGuards.d.ts +1 -1
- package/package.json +3 -3
- package/src/MobileClient.ts +49 -70
- package/src/dataMappers.ts +22 -2
- package/src/endpoints.ts +3 -3
- package/src/signing/canonicalize.ts +0 -14
- package/src/signing/eip712MethodByType.ts +0 -2
- package/src/signing/signing.test.ts +0 -26
- package/src/signing/types.ts +0 -16
- package/src/types/clientTypes.ts +23 -19
- package/src/types/serverModelTypes.ts +7 -4
- package/src/types/serverQueryTypes.ts +12 -29
- package/src/types/serverRequestTypes.ts +32 -21
- package/dist/MobileClient-C9S_o_eC.cjs.map +0 -1
- package/dist/canonicalize-BebHhHcF.d.ts.map +0 -1
- package/dist/canonicalize-CIDJLLgg.d.cts.map +0 -1
- package/dist/clientTypes-2I3x4TTt.d.ts.map +0 -1
- package/dist/clientTypes-tLld8E6J.d.cts.map +0 -1
- package/dist/eip712MethodByType-2-vyN5SU.d.cts.map +0 -1
- package/dist/eip712MethodByType-CAVpvZoS.d.ts.map +0 -1
- package/dist/payloadHash-BVPYKdk4.d.cts.map +0 -1
- package/dist/payloadHash-DMqE5aMo.d.ts.map +0 -1
- package/dist/serverModelTypes-DV-eARP8.d.ts.map +0 -1
- package/dist/serverModelTypes-KSm0CAcF.d.cts.map +0 -1
- package/dist/serverQueryTypes-B9OOpiJB.d.cts.map +0 -1
- package/dist/serverQueryTypes-LygPrZn7.d.ts.map +0 -1
- package/dist/serverRequestTypes-BDXIPjtw.d.ts.map +0 -1
- package/dist/serverRequestTypes-q4xTJHk0.d.cts.map +0 -1
- package/dist/types-B8lDIhBP.d.ts.map +0 -1
- package/dist/types-CClB00EN.d.cts.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as MobileServerNotificationPreferences, a as MobileFeedTradePosition, c as MobileNotificationCategory, d as MobileServerFeedTrade, f as MobileServerFollowListAccount, g as MobileServerNotificationPreferenceScope, h as MobileServerNotificationCategoryPreference, i as MobileFeedMarginMode, l as MobileNotificationPlatform, m as MobileServerIdentitySummary, n as MOBILE_FEED_TRADE_POSITION_DIRECTIONS, o as MobileFeedTradePositionDirection, p as MobileServerFollowSummary, r as MOBILE_FEED_TRADE_POSITION_EFFECTS, s as MobileFeedTradePositionEffect, t as MOBILE_FEED_MARGIN_MODES, u as MobileServerFeedMargin, v as MobileServerProfile } from "../serverModelTypes-
|
|
2
|
-
import { A as
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-
|
|
5
|
-
import { a as MobileServerFollowMutationResponse, i as MobileServerExecuteSuccessResponse, n as MobileServerExecuteResponseByType, o as MobileServerPublicExecuteRequest, r as MobileServerExecuteResult, t as MobileServerEmptyExecuteResponse } from "../serverExecuteTypes-
|
|
6
|
-
import { a as MobileServerPublicQueryRequest, c as MobileServerRegisteredWalletResponse,
|
|
1
|
+
import { _ as MobileServerNotificationPreferences, a as MobileFeedTradePosition, c as MobileNotificationCategory, d as MobileServerFeedTrade, f as MobileServerFollowListAccount, g as MobileServerNotificationPreferenceScope, h as MobileServerNotificationCategoryPreference, i as MobileFeedMarginMode, l as MobileNotificationPlatform, m as MobileServerIdentitySummary, n as MOBILE_FEED_TRADE_POSITION_DIRECTIONS, o as MobileFeedTradePositionDirection, p as MobileServerFollowSummary, r as MOBILE_FEED_TRADE_POSITION_EFFECTS, s as MobileFeedTradePositionEffect, t as MOBILE_FEED_MARGIN_MODES, u as MobileServerFeedMargin, v as MobileServerProfile } from "../serverModelTypes-CDcRlRtw.js";
|
|
2
|
+
import { A as MobileUsernameAvailability, C as MobileRegisteredWallet, D as MobileSignedRequestParams, E as MobileSetUsernameParams, O as MobileUnregisterExpoTokenParams, S as MobileRegisterExpoTokenParams, T as MobileSetPrivateModeParams, _ as MobileNotificationCategoryPreference, a as GetMobileNotificationPreferencesParams, b as MobileProfilesInclude, c as GetMobileUsernameAvailabilityParams, d as MobileFeedTrade, f as MobileFollowListAccount, g as MobileIdentitySummary, h as MobileFollowSummary, i as GetMobileFollowingParams, j as MobileWithExpoTokenParams, k as MobileUpdateNotificationPreferencesParams, l as MobileFeedMargin, m as MobileFollowMutationResult, n as GetMobileFollowListParams, o as GetMobileProfilesParams, p as MobileFollowListPage, r as GetMobileFollowersParams, s as GetMobileRegisteredWalletParams, t as GetMobileFeedParams, u as MobileFeedPage, v as MobileNotificationPreferenceScope, w as MobileSetFollowParams, x as MobilePublicProfile, y as MobileNotificationPreferences } from "../clientTypes-CB_itU4Z.js";
|
|
3
|
+
import { a as MobileServerPublicExecuteRequestType, c as MobileServerRequestType, i as MobileServerPublicExecuteRequestByType, n as MobileServerFollowListRequest, o as MobileServerPublicQueryRequestByType, r as MobileServerProfilesInclude, s as MobileServerPublicQueryRequestType, t as MobileServerExecuteRequestType } from "../serverRequestTypes-Dv9NR-hQ.js";
|
|
4
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-C2JGib--.js";
|
|
5
|
+
import { a as MobileServerFollowMutationResponse, i as MobileServerExecuteSuccessResponse, n as MobileServerExecuteResponseByType, o as MobileServerPublicExecuteRequest, r as MobileServerExecuteResult, t as MobileServerEmptyExecuteResponse } from "../serverExecuteTypes-C2NoNEwu.js";
|
|
6
|
+
import { a as MobileServerPublicQueryRequest, c as MobileServerRegisteredWalletResponse, i as MobileServerProfilesResponse, l as MobileServerUsernameAvailabilityResponse, n as MobileServerFollowListResponse, o as MobileServerPublicQueryResponseByType, r as MobileServerNotificationPreferencesResponse, s as MobileServerPublicQuerySuccessResponse, t as MobileServerFeedResponse } from "../serverQueryTypes-B0xI1G39.js";
|
|
7
7
|
import { n as MobileErrorCode, t as MOBILE_ERROR_CODES } from "../mobileErrorCodes-B3eR6t4b.js";
|
|
8
|
-
import { t as MobileServerFailureError } from "../MobileServerFailureError-
|
|
9
|
-
export { GetMobileFeedParams, GetMobileFollowListParams, GetMobileFollowersParams, GetMobileFollowingParams, GetMobileNotificationPreferencesParams, GetMobileProfilesParams, GetMobileRegisteredWalletParams, GetMobileUsernameAvailabilityParams, MOBILE_ERROR_CODES, MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, MobileErrorCode, MobileFeedMargin, MobileFeedMarginMode, MobileFeedPage, MobileFeedTrade, MobileFeedTradePosition, MobileFeedTradePositionDirection, MobileFeedTradePositionEffect, MobileFollowListAccount, MobileFollowListPage, MobileFollowMutationResult,
|
|
8
|
+
import { t as MobileServerFailureError } from "../MobileServerFailureError-CrNpL_L4.js";
|
|
9
|
+
export { GetMobileFeedParams, GetMobileFollowListParams, GetMobileFollowersParams, GetMobileFollowingParams, GetMobileNotificationPreferencesParams, GetMobileProfilesParams, GetMobileRegisteredWalletParams, GetMobileUsernameAvailabilityParams, MOBILE_ERROR_CODES, MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, MobileErrorCode, MobileFeedMargin, MobileFeedMarginMode, MobileFeedPage, MobileFeedTrade, MobileFeedTradePosition, MobileFeedTradePositionDirection, MobileFeedTradePositionEffect, MobileFollowListAccount, MobileFollowListPage, MobileFollowMutationResult, MobileFollowSummary, MobileIdentitySummary, MobileNotificationCategory, MobileNotificationCategoryPreference, MobileNotificationPlatform, MobileNotificationPreferenceScope, MobileNotificationPreferences, MobileProfilesInclude, MobilePublicProfile, MobileRegisterExpoTokenParams, MobileRegisteredWallet, MobileServerEmptyExecuteResponse, MobileServerExecuteRequestType, MobileServerExecuteResponseByType, MobileServerExecuteResult, MobileServerExecuteSuccessResponse, MobileServerFailureError, MobileServerFailureResponse, MobileServerFeedMargin, MobileServerFeedResponse, MobileServerFeedTrade, MobileServerFollowListAccount, MobileServerFollowListRequest, MobileServerFollowListResponse, MobileServerFollowMutationResponse, MobileServerFollowSummary, MobileServerIdentitySummary, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerNotificationPreferencesResponse, MobileServerProfile, MobileServerProfilesInclude, MobileServerProfilesResponse, MobileServerPublicExecuteRequest, MobileServerPublicExecuteRequestByType, MobileServerPublicExecuteRequestType, MobileServerPublicQueryRequest, MobileServerPublicQueryRequestByType, MobileServerPublicQueryRequestType, MobileServerPublicQueryResponseByType, MobileServerPublicQuerySuccessResponse, MobileServerRegisteredWalletResponse, MobileServerRequestType, MobileServerSuccessResponse, MobileServerUsernameAvailabilityResponse, MobileSetFollowParams, MobileSetPrivateModeParams, MobileSetUsernameParams, MobileSignedRequestParams, MobileUnregisterExpoTokenParams, MobileUpdateNotificationPreferencesParams, MobileUsernameAvailability, MobileWithExpoTokenParams };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../MobileClient-
|
|
2
|
+
require("../MobileClient-Duy7MvxN.cjs");
|
|
3
3
|
//#region src/types/mobileErrorCodes.ts
|
|
4
4
|
/**
|
|
5
5
|
* Numeric error codes returned by the mobile service API. Identity codes (61xx), notification codes (62xx),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-
|
|
1
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-YkCmgmt1.cjs";
|
|
2
2
|
export { MobileServerFailureResponse, MobileServerSuccessResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-
|
|
1
|
+
import { n as MobileServerSuccessResponse, t as MobileServerFailureResponse } from "../serverBaseTypes-C2JGib--.js";
|
|
2
2
|
export { MobileServerFailureResponse, MobileServerSuccessResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MobileServerFollowMutationResponse, i as MobileServerExecuteSuccessResponse, n as MobileServerExecuteResponseByType, o as MobileServerPublicExecuteRequest, r as MobileServerExecuteResult, t as MobileServerEmptyExecuteResponse } from "../serverExecuteTypes-
|
|
1
|
+
import { a as MobileServerFollowMutationResponse, i as MobileServerExecuteSuccessResponse, n as MobileServerExecuteResponseByType, o as MobileServerPublicExecuteRequest, r as MobileServerExecuteResult, t as MobileServerEmptyExecuteResponse } from "../serverExecuteTypes-DPZbs9ym.cjs";
|
|
2
2
|
export { MobileServerEmptyExecuteResponse, MobileServerExecuteResponseByType, MobileServerExecuteResult, MobileServerExecuteSuccessResponse, MobileServerFollowMutationResponse, MobileServerPublicExecuteRequest };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MobileServerFollowMutationResponse, i as MobileServerExecuteSuccessResponse, n as MobileServerExecuteResponseByType, o as MobileServerPublicExecuteRequest, r as MobileServerExecuteResult, t as MobileServerEmptyExecuteResponse } from "../serverExecuteTypes-
|
|
1
|
+
import { a as MobileServerFollowMutationResponse, i as MobileServerExecuteSuccessResponse, n as MobileServerExecuteResponseByType, o as MobileServerPublicExecuteRequest, r as MobileServerExecuteResult, t as MobileServerEmptyExecuteResponse } from "../serverExecuteTypes-C2NoNEwu.js";
|
|
2
2
|
export { MobileServerEmptyExecuteResponse, MobileServerExecuteResponseByType, MobileServerExecuteResult, MobileServerExecuteSuccessResponse, MobileServerFollowMutationResponse, MobileServerPublicExecuteRequest };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverModelTypes.cjs","names":[],"sources":["../../src/types/serverModelTypes.ts"],"sourcesContent":["import { BalanceSide } from '@nadohq/shared';\nimport { Hex } from 'viem';\n\n/**\n * Platform of a device registered for push notifications.\n */\nexport type MobileNotificationPlatform = 'ios' | 'android';\n\n/**\n * Category of push notification.\n */\nexport type MobileNotificationCategory =\n | 'order_fill'\n | 'order_update'\n | 'liquidation'\n | 'funding'\n | 'product_listing'\n | 'announcement';\n\n/**\n * Server-side identity summary (snake_case): the read-time identity fields the backend attaches to a\n * subaccount wherever it surfaces one alongside other data. Name fields are `null` until the subaccount\n * claims a username, and a rename shows up on the next read without any change to the surrounding record.\n */\nexport interface MobileServerIdentitySummary {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n /** Reserved for a future avatar source; `null` until one is implemented. */\n avatar_url: string | null;\n}\n\n/**\n * Server-side follow summary (snake_case), nested in a `profiles` entry when the `follow_summary` include is\n * requested. `is_following` is the direct `view_as -> this profile` relationship; every `followed_by` entry\n * satisfies both `view_as -> entry` and `entry -> this profile`, so each one is already familiar to the\n * viewer and carries no `is_following` of its own.\n */\nexport interface MobileServerFollowSummary {\n is_following: boolean;\n /** Exact size of the two-edge intersection, independent of how many previews came back. */\n followed_by_count: number;\n /** Capped at `MOBILE_FOLLOWED_BY_PREVIEW_LIMIT` (2) by the backend; not client-configurable. */\n followed_by: MobileServerIdentitySummary[];\n}\n\n/**\n * Server-side public profile shape (snake_case), shared by the singular `profile` and batched `profiles`\n * queries. Name fields are `null` until the subaccount claims a username; a subaccount with no identity row\n * still yields an entry, with `null` names and `private_mode: false`.\n *\n * The three optional fields are omitted from the wire entirely unless the matching `profiles` include asked\n * for them, which is why they are optional rather than nullable — absent means \"not requested\", not \"none\".\n * The singular `profile` query never returns any of them.\n */\nexport interface MobileServerProfile {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n private_mode: boolean;\n /**\n * Exact count at query time — the backend counts rather than reading a cached counter. Unnamed and private\n * accounts are included: Private Mode hides activity, not relationships. Requires `follow_counts`.\n */\n follower_count?: number;\n following_count?: number;\n /** Requires the `follow_summary` include, and is relative to that include's `view_as`. */\n follow_summary?: MobileServerFollowSummary;\n}\n\n/**\n * Server-side row of a Followers or Following page (snake_case)
|
|
1
|
+
{"version":3,"file":"serverModelTypes.cjs","names":[],"sources":["../../src/types/serverModelTypes.ts"],"sourcesContent":["import { BalanceSide } from '@nadohq/shared';\nimport { Hex } from 'viem';\n\n/**\n * Platform of a device registered for push notifications.\n */\nexport type MobileNotificationPlatform = 'ios' | 'android';\n\n/**\n * Category of push notification.\n */\nexport type MobileNotificationCategory =\n | 'order_fill'\n | 'order_update'\n | 'liquidation'\n | 'funding'\n | 'product_listing'\n | 'announcement';\n\n/**\n * Server-side identity summary (snake_case): the read-time identity fields the backend attaches to a\n * subaccount wherever it surfaces one alongside other data. Name fields are `null` until the subaccount\n * claims a username, and a rename shows up on the next read without any change to the surrounding record.\n */\nexport interface MobileServerIdentitySummary {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n /** Reserved for a future avatar source; `null` until one is implemented. */\n avatar_url: string | null;\n}\n\n/**\n * Server-side follow summary (snake_case), nested in a `profiles` entry when the `follow_summary` include is\n * requested. `is_following` is the direct `view_as -> this profile` relationship; every `followed_by` entry\n * satisfies both `view_as -> entry` and `entry -> this profile`, so each one is already familiar to the\n * viewer and carries no `is_following` of its own.\n */\nexport interface MobileServerFollowSummary {\n is_following: boolean;\n /** Exact size of the two-edge intersection, independent of how many previews came back. */\n followed_by_count: number;\n /** Capped at `MOBILE_FOLLOWED_BY_PREVIEW_LIMIT` (2) by the backend; not client-configurable. */\n followed_by: MobileServerIdentitySummary[];\n}\n\n/**\n * Server-side public profile shape (snake_case), shared by the singular `profile` and batched `profiles`\n * queries. Name fields are `null` until the subaccount claims a username; a subaccount with no identity row\n * still yields an entry, with `null` names and `private_mode: false`.\n *\n * The three optional fields are omitted from the wire entirely unless the matching `profiles` include asked\n * for them, which is why they are optional rather than nullable — absent means \"not requested\", not \"none\".\n * The singular `profile` query never returns any of them.\n */\nexport interface MobileServerProfile {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n private_mode: boolean;\n /**\n * Exact count at query time — the backend counts rather than reading a cached counter. Unnamed and private\n * accounts are included: Private Mode hides activity, not relationships. Requires `follow_counts`.\n */\n follower_count?: number;\n following_count?: number;\n /** Requires the `follow_summary` include, and is relative to that include's `view_as`. */\n follow_summary?: MobileServerFollowSummary;\n}\n\n/**\n * Server-side row of a Followers or Following page (snake_case).\n */\nexport interface MobileServerFollowListAccount {\n identity: MobileServerIdentitySummary;\n /**\n * The `view_as` Viewer's relationship to this account, not the listed relationship that put it in the\n * page, so it is `false` on the Viewer's own row. Omitted entirely when the request named no `view_as`,\n * rather than being sent as a misleading `false`.\n */\n is_following?: boolean;\n /** The listed account's own follower count, exact at query time. */\n follower_count: number;\n}\n\n/**\n * Direction of the position a feed trade resulted in — for `closed`, the direction that was closed. This is\n * NOT the execution buy/sell side, which the feed does not expose. Aliases {@link BalanceSide} so the feed's\n * direction values stay in lockstep with the rest of the SDK.\n */\nexport type MobileFeedTradePositionDirection = BalanceSide;\n\n/**\n * Every {@link MobileFeedTradePositionDirection} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_DIRECTIONS = [\n 'long',\n 'short',\n] as const satisfies readonly MobileFeedTradePositionDirection[];\n\n/**\n * Every {@link MobileFeedTradePositionEffect} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_EFFECTS = [\n 'opened',\n 'increased',\n 'reduced',\n 'closed',\n 'flipped',\n] as const;\n\n/**\n * How a feed trade changed the trader's position in the product.\n */\nexport type MobileFeedTradePositionEffect =\n (typeof MOBILE_FEED_TRADE_POSITION_EFFECTS)[number];\n\n/**\n * Position change of a feed trade. Both keys are single words, so the wire and client shapes are identical\n * and this type is shared by {@link MobileServerFeedTrade} and the client-side `MobileFeedTrade`.\n */\nexport interface MobileFeedTradePosition {\n direction: MobileFeedTradePositionDirection;\n effect: MobileFeedTradePositionEffect;\n}\n\n/**\n * Every {@link MobileFeedMarginMode} the feed can report, for callers that need the values at runtime\n * (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_MARGIN_MODES = ['cross', 'isolated'] as const;\n\n/**\n * Margin mode a feed trade was executed under. Shared by the wire and client margin shapes.\n */\nexport type MobileFeedMarginMode = (typeof MOBILE_FEED_MARGIN_MODES)[number];\n\n/**\n * Server-side margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:\n * `estimated_leverage` (a rounded whole-number estimate, not exact submitted leverage) is omitted on `cross`,\n * and also omitted inside `isolated` when no estimate is available.\n */\nexport interface MobileServerFeedMargin {\n mode: MobileFeedMarginMode;\n estimated_leverage?: number;\n}\n\n/**\n * Server-side feed trade shape (snake_case): one row per order digest, enriched at read time with the\n * trader's current identity. Amounts are display-oriented human-unit JSON numbers — do not use them for\n * accounting, order construction, or exact threshold decisions.\n */\nexport interface MobileServerFeedTrade extends MobileServerIdentitySummary {\n /** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */\n order_digest: Hex;\n product_id: number;\n /** Executed quantity in human units. */\n quantity: number;\n /** Trade notional in whole-dollar human units. */\n notional: number;\n /** Average execution price in human units. */\n average_price: number;\n margin: MobileServerFeedMargin;\n position: MobileFeedTradePosition;\n /** Realized PnL of the trade in human units; can be negative. */\n realized_pnl: number;\n /** Fill time as JavaScript-safe integer Unix milliseconds. */\n filled_at_ms: number;\n}\n\n/**\n * Server-side scope limiting a notification category preference. Scopes are rejected by the backend for the\n * MVP (`scopes` must be empty) but are part of the wire format.\n */\nexport type MobileServerNotificationPreferenceScope =\n | { type: 'subaccount'; subaccount: Hex }\n | { type: 'product'; product_id: number };\n\n/**\n * Server-side per-category notification preference (snake_case).\n */\nexport interface MobileServerNotificationCategoryPreference {\n category: MobileNotificationCategory;\n enabled: boolean;\n scopes: MobileServerNotificationPreferenceScope[];\n}\n\n/**\n * Server-side notification preferences shape (snake_case), used in both the `update_preferences` public\n * execute and the `notification_preferences` public query response.\n */\nexport interface MobileServerNotificationPreferences {\n /** Only `1` is accepted by the backend for the MVP. */\n schema_version: 1;\n categories: MobileServerNotificationCategoryPreference[];\n}\n"],"mappings":";;;;;;AAgGA,MAAa,wCAAwC,CACnD,QACA,OACF;;;;;AAMA,MAAa,qCAAqC;CAChD;CACA;CACA;CACA;CACA;AACF;;;;;AAqBA,MAAa,2BAA2B,CAAC,SAAS,UAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as MobileServerNotificationPreferences, a as MobileFeedTradePosition, c as MobileNotificationCategory, d as MobileServerFeedTrade, f as MobileServerFollowListAccount, g as MobileServerNotificationPreferenceScope, h as MobileServerNotificationCategoryPreference, i as MobileFeedMarginMode, l as MobileNotificationPlatform, m as MobileServerIdentitySummary, n as MOBILE_FEED_TRADE_POSITION_DIRECTIONS, o as MobileFeedTradePositionDirection, p as MobileServerFollowSummary, r as MOBILE_FEED_TRADE_POSITION_EFFECTS, s as MobileFeedTradePositionEffect, t as MOBILE_FEED_MARGIN_MODES, u as MobileServerFeedMargin, v as MobileServerProfile } from "../serverModelTypes-
|
|
1
|
+
import { _ as MobileServerNotificationPreferences, a as MobileFeedTradePosition, c as MobileNotificationCategory, d as MobileServerFeedTrade, f as MobileServerFollowListAccount, g as MobileServerNotificationPreferenceScope, h as MobileServerNotificationCategoryPreference, i as MobileFeedMarginMode, l as MobileNotificationPlatform, m as MobileServerIdentitySummary, n as MOBILE_FEED_TRADE_POSITION_DIRECTIONS, o as MobileFeedTradePositionDirection, p as MobileServerFollowSummary, r as MOBILE_FEED_TRADE_POSITION_EFFECTS, s as MobileFeedTradePositionEffect, t as MOBILE_FEED_MARGIN_MODES, u as MobileServerFeedMargin, v as MobileServerProfile } from "../serverModelTypes-CUzqFA6x.cjs";
|
|
2
2
|
export { MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, MobileFeedMarginMode, MobileFeedTradePosition, MobileFeedTradePositionDirection, MobileFeedTradePositionEffect, MobileNotificationCategory, MobileNotificationPlatform, MobileServerFeedMargin, MobileServerFeedTrade, MobileServerFollowListAccount, MobileServerFollowSummary, MobileServerIdentitySummary, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerProfile };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as MobileServerNotificationPreferences, a as MobileFeedTradePosition, c as MobileNotificationCategory, d as MobileServerFeedTrade, f as MobileServerFollowListAccount, g as MobileServerNotificationPreferenceScope, h as MobileServerNotificationCategoryPreference, i as MobileFeedMarginMode, l as MobileNotificationPlatform, m as MobileServerIdentitySummary, n as MOBILE_FEED_TRADE_POSITION_DIRECTIONS, o as MobileFeedTradePositionDirection, p as MobileServerFollowSummary, r as MOBILE_FEED_TRADE_POSITION_EFFECTS, s as MobileFeedTradePositionEffect, t as MOBILE_FEED_MARGIN_MODES, u as MobileServerFeedMargin, v as MobileServerProfile } from "../serverModelTypes-
|
|
1
|
+
import { _ as MobileServerNotificationPreferences, a as MobileFeedTradePosition, c as MobileNotificationCategory, d as MobileServerFeedTrade, f as MobileServerFollowListAccount, g as MobileServerNotificationPreferenceScope, h as MobileServerNotificationCategoryPreference, i as MobileFeedMarginMode, l as MobileNotificationPlatform, m as MobileServerIdentitySummary, n as MOBILE_FEED_TRADE_POSITION_DIRECTIONS, o as MobileFeedTradePositionDirection, p as MobileServerFollowSummary, r as MOBILE_FEED_TRADE_POSITION_EFFECTS, s as MobileFeedTradePositionEffect, t as MOBILE_FEED_MARGIN_MODES, u as MobileServerFeedMargin, v as MobileServerProfile } from "../serverModelTypes-CDcRlRtw.js";
|
|
2
2
|
export { MOBILE_FEED_MARGIN_MODES, MOBILE_FEED_TRADE_POSITION_DIRECTIONS, MOBILE_FEED_TRADE_POSITION_EFFECTS, MobileFeedMarginMode, MobileFeedTradePosition, MobileFeedTradePositionDirection, MobileFeedTradePositionEffect, MobileNotificationCategory, MobileNotificationPlatform, MobileServerFeedMargin, MobileServerFeedTrade, MobileServerFollowListAccount, MobileServerFollowSummary, MobileServerIdentitySummary, MobileServerNotificationCategoryPreference, MobileServerNotificationPreferenceScope, MobileServerNotificationPreferences, MobileServerProfile };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverModelTypes.js","names":[],"sources":["../../src/types/serverModelTypes.ts"],"sourcesContent":["import { BalanceSide } from '@nadohq/shared';\nimport { Hex } from 'viem';\n\n/**\n * Platform of a device registered for push notifications.\n */\nexport type MobileNotificationPlatform = 'ios' | 'android';\n\n/**\n * Category of push notification.\n */\nexport type MobileNotificationCategory =\n | 'order_fill'\n | 'order_update'\n | 'liquidation'\n | 'funding'\n | 'product_listing'\n | 'announcement';\n\n/**\n * Server-side identity summary (snake_case): the read-time identity fields the backend attaches to a\n * subaccount wherever it surfaces one alongside other data. Name fields are `null` until the subaccount\n * claims a username, and a rename shows up on the next read without any change to the surrounding record.\n */\nexport interface MobileServerIdentitySummary {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n /** Reserved for a future avatar source; `null` until one is implemented. */\n avatar_url: string | null;\n}\n\n/**\n * Server-side follow summary (snake_case), nested in a `profiles` entry when the `follow_summary` include is\n * requested. `is_following` is the direct `view_as -> this profile` relationship; every `followed_by` entry\n * satisfies both `view_as -> entry` and `entry -> this profile`, so each one is already familiar to the\n * viewer and carries no `is_following` of its own.\n */\nexport interface MobileServerFollowSummary {\n is_following: boolean;\n /** Exact size of the two-edge intersection, independent of how many previews came back. */\n followed_by_count: number;\n /** Capped at `MOBILE_FOLLOWED_BY_PREVIEW_LIMIT` (2) by the backend; not client-configurable. */\n followed_by: MobileServerIdentitySummary[];\n}\n\n/**\n * Server-side public profile shape (snake_case), shared by the singular `profile` and batched `profiles`\n * queries. Name fields are `null` until the subaccount claims a username; a subaccount with no identity row\n * still yields an entry, with `null` names and `private_mode: false`.\n *\n * The three optional fields are omitted from the wire entirely unless the matching `profiles` include asked\n * for them, which is why they are optional rather than nullable — absent means \"not requested\", not \"none\".\n * The singular `profile` query never returns any of them.\n */\nexport interface MobileServerProfile {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n private_mode: boolean;\n /**\n * Exact count at query time — the backend counts rather than reading a cached counter. Unnamed and private\n * accounts are included: Private Mode hides activity, not relationships. Requires `follow_counts`.\n */\n follower_count?: number;\n following_count?: number;\n /** Requires the `follow_summary` include, and is relative to that include's `view_as`. */\n follow_summary?: MobileServerFollowSummary;\n}\n\n/**\n * Server-side row of a Followers or Following page (snake_case)
|
|
1
|
+
{"version":3,"file":"serverModelTypes.js","names":[],"sources":["../../src/types/serverModelTypes.ts"],"sourcesContent":["import { BalanceSide } from '@nadohq/shared';\nimport { Hex } from 'viem';\n\n/**\n * Platform of a device registered for push notifications.\n */\nexport type MobileNotificationPlatform = 'ios' | 'android';\n\n/**\n * Category of push notification.\n */\nexport type MobileNotificationCategory =\n | 'order_fill'\n | 'order_update'\n | 'liquidation'\n | 'funding'\n | 'product_listing'\n | 'announcement';\n\n/**\n * Server-side identity summary (snake_case): the read-time identity fields the backend attaches to a\n * subaccount wherever it surfaces one alongside other data. Name fields are `null` until the subaccount\n * claims a username, and a rename shows up on the next read without any change to the surrounding record.\n */\nexport interface MobileServerIdentitySummary {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n /** Reserved for a future avatar source; `null` until one is implemented. */\n avatar_url: string | null;\n}\n\n/**\n * Server-side follow summary (snake_case), nested in a `profiles` entry when the `follow_summary` include is\n * requested. `is_following` is the direct `view_as -> this profile` relationship; every `followed_by` entry\n * satisfies both `view_as -> entry` and `entry -> this profile`, so each one is already familiar to the\n * viewer and carries no `is_following` of its own.\n */\nexport interface MobileServerFollowSummary {\n is_following: boolean;\n /** Exact size of the two-edge intersection, independent of how many previews came back. */\n followed_by_count: number;\n /** Capped at `MOBILE_FOLLOWED_BY_PREVIEW_LIMIT` (2) by the backend; not client-configurable. */\n followed_by: MobileServerIdentitySummary[];\n}\n\n/**\n * Server-side public profile shape (snake_case), shared by the singular `profile` and batched `profiles`\n * queries. Name fields are `null` until the subaccount claims a username; a subaccount with no identity row\n * still yields an entry, with `null` names and `private_mode: false`.\n *\n * The three optional fields are omitted from the wire entirely unless the matching `profiles` include asked\n * for them, which is why they are optional rather than nullable — absent means \"not requested\", not \"none\".\n * The singular `profile` query never returns any of them.\n */\nexport interface MobileServerProfile {\n subaccount: Hex;\n username: string | null;\n display_name: string | null;\n private_mode: boolean;\n /**\n * Exact count at query time — the backend counts rather than reading a cached counter. Unnamed and private\n * accounts are included: Private Mode hides activity, not relationships. Requires `follow_counts`.\n */\n follower_count?: number;\n following_count?: number;\n /** Requires the `follow_summary` include, and is relative to that include's `view_as`. */\n follow_summary?: MobileServerFollowSummary;\n}\n\n/**\n * Server-side row of a Followers or Following page (snake_case).\n */\nexport interface MobileServerFollowListAccount {\n identity: MobileServerIdentitySummary;\n /**\n * The `view_as` Viewer's relationship to this account, not the listed relationship that put it in the\n * page, so it is `false` on the Viewer's own row. Omitted entirely when the request named no `view_as`,\n * rather than being sent as a misleading `false`.\n */\n is_following?: boolean;\n /** The listed account's own follower count, exact at query time. */\n follower_count: number;\n}\n\n/**\n * Direction of the position a feed trade resulted in — for `closed`, the direction that was closed. This is\n * NOT the execution buy/sell side, which the feed does not expose. Aliases {@link BalanceSide} so the feed's\n * direction values stay in lockstep with the rest of the SDK.\n */\nexport type MobileFeedTradePositionDirection = BalanceSide;\n\n/**\n * Every {@link MobileFeedTradePositionDirection} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_DIRECTIONS = [\n 'long',\n 'short',\n] as const satisfies readonly MobileFeedTradePositionDirection[];\n\n/**\n * Every {@link MobileFeedTradePositionEffect} the feed can report, for callers that need the values at\n * runtime (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_TRADE_POSITION_EFFECTS = [\n 'opened',\n 'increased',\n 'reduced',\n 'closed',\n 'flipped',\n] as const;\n\n/**\n * How a feed trade changed the trader's position in the product.\n */\nexport type MobileFeedTradePositionEffect =\n (typeof MOBILE_FEED_TRADE_POSITION_EFFECTS)[number];\n\n/**\n * Position change of a feed trade. Both keys are single words, so the wire and client shapes are identical\n * and this type is shared by {@link MobileServerFeedTrade} and the client-side `MobileFeedTrade`.\n */\nexport interface MobileFeedTradePosition {\n direction: MobileFeedTradePositionDirection;\n effect: MobileFeedTradePositionEffect;\n}\n\n/**\n * Every {@link MobileFeedMarginMode} the feed can report, for callers that need the values at runtime\n * (validation, filters, UI enumeration).\n */\nexport const MOBILE_FEED_MARGIN_MODES = ['cross', 'isolated'] as const;\n\n/**\n * Margin mode a feed trade was executed under. Shared by the wire and client margin shapes.\n */\nexport type MobileFeedMarginMode = (typeof MOBILE_FEED_MARGIN_MODES)[number];\n\n/**\n * Server-side margin of a feed trade. Branch on `mode` — do not infer isolated state from leverage presence:\n * `estimated_leverage` (a rounded whole-number estimate, not exact submitted leverage) is omitted on `cross`,\n * and also omitted inside `isolated` when no estimate is available.\n */\nexport interface MobileServerFeedMargin {\n mode: MobileFeedMarginMode;\n estimated_leverage?: number;\n}\n\n/**\n * Server-side feed trade shape (snake_case): one row per order digest, enriched at read time with the\n * trader's current identity. Amounts are display-oriented human-unit JSON numbers — do not use them for\n * accounting, order construction, or exact threshold decisions.\n */\nexport interface MobileServerFeedTrade extends MobileServerIdentitySummary {\n /** Order digest this row is keyed by; the stable id clients use to reconcile live pagination. */\n order_digest: Hex;\n product_id: number;\n /** Executed quantity in human units. */\n quantity: number;\n /** Trade notional in whole-dollar human units. */\n notional: number;\n /** Average execution price in human units. */\n average_price: number;\n margin: MobileServerFeedMargin;\n position: MobileFeedTradePosition;\n /** Realized PnL of the trade in human units; can be negative. */\n realized_pnl: number;\n /** Fill time as JavaScript-safe integer Unix milliseconds. */\n filled_at_ms: number;\n}\n\n/**\n * Server-side scope limiting a notification category preference. Scopes are rejected by the backend for the\n * MVP (`scopes` must be empty) but are part of the wire format.\n */\nexport type MobileServerNotificationPreferenceScope =\n | { type: 'subaccount'; subaccount: Hex }\n | { type: 'product'; product_id: number };\n\n/**\n * Server-side per-category notification preference (snake_case).\n */\nexport interface MobileServerNotificationCategoryPreference {\n category: MobileNotificationCategory;\n enabled: boolean;\n scopes: MobileServerNotificationPreferenceScope[];\n}\n\n/**\n * Server-side notification preferences shape (snake_case), used in both the `update_preferences` public\n * execute and the `notification_preferences` public query response.\n */\nexport interface MobileServerNotificationPreferences {\n /** Only `1` is accepted by the backend for the MVP. */\n schema_version: 1;\n categories: MobileServerNotificationCategoryPreference[];\n}\n"],"mappings":";;;;;AAgGA,MAAa,wCAAwC,CACnD,QACA,OACF;;;;;AAMA,MAAa,qCAAqC;CAChD;CACA;CACA;CACA;CACA;AACF;;;;;AAqBA,MAAa,2BAA2B,CAAC,SAAS,UAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MobileServerPublicQueryRequest, c as MobileServerRegisteredWalletResponse,
|
|
2
|
-
export { MobileServerFeedResponse, MobileServerFollowListResponse, MobileServerNotificationPreferencesResponse, MobileServerProfilesResponse, MobileServerPublicQueryRequest, MobileServerPublicQueryResponseByType, MobileServerPublicQuerySuccessResponse, MobileServerRegisteredWalletResponse,
|
|
1
|
+
import { a as MobileServerPublicQueryRequest, c as MobileServerRegisteredWalletResponse, i as MobileServerProfilesResponse, l as MobileServerUsernameAvailabilityResponse, n as MobileServerFollowListResponse, o as MobileServerPublicQueryResponseByType, r as MobileServerNotificationPreferencesResponse, s as MobileServerPublicQuerySuccessResponse, t as MobileServerFeedResponse } from "../serverQueryTypes-RdcIqRnM.cjs";
|
|
2
|
+
export { MobileServerFeedResponse, MobileServerFollowListResponse, MobileServerNotificationPreferencesResponse, MobileServerProfilesResponse, MobileServerPublicQueryRequest, MobileServerPublicQueryResponseByType, MobileServerPublicQuerySuccessResponse, MobileServerRegisteredWalletResponse, MobileServerUsernameAvailabilityResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MobileServerPublicQueryRequest, c as MobileServerRegisteredWalletResponse,
|
|
2
|
-
export { MobileServerFeedResponse, MobileServerFollowListResponse, MobileServerNotificationPreferencesResponse, MobileServerProfilesResponse, MobileServerPublicQueryRequest, MobileServerPublicQueryResponseByType, MobileServerPublicQuerySuccessResponse, MobileServerRegisteredWalletResponse,
|
|
1
|
+
import { a as MobileServerPublicQueryRequest, c as MobileServerRegisteredWalletResponse, i as MobileServerProfilesResponse, l as MobileServerUsernameAvailabilityResponse, n as MobileServerFollowListResponse, o as MobileServerPublicQueryResponseByType, r as MobileServerNotificationPreferencesResponse, s as MobileServerPublicQuerySuccessResponse, t as MobileServerFeedResponse } from "../serverQueryTypes-B0xI1G39.js";
|
|
2
|
+
export { MobileServerFeedResponse, MobileServerFollowListResponse, MobileServerNotificationPreferencesResponse, MobileServerProfilesResponse, MobileServerPublicQueryRequest, MobileServerPublicQueryResponseByType, MobileServerPublicQuerySuccessResponse, MobileServerRegisteredWalletResponse, MobileServerUsernameAvailabilityResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { MobileServerExecuteRequestType, MobileServerProfilesInclude, MobileServerPublicExecuteRequestByType, MobileServerPublicExecuteRequestType, MobileServerPublicQueryRequestByType, MobileServerPublicQueryRequestType, MobileServerRequestType
|
|
1
|
+
import { a as MobileServerPublicExecuteRequestType, c as MobileServerRequestType, i as MobileServerPublicExecuteRequestByType, n as MobileServerFollowListRequest, o as MobileServerPublicQueryRequestByType, r as MobileServerProfilesInclude, s as MobileServerPublicQueryRequestType, t as MobileServerExecuteRequestType } from "../serverRequestTypes-Ddws3yXc.cjs";
|
|
2
|
+
export { MobileServerExecuteRequestType, MobileServerFollowListRequest, MobileServerProfilesInclude, MobileServerPublicExecuteRequestByType, MobileServerPublicExecuteRequestType, MobileServerPublicQueryRequestByType, MobileServerPublicQueryRequestType, MobileServerRequestType };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { MobileServerExecuteRequestType, MobileServerProfilesInclude, MobileServerPublicExecuteRequestByType, MobileServerPublicExecuteRequestType, MobileServerPublicQueryRequestByType, MobileServerPublicQueryRequestType, MobileServerRequestType
|
|
1
|
+
import { a as MobileServerPublicExecuteRequestType, c as MobileServerRequestType, i as MobileServerPublicExecuteRequestByType, n as MobileServerFollowListRequest, o as MobileServerPublicQueryRequestByType, r as MobileServerProfilesInclude, s as MobileServerPublicQueryRequestType, t as MobileServerExecuteRequestType } from "../serverRequestTypes-Dv9NR-hQ.js";
|
|
2
|
+
export { MobileServerExecuteRequestType, MobileServerFollowListRequest, MobileServerProfilesInclude, MobileServerPublicExecuteRequestByType, MobileServerPublicExecuteRequestType, MobileServerPublicQueryRequestByType, MobileServerPublicQueryRequestType, MobileServerRequestType };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as MobileNotificationPlatform } from "./serverModelTypes-
|
|
2
|
-
import {
|
|
1
|
+
import { l as MobileNotificationPlatform } from "./serverModelTypes-CDcRlRtw.js";
|
|
2
|
+
import { D as MobileSignedRequestParams } from "./clientTypes-CB_itU4Z.js";
|
|
3
3
|
import { WalletClientWithAccount } from "@nadohq/shared";
|
|
4
4
|
import { Hex } from "viem";
|
|
5
5
|
|
|
@@ -34,16 +34,6 @@ type MobileSignedInner = {
|
|
|
34
34
|
type: 'set_follow';
|
|
35
35
|
subaccount: Hex; /** `true` follows the target, `false` unfollows it. Both directions are idempotent. */
|
|
36
36
|
is_following: boolean;
|
|
37
|
-
} | {
|
|
38
|
-
type: 'followers';
|
|
39
|
-
subaccount: Hex; /** `null` requests the first page; otherwise an opaque cursor from the previous page. */
|
|
40
|
-
cursor: string | null; /** `null` requests the backend default of 25; otherwise 1–50. */
|
|
41
|
-
limit: number | null;
|
|
42
|
-
} | {
|
|
43
|
-
type: 'following';
|
|
44
|
-
subaccount: Hex; /** `null` requests the first page; otherwise an opaque cursor from the previous page. */
|
|
45
|
-
cursor: string | null; /** `null` requests the backend default of 25; otherwise 1–50. */
|
|
46
|
-
limit: number | null;
|
|
47
37
|
};
|
|
48
38
|
/**
|
|
49
39
|
* The single {@link MobileSignedInner} member carrying the given `type` tag.
|
|
@@ -78,4 +68,4 @@ interface BuildSignedMobileRequestParams extends MobileSignedRequestParams {
|
|
|
78
68
|
}
|
|
79
69
|
//#endregion
|
|
80
70
|
export { MobileSignedRequest as a, MobileSignedInnerParams as i, MobileSignedInner as n, MobileSignedInnerByType as r, BuildSignedMobileRequestParams as t };
|
|
81
|
-
//# sourceMappingURL=types-
|
|
71
|
+
//# sourceMappingURL=types-BIIvIzG2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BIIvIzG2.d.ts","names":[],"sources":["../src/signing/src/signing/types.ts"],"mappings":";;;;;;;;AAmBA;;;;;;;;;;;;KAAY,iBAAA;EACN,IAAA;EAAsB,YAAA;AAAA;EACtB,IAAA;EAA0B,YAAA;AAAA;EAE1B,IAAA;EACA,UAAA;EACA,QAAA,EAAU,0BAAA;EAGV,MAAA;EACA,WAAA;AAAA;EAGA,IAAA;EACA,UAAA,EAAY,GAAG,EASZ;EAPH,YAAA;AAAA;;;;KAMM,uBAAA,WAAkC,iBAAA,YAC5C,OAAA,CAAQ,iBAAA;EAAqB,IAAA,EAAM,CAAA;AAAA;AAAC;AAMtC;;;AANsC,KAM1B,uBAAA,WAAkC,iBAAA,YAA6B,IAAA,CACzE,uBAAA,CAAwB,CAAA;;;;;KAQd,mBAAA,WACA,iBAAA,GAAoB,iBAAA,IAC5B,CAAA;EACF,SAAA,EAAW,GAAA;EACX,MAAA,EAAQ,GAAA;EACR,KAAA;AAAA;;;AAbyB;UAmBV,8BAAA,SAAuC,yBAAA;EACtD,YAAA,EAAc,uBAAA;EACd,KAAA,EAAO,iBAAA;EAZG;;;EAgBV,KAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as MobileNotificationPlatform } from "./serverModelTypes-
|
|
2
|
-
import {
|
|
1
|
+
import { l as MobileNotificationPlatform } from "./serverModelTypes-CUzqFA6x.cjs";
|
|
2
|
+
import { D as MobileSignedRequestParams } from "./clientTypes-CceWsQzi.cjs";
|
|
3
3
|
import { WalletClientWithAccount } from "@nadohq/shared";
|
|
4
4
|
import { Hex } from "viem";
|
|
5
5
|
|
|
@@ -34,16 +34,6 @@ type MobileSignedInner = {
|
|
|
34
34
|
type: 'set_follow';
|
|
35
35
|
subaccount: Hex; /** `true` follows the target, `false` unfollows it. Both directions are idempotent. */
|
|
36
36
|
is_following: boolean;
|
|
37
|
-
} | {
|
|
38
|
-
type: 'followers';
|
|
39
|
-
subaccount: Hex; /** `null` requests the first page; otherwise an opaque cursor from the previous page. */
|
|
40
|
-
cursor: string | null; /** `null` requests the backend default of 25; otherwise 1–50. */
|
|
41
|
-
limit: number | null;
|
|
42
|
-
} | {
|
|
43
|
-
type: 'following';
|
|
44
|
-
subaccount: Hex; /** `null` requests the first page; otherwise an opaque cursor from the previous page. */
|
|
45
|
-
cursor: string | null; /** `null` requests the backend default of 25; otherwise 1–50. */
|
|
46
|
-
limit: number | null;
|
|
47
37
|
};
|
|
48
38
|
/**
|
|
49
39
|
* The single {@link MobileSignedInner} member carrying the given `type` tag.
|
|
@@ -78,4 +68,4 @@ interface BuildSignedMobileRequestParams extends MobileSignedRequestParams {
|
|
|
78
68
|
}
|
|
79
69
|
//#endregion
|
|
80
70
|
export { MobileSignedRequest as a, MobileSignedInnerParams as i, MobileSignedInner as n, MobileSignedInnerByType as r, BuildSignedMobileRequestParams as t };
|
|
81
|
-
//# sourceMappingURL=types-
|
|
71
|
+
//# sourceMappingURL=types-UmYaeq1C.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-UmYaeq1C.d.cts","names":[],"sources":["../src/signing/src/signing/types.ts"],"mappings":";;;;;;;;AAmBA;;;;;;;;;;;;KAAY,iBAAA;EACN,IAAA;EAAsB,YAAA;AAAA;EACtB,IAAA;EAA0B,YAAA;AAAA;EAE1B,IAAA;EACA,UAAA;EACA,QAAA,EAAU,0BAAA;EAGV,MAAA;EACA,WAAA;AAAA;EAGA,IAAA;EACA,UAAA,EAAY,GAAG,EASZ;EAPH,YAAA;AAAA;;;;KAMM,uBAAA,WAAkC,iBAAA,YAC5C,OAAA,CAAQ,iBAAA;EAAqB,IAAA,EAAM,CAAA;AAAA;AAAC;AAMtC;;;AANsC,KAM1B,uBAAA,WAAkC,iBAAA,YAA6B,IAAA,CACzE,uBAAA,CAAwB,CAAA;;;;;KAQd,mBAAA,WACA,iBAAA,GAAoB,iBAAA,IAC5B,CAAA;EACF,SAAA,EAAW,GAAA;EACX,MAAA,EAAQ,GAAA;EACR,KAAA;AAAA;;;AAbyB;UAmBV,8BAAA,SAAuC,yBAAA;EACtD,YAAA,EAAc,uBAAA;EACd,KAAA,EAAO,iBAAA;EAZG;;;EAgBV,KAAA;AAAA"}
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as MOBILE_FEED_MIN_NOTIONAL_FLOOR, t as MOBILE_FEED_MAX_PAGE_SIZE } from "../feed-CBIwOhTO.cjs";
|
|
2
2
|
import { i as MOBILE_PROFILES_MAX_BATCH_SIZE, n as MOBILE_FOLLOW_LIST_DEFAULT_PAGE_SIZE, r as MOBILE_FOLLOW_LIST_MAX_PAGE_SIZE, t as MOBILE_FOLLOWED_BY_PREVIEW_LIMIT } from "../follow-Bh3UmXMc.cjs";
|
|
3
3
|
import { t as MOBILE_DISPLAY_NAME_PATTERN } from "../patterns-DS8P5LH0.cjs";
|
|
4
|
-
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-
|
|
4
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-Dg9WbqBA.cjs";
|
|
5
5
|
export { MOBILE_DISPLAY_NAME_PATTERN, MOBILE_FEED_MAX_PAGE_SIZE, MOBILE_FEED_MIN_NOTIONAL_FLOOR, MOBILE_FOLLOWED_BY_PREVIEW_LIMIT, MOBILE_FOLLOW_LIST_DEFAULT_PAGE_SIZE, MOBILE_FOLLOW_LIST_MAX_PAGE_SIZE, MOBILE_PROFILES_MAX_BATCH_SIZE, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as MOBILE_FEED_MIN_NOTIONAL_FLOOR, t as MOBILE_FEED_MAX_PAGE_SIZE } from "../feed-BF5k6Ryu.js";
|
|
2
2
|
import { i as MOBILE_PROFILES_MAX_BATCH_SIZE, n as MOBILE_FOLLOW_LIST_DEFAULT_PAGE_SIZE, r as MOBILE_FOLLOW_LIST_MAX_PAGE_SIZE, t as MOBILE_FOLLOWED_BY_PREVIEW_LIMIT } from "../follow-DjkQm1vR.js";
|
|
3
3
|
import { t as MOBILE_DISPLAY_NAME_PATTERN } from "../patterns-C-aUAnKl.js";
|
|
4
|
-
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-
|
|
4
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-BjIzucYt.js";
|
|
5
5
|
export { MOBILE_DISPLAY_NAME_PATTERN, MOBILE_FEED_MAX_PAGE_SIZE, MOBILE_FEED_MIN_NOTIONAL_FLOOR, MOBILE_FOLLOWED_BY_PREVIEW_LIMIT, MOBILE_FOLLOW_LIST_DEFAULT_PAGE_SIZE, MOBILE_FOLLOW_LIST_MAX_PAGE_SIZE, MOBILE_PROFILES_MAX_BATCH_SIZE, isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-
|
|
1
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-Dg9WbqBA.cjs";
|
|
2
2
|
export { isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-
|
|
1
|
+
import { n as isMobileServerSuccessResponse, t as isMobileServerFailureResponse } from "../serverResponseGuards-BjIzucYt.js";
|
|
2
2
|
export { isMobileServerFailureResponse, isMobileServerSuccessResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/mobile-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "HTTP client for the Nado mobile service API — username claims, profiles, privacy settings, and push notification devices & preferences",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@msgpack/msgpack": "3.1.3",
|
|
45
|
-
"@nadohq/shared": "^0.
|
|
45
|
+
"@nadohq/shared": "^0.41.0",
|
|
46
46
|
"axios": "1.16.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"bignumber.js": "11.1.1",
|
|
55
55
|
"viem": "2.52.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "bd534f98c5e429aafc861e1fcc4a639ffd2850a6"
|
|
58
58
|
}
|
package/src/MobileClient.ts
CHANGED
|
@@ -8,6 +8,7 @@ import axios, { AxiosInstance, AxiosResponse } from 'axios';
|
|
|
8
8
|
import {
|
|
9
9
|
mapMobileFeedPage,
|
|
10
10
|
mapMobileFollowListPage,
|
|
11
|
+
mapMobileFollowListParamsToServer,
|
|
11
12
|
mapMobileFollowMutationResult,
|
|
12
13
|
mapMobileNotificationPreferences,
|
|
13
14
|
mapMobileNotificationPreferencesToServer,
|
|
@@ -55,13 +56,11 @@ import {
|
|
|
55
56
|
import {
|
|
56
57
|
MobileServerPublicQueryRequest,
|
|
57
58
|
MobileServerPublicQuerySuccessResponse,
|
|
58
|
-
MobileServerSignedQuerySuccessResponse,
|
|
59
59
|
} from './types/serverQueryTypes';
|
|
60
60
|
import {
|
|
61
61
|
MobileServerExecuteRequestType,
|
|
62
62
|
MobileServerPublicQueryRequestByType,
|
|
63
63
|
MobileServerPublicQueryRequestType,
|
|
64
|
-
MobileServerSignedQueryRequestType,
|
|
65
64
|
} from './types/serverRequestTypes';
|
|
66
65
|
import {
|
|
67
66
|
isMobileServerFailureResponse,
|
|
@@ -144,8 +143,7 @@ export class MobileClient {
|
|
|
144
143
|
* does not hide the profile itself, only the account's activity.
|
|
145
144
|
*
|
|
146
145
|
* This is the only profile route, so use it for a single subaccount too. It is unsigned, which means
|
|
147
|
-
* `include.followSummary.viewAs` is an unauthenticated claim
|
|
148
|
-
* because they prove the viewer.
|
|
146
|
+
* `include.followSummary.viewAs` is an unauthenticated claim.
|
|
149
147
|
*
|
|
150
148
|
* @throws {MobileServerFailureError} With error code `INVALID_PROFILES_REQUEST` if `subaccounts` is empty,
|
|
151
149
|
* holds duplicates, or exceeds `MOBILE_PROFILES_MAX_BATCH_SIZE` (25), or `PROFILE_NOT_FOUND` if any
|
|
@@ -166,6 +164,48 @@ export class MobileClient {
|
|
|
166
164
|
return data.profiles.map(mapMobilePublicProfile);
|
|
167
165
|
}
|
|
168
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Fetches a page of the accounts that follow the given Profile.
|
|
169
|
+
*
|
|
170
|
+
* Ordering depends on `viewAs`. With it, accounts the Viewer already follows come first, unfamiliar
|
|
171
|
+
* accounts second, and every row carries an `isFollowing`. Without it, the page is ordered by the listed
|
|
172
|
+
* relationship alone and no row carries an `isFollowing`. In both cases the newest listed relationship
|
|
173
|
+
* comes first within a group, with a bytes32 tie-break. The grouping is evaluated per request against the
|
|
174
|
+
* live graph, so following an account from inside the list moves it between groups on the next page —
|
|
175
|
+
* deduplicate by subaccount and do not re-sort locally.
|
|
176
|
+
*
|
|
177
|
+
* @throws {MobileServerFailureError} With error code `PROFILE_NOT_FOUND` if the viewed Profile or `viewAs`
|
|
178
|
+
* is isolated, `INVALID_FOLLOW_CURSOR` if the cursor is malformed or was issued for a different `viewAs`,
|
|
179
|
+
* Profile, or list direction (discard it and restart from the first page), or `INVALID_FOLLOW_LIMIT` if
|
|
180
|
+
* `limit` is outside 1–50.
|
|
181
|
+
*/
|
|
182
|
+
async getFollowers(
|
|
183
|
+
params: GetMobileFollowersParams,
|
|
184
|
+
): Promise<MobileFollowListPage> {
|
|
185
|
+
const body: MobileServerPublicQueryRequest<'followers'> = {
|
|
186
|
+
type: 'followers',
|
|
187
|
+
...mapMobileFollowListParamsToServer(params),
|
|
188
|
+
};
|
|
189
|
+
const data = await this.publicQuery(body);
|
|
190
|
+
return mapMobileFollowListPage(data);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Fetches a page of the accounts the given Profile follows. Ordering, cursor rules, and errors match
|
|
195
|
+
* {@link MobileClient.getFollowers}. When `viewAs` reads its own Following list every row is familiar, so
|
|
196
|
+
* every `isFollowing` is `true`.
|
|
197
|
+
*/
|
|
198
|
+
async getFollowing(
|
|
199
|
+
params: GetMobileFollowingParams,
|
|
200
|
+
): Promise<MobileFollowListPage> {
|
|
201
|
+
const body: MobileServerPublicQueryRequest<'following'> = {
|
|
202
|
+
type: 'following',
|
|
203
|
+
...mapMobileFollowListParamsToServer(params),
|
|
204
|
+
};
|
|
205
|
+
const data = await this.publicQuery(body);
|
|
206
|
+
return mapMobileFollowListPage(data);
|
|
207
|
+
}
|
|
208
|
+
|
|
169
209
|
/**
|
|
170
210
|
* Fetches a page of the global trade feed: public perpetual trades, newest first, optionally filtered by a
|
|
171
211
|
* whole-dollar minimum notional (omitted means unfiltered). Trades by subaccounts that have not claimed a
|
|
@@ -276,52 +316,6 @@ export class MobileClient {
|
|
|
276
316
|
return this.publicExecute(body);
|
|
277
317
|
}
|
|
278
318
|
|
|
279
|
-
/*
|
|
280
|
-
Signed queries
|
|
281
|
-
*/
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Fetches a page of the accounts that follow the given Profile.
|
|
285
|
-
*
|
|
286
|
-
* Familiar accounts (those the signing Viewer follows) come first, unfamiliar second, and within each group
|
|
287
|
-
* the newest listed relationship first with a bytes32 tie-break. The grouping is evaluated per request
|
|
288
|
-
* against the live graph, so following an account from inside the list moves it between groups on the next
|
|
289
|
-
* page — deduplicate by subaccount and do not re-sort locally.
|
|
290
|
-
*
|
|
291
|
-
* @throws {MobileServerFailureError} With error code `PROFILE_NOT_FOUND` if the viewed Profile is isolated,
|
|
292
|
-
* `INVALID_FOLLOW_CURSOR` if the cursor is malformed or was issued for a different Viewer, Profile, or list
|
|
293
|
-
* direction (discard it and restart from the first page), or `INVALID_FOLLOW_LIMIT` if `limit` is outside
|
|
294
|
-
* 1–50.
|
|
295
|
-
*/
|
|
296
|
-
async getFollowers(
|
|
297
|
-
params: GetMobileFollowersParams,
|
|
298
|
-
): Promise<MobileFollowListPage> {
|
|
299
|
-
const signedRequest = await this.getSignedRequest('followers', params, {
|
|
300
|
-
subaccount: subaccountToHex(params.target),
|
|
301
|
-
cursor: params.cursor ?? null,
|
|
302
|
-
limit: params.limit ?? null,
|
|
303
|
-
});
|
|
304
|
-
const data = await this.signedQuery(signedRequest);
|
|
305
|
-
return mapMobileFollowListPage(data);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Fetches a page of the accounts the given Profile follows. Ordering, cursor rules, and errors match
|
|
310
|
-
* {@link MobileClient.getFollowers}. When the Viewer reads their own Following list every row is familiar,
|
|
311
|
-
* so every `isFollowing` is `true`.
|
|
312
|
-
*/
|
|
313
|
-
async getFollowing(
|
|
314
|
-
params: GetMobileFollowingParams,
|
|
315
|
-
): Promise<MobileFollowListPage> {
|
|
316
|
-
const signedRequest = await this.getSignedRequest('following', params, {
|
|
317
|
-
subaccount: subaccountToHex(params.target),
|
|
318
|
-
cursor: params.cursor ?? null,
|
|
319
|
-
limit: params.limit ?? null,
|
|
320
|
-
});
|
|
321
|
-
const data = await this.signedQuery(signedRequest);
|
|
322
|
-
return mapMobileFollowListPage(data);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
319
|
/*
|
|
326
320
|
Signed executes
|
|
327
321
|
*/
|
|
@@ -413,8 +407,8 @@ export class MobileClient {
|
|
|
413
407
|
Base Fns
|
|
414
408
|
*/
|
|
415
409
|
|
|
416
|
-
// Returns the request narrowed to `type` so `execute`
|
|
417
|
-
//
|
|
410
|
+
// Returns the request narrowed to `type` so `execute` can infer its response from the request it is given,
|
|
411
|
+
// instead of being told the type a second time at the call site.
|
|
418
412
|
protected async getSignedRequest<T extends MobileSignedInner['type']>(
|
|
419
413
|
type: T,
|
|
420
414
|
params: MobileSignedRequestParams,
|
|
@@ -441,7 +435,7 @@ export class MobileClient {
|
|
|
441
435
|
body: { type: T } & MobileServerPublicQueryRequestByType[T],
|
|
442
436
|
): Promise<MobileServerPublicQuerySuccessResponse<T>> {
|
|
443
437
|
const response = await this.axiosInstance.post<unknown>(
|
|
444
|
-
`${this.opts.url}/
|
|
438
|
+
`${this.opts.url}/public_query`,
|
|
445
439
|
body,
|
|
446
440
|
);
|
|
447
441
|
|
|
@@ -456,7 +450,7 @@ export class MobileClient {
|
|
|
456
450
|
body: MobileServerPublicExecuteRequest,
|
|
457
451
|
): Promise<MobileServerSuccessResponse> {
|
|
458
452
|
const response = await this.axiosInstance.post<MobileServerExecuteResult>(
|
|
459
|
-
`${this.opts.url}/
|
|
453
|
+
`${this.opts.url}/public_execute`,
|
|
460
454
|
body,
|
|
461
455
|
);
|
|
462
456
|
|
|
@@ -473,7 +467,7 @@ export class MobileClient {
|
|
|
473
467
|
body: MobileSignedRequest & { type: T },
|
|
474
468
|
): Promise<MobileServerExecuteSuccessResponse<T>> {
|
|
475
469
|
const response = await this.axiosInstance.post<MobileServerExecuteResult>(
|
|
476
|
-
`${this.opts.url}/
|
|
470
|
+
`${this.opts.url}/execute`,
|
|
477
471
|
body,
|
|
478
472
|
);
|
|
479
473
|
|
|
@@ -484,21 +478,6 @@ export class MobileClient {
|
|
|
484
478
|
return response.data as MobileServerExecuteSuccessResponse<T>;
|
|
485
479
|
}
|
|
486
480
|
|
|
487
|
-
protected async signedQuery<T extends MobileServerSignedQueryRequestType>(
|
|
488
|
-
body: MobileSignedRequest & { type: T },
|
|
489
|
-
): Promise<MobileServerSignedQuerySuccessResponse<T>> {
|
|
490
|
-
const response = await this.axiosInstance.post<unknown>(
|
|
491
|
-
`${this.opts.url}/mobile/query`,
|
|
492
|
-
body,
|
|
493
|
-
);
|
|
494
|
-
|
|
495
|
-
this.checkResponseStatus(response);
|
|
496
|
-
this.checkServerStatus(response);
|
|
497
|
-
|
|
498
|
-
// checkServerStatus throws on failure responses so the cast to the success response is acceptable here
|
|
499
|
-
return response.data as MobileServerSignedQuerySuccessResponse<T>;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
481
|
/**
|
|
503
482
|
* Validates the HTTP status before interpreting the body. Unlike the engine, the mobile backend returns
|
|
504
483
|
* failure envelopes with non-2xx statuses (e.g. 404 for `PROFILE_NOT_FOUND`), so a non-2xx response with a
|
package/src/dataMappers.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { subaccountToHex } from '@nadohq/shared';
|
|
2
2
|
import {
|
|
3
|
+
GetMobileFollowListParams,
|
|
3
4
|
MobileFeedPage,
|
|
4
5
|
MobileFeedTrade,
|
|
5
6
|
MobileFollowListPage,
|
|
@@ -26,7 +27,10 @@ import {
|
|
|
26
27
|
MobileServerFollowListResponse,
|
|
27
28
|
MobileServerRegisteredWalletResponse,
|
|
28
29
|
} from './types/serverQueryTypes';
|
|
29
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
MobileServerFollowListRequest,
|
|
32
|
+
MobileServerProfilesInclude,
|
|
33
|
+
} from './types/serverRequestTypes';
|
|
30
34
|
|
|
31
35
|
/**
|
|
32
36
|
* Maps a server-side public profile (snake_case) to its client-side (camelCase) representation. The three
|
|
@@ -77,7 +81,8 @@ function mapMobileFollowSummary(
|
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
/**
|
|
80
|
-
* Maps a server-side Followers or Following response to a client-side {@link MobileFollowListPage}.
|
|
84
|
+
* Maps a server-side Followers or Following response to a client-side {@link MobileFollowListPage}. Rows
|
|
85
|
+
* keep `isFollowing` absent when the request named no `viewAs`, rather than defaulting it to `false`.
|
|
81
86
|
*/
|
|
82
87
|
export function mapMobileFollowListPage(
|
|
83
88
|
server: MobileServerFollowListResponse,
|
|
@@ -143,6 +148,21 @@ export function mapMobileProfilesIncludeToServer(
|
|
|
143
148
|
};
|
|
144
149
|
}
|
|
145
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Maps the client-side params of a Followers or Following page to the server-side wire shape. Both list
|
|
153
|
+
* directions take identical params and differ only in the `type` the caller dispatches on.
|
|
154
|
+
*/
|
|
155
|
+
export function mapMobileFollowListParamsToServer(
|
|
156
|
+
params: GetMobileFollowListParams,
|
|
157
|
+
): MobileServerFollowListRequest {
|
|
158
|
+
return {
|
|
159
|
+
subaccount: subaccountToHex(params.target),
|
|
160
|
+
view_as: params.viewAs ? subaccountToHex(params.viewAs) : undefined,
|
|
161
|
+
cursor: params.cursor,
|
|
162
|
+
limit: params.limit,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
146
166
|
/**
|
|
147
167
|
* Maps client-side notification preferences (camelCase) to the server-side (snake_case) wire shape.
|
|
148
168
|
*/
|
package/src/endpoints.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ChainEnv } from '@nadohq/shared';
|
|
|
4
4
|
* Base URLs for the Nado mobile service API, keyed by chain environment.
|
|
5
5
|
*/
|
|
6
6
|
export const MOBILE_CLIENT_ENDPOINTS: Record<ChainEnv, string> = {
|
|
7
|
-
local: 'http://mobile.local.nado.xyz:8004/v1',
|
|
8
|
-
inkTestnet: 'https://
|
|
9
|
-
inkMainnet: 'https://
|
|
7
|
+
local: 'http://mobile.local.nado.xyz:8004/v1/mobile',
|
|
8
|
+
inkTestnet: 'https://api.test.nado.xyz/mobile/v1',
|
|
9
|
+
inkMainnet: 'https://api.prod.nado.xyz/mobile/v1',
|
|
10
10
|
};
|
|
@@ -29,20 +29,6 @@ export function canonicalizeMobileInner(
|
|
|
29
29
|
subaccount: inner.subaccount,
|
|
30
30
|
is_following: inner.is_following,
|
|
31
31
|
};
|
|
32
|
-
case 'followers':
|
|
33
|
-
return {
|
|
34
|
-
type: 'followers',
|
|
35
|
-
subaccount: inner.subaccount,
|
|
36
|
-
cursor: inner.cursor,
|
|
37
|
-
limit: inner.limit,
|
|
38
|
-
};
|
|
39
|
-
case 'following':
|
|
40
|
-
return {
|
|
41
|
-
type: 'following',
|
|
42
|
-
subaccount: inner.subaccount,
|
|
43
|
-
cursor: inner.cursor,
|
|
44
|
-
limit: inner.limit,
|
|
45
|
-
};
|
|
46
32
|
default: {
|
|
47
33
|
throw new Error(
|
|
48
34
|
`canonicalizeMobileInner: unhandled inner payload type: ${JSON.stringify(inner)}`,
|
|
@@ -11,6 +11,4 @@ export const MOBILE_EIP712_METHOD_BY_TYPE: Record<
|
|
|
11
11
|
set_private_mode: 'mobile:execute_set_private_mode',
|
|
12
12
|
register_expo_token: 'mobile:execute_register_expo_token',
|
|
13
13
|
set_follow: 'mobile:execute_set_follow',
|
|
14
|
-
followers: 'mobile:query_followers',
|
|
15
|
-
following: 'mobile:query_following',
|
|
16
14
|
};
|